fix(referral): remove LeaderboardCacheService dependency
Leaderboard functionality has been moved to leaderboard-service. Remove the dependency and set leaderboardRank to null. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
49fc68297b
commit
8de7a668f0
|
|
@ -7,7 +7,7 @@ import {
|
||||||
ReferralRelationship,
|
ReferralRelationship,
|
||||||
ReferralChainService,
|
ReferralChainService,
|
||||||
} from '../../domain';
|
} from '../../domain';
|
||||||
import { EventPublisherService, LeaderboardCacheService } from '../../infrastructure';
|
import { EventPublisherService } from '../../infrastructure';
|
||||||
import { CreateReferralRelationshipCommand } from '../commands';
|
import { CreateReferralRelationshipCommand } from '../commands';
|
||||||
import {
|
import {
|
||||||
GetUserReferralInfoQuery,
|
GetUserReferralInfoQuery,
|
||||||
|
|
@ -27,7 +27,6 @@ export class ReferralService {
|
||||||
private readonly teamStatsRepo: ITeamStatisticsRepository,
|
private readonly teamStatsRepo: ITeamStatisticsRepository,
|
||||||
private readonly referralChainService: ReferralChainService,
|
private readonly referralChainService: ReferralChainService,
|
||||||
private readonly eventPublisher: EventPublisherService,
|
private readonly eventPublisher: EventPublisherService,
|
||||||
private readonly leaderboardCache: LeaderboardCacheService,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -118,7 +117,6 @@ export class ReferralService {
|
||||||
}
|
}
|
||||||
|
|
||||||
const teamStats = await this.teamStatsRepo.findByUserId(query.userId);
|
const teamStats = await this.teamStatsRepo.findByUserId(query.userId);
|
||||||
const rank = await this.leaderboardCache.getUserRank(query.userId);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
userId: relationship.userId.toString(),
|
userId: relationship.userId.toString(),
|
||||||
|
|
@ -130,7 +128,7 @@ export class ReferralService {
|
||||||
personalPlantingCount: teamStats?.personalPlantingCount ?? 0,
|
personalPlantingCount: teamStats?.personalPlantingCount ?? 0,
|
||||||
teamPlantingCount: teamStats?.teamPlantingCount ?? 0,
|
teamPlantingCount: teamStats?.teamPlantingCount ?? 0,
|
||||||
leaderboardScore: teamStats?.leaderboardScore ?? 0,
|
leaderboardScore: teamStats?.leaderboardScore ?? 0,
|
||||||
leaderboardRank: rank,
|
leaderboardRank: null, // 排行榜功能已移至 leaderboard-service
|
||||||
createdAt: relationship.createdAt,
|
createdAt: relationship.createdAt,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue