From 7c043be8d75e920e40be0ec64a5e58faff21c1ed Mon Sep 17 00:00:00 2001 From: hujiebin Date: Mon, 13 Mar 2023 12:00:47 +0800 Subject: [PATCH] omitempty --- cv/group_power_cv/group_rank.go | 4 ++-- route/group_power_r/group_rank.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cv/group_power_cv/group_rank.go b/cv/group_power_cv/group_rank.go index 3f15577..f171c07 100644 --- a/cv/group_power_cv/group_rank.go +++ b/cv/group_power_cv/group_rank.go @@ -37,8 +37,8 @@ type CvGroupPowerGrade struct { // 家族榜单 type CvGroupPowerRank struct { - MyGroupPower CvGroupPowerRankData `json:"myGroupPower"` // 我的家族排名 - Items []CvGroupPowerRankData `json:"items"` // 列表 + MyGroupPower *CvGroupPowerRankData `json:"myGroupPower,omitempty"` // 我的家族排名 + Items []CvGroupPowerRankData `json:"items"` // 列表 } type CvGroupPowerRankData struct { diff --git a/route/group_power_r/group_rank.go b/route/group_power_r/group_rank.go index 7ff7937..d0289f7 100644 --- a/route/group_power_r/group_rank.go +++ b/route/group_power_r/group_rank.go @@ -75,7 +75,7 @@ func GroupPowerRank(c *gin.Context) (*mycontext.MyContext, error) { if err != nil { return myContext, err } - response.MyGroupPower = group_power_cv.CvGroupPowerRankData{ + response.MyGroupPower = &group_power_cv.CvGroupPowerRankData{ CvGroupPowerBase: group_power_cv.CvGroupPowerBase{ GroupPowerId: myGroupPower.GroupPowerId, Icon: groupPowers[myGroupPower.GroupPowerId].Icon, -- 2.22.0