Some checks failed
/ build-services (app/auth_service/Dockerfile, auth, auth) (push) Has been cancelled
/ build-services (app/ecpm_service/Dockerfile, ecpm, ecpm) (push) Has been cancelled
/ build-services (app/ranking_service/Dockerfile, ranking, ranking) (push) Has been cancelled
/ build-services (app/user_service/Dockerfile, user, user) (push) Has been cancelled
/ start-services (push) Has been cancelled
35 lines
914 B
Go
35 lines
914 B
Go
package logic
|
|
|
|
import (
|
|
"context"
|
|
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/logic/rankings"
|
|
|
|
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/svc"
|
|
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/ranking"
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
)
|
|
|
|
type RemoveRankingLogic struct {
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
logx.Logger
|
|
}
|
|
|
|
func NewRemoveRankingLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RemoveRankingLogic {
|
|
return &RemoveRankingLogic{
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
Logger: logx.WithContext(ctx),
|
|
}
|
|
}
|
|
|
|
func (l *RemoveRankingLogic) RemoveRanking(in *ranking.RemoveRankingRequest) (*ranking.BaseResult, error) {
|
|
cacheKey := rankings.GetRankingsCacheKey(in.AppId, in.Type)
|
|
err := l.svcCtx.RedisRanking.Remove(l.ctx, cacheKey)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &ranking.BaseResult{}, nil
|
|
}
|