From ed24d79a74f916c9f10e43bd54281c98d30d6116 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Thu, 15 Jun 2023 20:36:09 +0800 Subject: [PATCH] Update rank.go --- route/cp_r/rank.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/route/cp_r/rank.go b/route/cp_r/rank.go index e9e0697..233b807 100644 --- a/route/cp_r/rank.go +++ b/route/cp_r/rank.go @@ -245,13 +245,17 @@ func CpMy(c *gin.Context) (*mycontext.MyContext, error) { func CpAchievement(c *gin.Context) (*mycontext.MyContext, error) { myCtx := mycontext.CreateMyContext(c.Keys) model := domain.CreateModelContext(myCtx) + _, lang, err := req.GetUserIdLang(c, myCtx) + if err != nil { + return myCtx, err + } var response = make([]cp_cv.CvCpAchievement, 0) - TypeDescMap := map[cp_e.CpAchievement]string{ // todo 翻译 - cp_e.CpAchievementLevel: "等级分值最高", - cp_e.CpAchievementVisitors: "空间访问量最高", - cp_e.CpAchievementMonthRank: "月榜最高", - cp_e.CpAchievementWeekRank: "周榜最高", - cp_e.CpAchievementDayRank: "天榜最高", + TypeDescMap := map[cp_e.CpAchievement]uint{ + cp_e.CpAchievementLevel: 280, //"等级分值最高", + cp_e.CpAchievementVisitors: 281, //"空间访问量最高", + cp_e.CpAchievementMonthRank: 282, //"月榜最高", + cp_e.CpAchievementWeekRank: 283, //"周榜最高", + cp_e.CpAchievementDayRank: 284, //"天榜最高", } achievements := cp_m.GetCpAchievements(model) var userIds []uint64 @@ -269,7 +273,7 @@ func CpAchievement(c *gin.Context) (*mycontext.MyContext, error) { User1: user_cv.UserToTiny(users[a.UserId1]), User2: user_cv.UserToTiny(users[a.UserId2]), Type: a.Type, - TypeDesc: TypeDescMap[a.Type], + TypeDesc: cp_m.GetTranslate(TypeDescMap[a.Type], lang), Score: a.Score, TimeUnix: a.UpdatedTime.Unix(), }) -- 2.22.0