diff --git a/route/cp_r/rank.go b/route/cp_r/rank.go index e9e0697fb2d649cb4b13cbd22a8d5628947fcee2..233b807fee542307bc0ea8f8d3851a44e18e4b94 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(), })