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:
hailin 2025-12-09 22:13:57 -08:00
parent 49fc68297b
commit 8de7a668f0
1 changed files with 2 additions and 4 deletions

View File

@ -7,7 +7,7 @@ import {
ReferralRelationship,
ReferralChainService,
} from '../../domain';
import { EventPublisherService, LeaderboardCacheService } from '../../infrastructure';
import { EventPublisherService } from '../../infrastructure';
import { CreateReferralRelationshipCommand } from '../commands';
import {
GetUserReferralInfoQuery,
@ -27,7 +27,6 @@ export class ReferralService {
private readonly teamStatsRepo: ITeamStatisticsRepository,
private readonly referralChainService: ReferralChainService,
private readonly eventPublisher: EventPublisherService,
private readonly leaderboardCache: LeaderboardCacheService,
) {}
/**
@ -118,7 +117,6 @@ export class ReferralService {
}
const teamStats = await this.teamStatsRepo.findByUserId(query.userId);
const rank = await this.leaderboardCache.getUserRank(query.userId);
return {
userId: relationship.userId.toString(),
@ -130,7 +128,7 @@ export class ReferralService {
personalPlantingCount: teamStats?.personalPlantingCount ?? 0,
teamPlantingCount: teamStats?.teamPlantingCount ?? 0,
leaderboardScore: teamStats?.leaderboardScore ?? 0,
leaderboardRank: rank,
leaderboardRank: null, // 排行榜功能已移至 leaderboard-service
createdAt: relationship.createdAt,
};
}