Commit 97424e43 authored by hujiebin's avatar hujiebin

是否家族成员

parent 8374d886
...@@ -32,7 +32,6 @@ type CvGroupPowerGrade struct { ...@@ -32,7 +32,6 @@ type CvGroupPowerGrade struct {
Exp uint32 `json:"exp"` // 经验值 Exp uint32 `json:"exp"` // 经验值
NextExp uint32 `json:"nextExp,omitempty"` // 升级所需经验值 NextExp uint32 `json:"nextExp,omitempty"` // 升级所需经验值
ExpireAt string `json:"expireAt,omitempty"` // 有效期 ExpireAt string `json:"expireAt,omitempty"` // 有效期
ShowExp bool `json:"showExp"` // 是否展示经验值
} }
// 家族榜单 // 家族榜单
...@@ -72,6 +71,7 @@ type CvGroupPowerGradeDetail struct { ...@@ -72,6 +71,7 @@ type CvGroupPowerGradeDetail struct {
GroupPowerGrade CvGroupPowerGrade `json:"groupPowerGrade"` // 家族等级信息 GroupPowerGrade CvGroupPowerGrade `json:"groupPowerGrade"` // 家族等级信息
ResGradeList []CvResGrade `json:"resGradeList"` // 资源等级列表,青铜、白银、黄金、黑金 ResGradeList []CvResGrade `json:"resGradeList"` // 资源等级列表,青铜、白银、黄金、黑金
PrivilegeList []CvPrivilege `json:"privilegeList"` // 等级特权 PrivilegeList []CvPrivilege `json:"privilegeList"` // 等级特权
IsMember bool `json:"isMember"` // 是否家族成员
} }
var CvResGradeList = []CvResGrade{ var CvResGradeList = []CvResGrade{
......
...@@ -204,11 +204,11 @@ func GroupPowerGradeDetail(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -204,11 +204,11 @@ func GroupPowerGradeDetail(c *gin.Context) (*mycontext.MyContext, error) {
if grade.ExpireAt.After(time.Now()) { if grade.ExpireAt.After(time.Now()) {
expireAt = grade.ExpireAt.Format("2006-01-02") expireAt = grade.ExpireAt.Format("2006-01-02")
} }
showExp := false isMember := false
if exits, _, err := groupPower_m.CheckGroupPowerUser(model, userId); err != nil { if exits, _, err := groupPower_m.CheckGroupPowerUser(model, userId); err != nil {
return myContext, err return myContext, err
} else if exits { } else if exits {
showExp = true isMember = true
} }
response := group_power_cv.CvGroupPowerGradeDetail{ response := group_power_cv.CvGroupPowerGradeDetail{
GroupPowerBase: group_power_cv.CvGroupPowerBase{ GroupPowerBase: group_power_cv.CvGroupPowerBase{
...@@ -222,10 +222,10 @@ func GroupPowerGradeDetail(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -222,10 +222,10 @@ func GroupPowerGradeDetail(c *gin.Context) (*mycontext.MyContext, error) {
Exp: grade.Exp, Exp: grade.Exp,
NextExp: nextExp, NextExp: nextExp,
ExpireAt: expireAt, ExpireAt: expireAt,
ShowExp: showExp,
}, },
ResGradeList: group_power_cv.CvResGradeList, ResGradeList: group_power_cv.CvResGradeList,
PrivilegeList: group_power_cv.GroupPowerGradePrivilegeNum[grade.Grade], PrivilegeList: group_power_cv.GroupPowerGradePrivilegeNum[grade.Grade],
IsMember: isMember,
} }
resp.ResponseOk(c, response) resp.ResponseOk(c, response)
return myContext, nil return myContext, nil
......
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