Commit 7888f2b4 authored by hujiebin's avatar hujiebin

Merge branch 'feature/family' into feature/3.5

parents 7d4a2878 deb8fec0
...@@ -13,7 +13,7 @@ type CvGroupPowerInfo struct { ...@@ -13,7 +13,7 @@ type CvGroupPowerInfo struct {
// 家族基本信息 // 家族基本信息
type CvGroupPowerBase struct { type CvGroupPowerBase struct {
GroupPowerId uint64 `json:"groupPowerId"` // 家族id Id uint64 `json:"id"` // 家族id
Icon string `json:"icon"` // 家族图片 Icon string `json:"icon"` // 家族图片
Name string `json:"name"` // 家族名 Name string `json:"name"` // 家族名
Nameplate string `json:"nameplate"` // 铭牌 Nameplate string `json:"nameplate"` // 铭牌
...@@ -22,7 +22,7 @@ type CvGroupPowerBase struct { ...@@ -22,7 +22,7 @@ type CvGroupPowerBase struct {
// 家族成员 // 家族成员
type CvGroupPowerMember struct { type CvGroupPowerMember struct {
MemberNum uint32 `json:"memberNum"` // 当前成员数 MemberNum uint32 `json:"memberNum"` // 当前成员数
MemberLimit uint32 `json:"memberLimit" swaggertype:"integer"` // 成员上限 MemberMax uint32 `json:"memberMax"` // 成员上限
} }
// 家族等级 // 家族等级
......
...@@ -74,7 +74,7 @@ func GroupPowerRank(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -74,7 +74,7 @@ func GroupPowerRank(c *gin.Context) (*mycontext.MyContext, error) {
if myGroupPower != nil && v.GroupPowerId == myGroupPower.GroupPowerId && myGroupPower.Role == groupPower_e.GroupPowerUserRoleMgr { if myGroupPower != nil && v.GroupPowerId == myGroupPower.GroupPowerId && myGroupPower.Role == groupPower_e.GroupPowerUserRoleMgr {
response.MyGroupPower = &group_power_cv.CvGroupPowerRankData{ response.MyGroupPower = &group_power_cv.CvGroupPowerRankData{
CvGroupPowerBase: group_power_cv.CvGroupPowerBase{ CvGroupPowerBase: group_power_cv.CvGroupPowerBase{
GroupPowerId: myGroupPower.GroupPowerId, Id: myGroupPower.GroupPowerId,
Icon: groupPowers[myGroupPower.GroupPowerId].Icon, Icon: groupPowers[myGroupPower.GroupPowerId].Icon,
Name: groupPowers[myGroupPower.GroupPowerId].Name, Name: groupPowers[myGroupPower.GroupPowerId].Name,
Nameplate: groupPowers[myGroupPower.GroupPowerId].Nameplate, Nameplate: groupPowers[myGroupPower.GroupPowerId].Nameplate,
...@@ -88,7 +88,7 @@ func GroupPowerRank(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -88,7 +88,7 @@ func GroupPowerRank(c *gin.Context) (*mycontext.MyContext, error) {
} }
response.Items = append(response.Items, group_power_cv.CvGroupPowerRankData{ response.Items = append(response.Items, group_power_cv.CvGroupPowerRankData{
CvGroupPowerBase: group_power_cv.CvGroupPowerBase{ CvGroupPowerBase: group_power_cv.CvGroupPowerBase{
GroupPowerId: v.GroupPowerId, Id: v.GroupPowerId,
Icon: groupPowers[v.GroupPowerId].Icon, Icon: groupPowers[v.GroupPowerId].Icon,
Name: groupPowers[v.GroupPowerId].Name, Name: groupPowers[v.GroupPowerId].Name,
Nameplate: groupPowers[v.GroupPowerId].Nameplate, Nameplate: groupPowers[v.GroupPowerId].Nameplate,
...@@ -212,7 +212,7 @@ func GroupPowerGradeDetail(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -212,7 +212,7 @@ func GroupPowerGradeDetail(c *gin.Context) (*mycontext.MyContext, error) {
} }
response := group_power_cv.CvGroupPowerGradeDetail{ response := group_power_cv.CvGroupPowerGradeDetail{
GroupPowerBase: group_power_cv.CvGroupPowerBase{ GroupPowerBase: group_power_cv.CvGroupPowerBase{
GroupPowerId: groupPower.ID, Id: groupPower.ID,
Icon: groupPower.Icon, Icon: groupPower.Icon,
Name: groupPower.Name, Name: groupPower.Name,
Nameplate: groupPower.Nameplate, Nameplate: groupPower.Nameplate,
......
...@@ -45,25 +45,25 @@ func MGetGroupPowers(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -45,25 +45,25 @@ func MGetGroupPowers(c *gin.Context) (*mycontext.MyContext, error) {
response := make(map[mysql.ID]group_power_cv.CvGroupPowerInfo) response := make(map[mysql.ID]group_power_cv.CvGroupPowerInfo)
for groupPowerId, info := range groupPowers { for groupPowerId, info := range groupPowers {
// 成员上限 // 成员上限
var memberLimit mysql.Num var memberMax mysql.Num
grade := groupPowerGrade[groupPowerId].Grade grade := groupPowerGrade[groupPowerId].Grade
if grade >= groupPower_e.GroupPowerGrade0 && grade <= groupPower_e.GroupPowerGradeMax { if grade >= groupPower_e.GroupPowerGrade0 && grade <= groupPower_e.GroupPowerGradeMax {
memberLimit = mysql.Num(group_power_cv.GroupPowerGradePrivilegeNum[groupPowerGrade[groupPowerId].Grade][0].Num) memberMax = mysql.Num(group_power_cv.GroupPowerGradePrivilegeNum[groupPowerGrade[groupPowerId].Grade][0].Num)
} }
memberNum := mysql.Num(len(groupPowerUsers[groupPowerId])) memberNum := mysql.Num(len(groupPowerUsers[groupPowerId]))
if memberNum > memberLimit { if memberNum > memberMax {
memberLimit = memberNum memberMax = memberNum
} }
response[groupPowerId] = group_power_cv.CvGroupPowerInfo{ response[groupPowerId] = group_power_cv.CvGroupPowerInfo{
CvGroupPowerBase: group_power_cv.CvGroupPowerBase{ CvGroupPowerBase: group_power_cv.CvGroupPowerBase{
GroupPowerId: groupPowerId, Id: groupPowerId,
Icon: info.Icon, Icon: info.Icon,
Name: info.Name, Name: info.Name,
Nameplate: info.Nameplate, Nameplate: info.Nameplate,
}, },
CvGroupPowerMember: group_power_cv.CvGroupPowerMember{ CvGroupPowerMember: group_power_cv.CvGroupPowerMember{
MemberNum: memberNum, MemberNum: memberNum,
MemberLimit: memberLimit, MemberMax: memberMax,
}, },
} }
} }
......
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