作者 yangfu

成果详情修改

... ... @@ -126,3 +126,8 @@ func Test_RedisLock(t *testing.T) {
//}()
//time.Sleep(11*time.Second)
}
func TestSlice(t *testing.T) {
var array = []int{1, 2, 3, 4, 5}
t.Log(array[0:4])
}
... ...
... ... @@ -49,8 +49,8 @@ func AchievementPool(header *protocol.RequestHeader, request *protocol.Achieveme
rspItem := &protocol.AchievementCommonListItem{
Achievement: GetAchievementItem(header, item),
GraspScore: protocol.GraspScore{
GraspScore: item.GraspScore,
GraspScorePercent: item.GraspScore,
GraspScore: item.UserGraspScore,
GraspScorePercent: item.UserGraspScore,
},
StatisticData: GetStatisticData(header, item.StaticDataOrm, item.AchievementId),
ChanceTemplate: getTemplate(item.TemplateId),
... ... @@ -136,8 +136,8 @@ func AchievementDetail(header *protocol.RequestHeader, request *protocol.Achieve
{
rsp.Achievement = GetAchievementItem(header, item)
rsp.GraspScore = protocol.GraspScore{
GraspScore: item.GraspScore,
GraspScorePercent: item.GraspScore,
GraspScore: item.UserGraspScore,
GraspScorePercent: item.UserGraspScore,
}
rsp.StatisticData = GetStatisticData(header, item.StaticDataOrm, item.AchievementId)
rsp.ChanceTemplate = getTemplate(item.TemplateId)
... ...
... ... @@ -100,7 +100,7 @@ func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRe
}
}
if len(itemKeys) != len(rsp.Lists) {
if len(rsp.Lists) > 0 && len(itemKeys) != len(rsp.Lists) {
log.Error("数据项不匹配", itemKeys, len(rsp.Lists))
err = protocol.NewErrWithMessage(1)
return
... ... @@ -226,6 +226,10 @@ func GetRankSortItems(header *protocol.RequestHeader, request *protocol.GetRankS
return
}
if len(sortItems) > 0 {
if len(sortItems) > 4 {
rsp.RankSortItems = sortItems[0:4]
return
}
rsp.RankSortItems = sortItems
}
return
... ...