Commit ed24d79a authored by hujiebin's avatar hujiebin

Update rank.go

parent ba988e4e
...@@ -245,13 +245,17 @@ func CpMy(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -245,13 +245,17 @@ func CpMy(c *gin.Context) (*mycontext.MyContext, error) {
func CpAchievement(c *gin.Context) (*mycontext.MyContext, error) { func CpAchievement(c *gin.Context) (*mycontext.MyContext, error) {
myCtx := mycontext.CreateMyContext(c.Keys) myCtx := mycontext.CreateMyContext(c.Keys)
model := domain.CreateModelContext(myCtx) model := domain.CreateModelContext(myCtx)
_, lang, err := req.GetUserIdLang(c, myCtx)
if err != nil {
return myCtx, err
}
var response = make([]cp_cv.CvCpAchievement, 0) var response = make([]cp_cv.CvCpAchievement, 0)
TypeDescMap := map[cp_e.CpAchievement]string{ // todo 翻译 TypeDescMap := map[cp_e.CpAchievement]uint{
cp_e.CpAchievementLevel: "等级分值最高", cp_e.CpAchievementLevel: 280, //"等级分值最高",
cp_e.CpAchievementVisitors: "空间访问量最高", cp_e.CpAchievementVisitors: 281, //"空间访问量最高",
cp_e.CpAchievementMonthRank: "月榜最高", cp_e.CpAchievementMonthRank: 282, //"月榜最高",
cp_e.CpAchievementWeekRank: "周榜最高", cp_e.CpAchievementWeekRank: 283, //"周榜最高",
cp_e.CpAchievementDayRank: "天榜最高", cp_e.CpAchievementDayRank: 284, //"天榜最高",
} }
achievements := cp_m.GetCpAchievements(model) achievements := cp_m.GetCpAchievements(model)
var userIds []uint64 var userIds []uint64
...@@ -269,7 +273,7 @@ func CpAchievement(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -269,7 +273,7 @@ func CpAchievement(c *gin.Context) (*mycontext.MyContext, error) {
User1: user_cv.UserToTiny(users[a.UserId1]), User1: user_cv.UserToTiny(users[a.UserId1]),
User2: user_cv.UserToTiny(users[a.UserId2]), User2: user_cv.UserToTiny(users[a.UserId2]),
Type: a.Type, Type: a.Type,
TypeDesc: TypeDescMap[a.Type], TypeDesc: cp_m.GetTranslate(TypeDescMap[a.Type], lang),
Score: a.Score, Score: a.Score,
TimeUnix: a.UpdatedTime.Unix(), TimeUnix: a.UpdatedTime.Unix(),
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment