1d47fb1a1d
- Removed the PosGoodFavorite module, controller, and service to simplify the codebase. - Updated goods service to handle cache invalidation directly. - Refactored goods controller to remove commented-out code and improve clarity. - Introduced OwnedGoods module for better organization of owned goods functionality. - Updated DTOs to extend from existing structures for consistency. - Enhanced cache invalidation logic in goods service and owned goods service.
18 lines
698 B
TypeScript
18 lines
698 B
TypeScript
import { RedisKeyMaker } from '@/common/utils/redisKeyMaker'
|
|
import { PosCacheInvalidationService } from '@/modules/pos/cache/pos-cache-invalidation.service'
|
|
import { RedisService } from '@/redis/redis.service'
|
|
import { Injectable } from '@nestjs/common'
|
|
|
|
@Injectable()
|
|
export class AdminGuildCacheInvalidationService {
|
|
constructor(
|
|
private readonly redisService: RedisService,
|
|
private readonly posCacheInvalidationService: PosCacheInvalidationService,
|
|
) {}
|
|
|
|
async invalidateGoodsList(guildId: string): Promise<void> {
|
|
await this.redisService.delete(RedisKeyMaker.guildGoodsList(guildId))
|
|
await this.posCacheInvalidationService.invalidatePosGoodsByGuildPattern(guildId)
|
|
}
|
|
}
|