group_rank.go 4.35 KB
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4
package group_power_cv

import (
	"hilo-group/_const/enum/groupPower_e"
hujiebin's avatar
hujiebin committed
5
	"hilo-group/cv/user_cv"
hujiebin's avatar
hujiebin committed
6 7
)

hujiebin's avatar
hujiebin committed
8
// 家族信息
hujiebin's avatar
hujiebin committed
9
type CvGroupPowerInfo struct {
hujiebin's avatar
hujiebin committed
10 11
	CvGroupPowerBase   `json:",inline"`
	CvGroupPowerMember `json:",inline"`
hujiebin's avatar
hujiebin committed
12
	CvGroupPowerGrade  `json:",inline"`
hujiebin's avatar
hujiebin committed
13 14 15 16
}

// 家族基本信息
type CvGroupPowerBase struct {
17 18 19 20
	Id        uint64 `json:"id"`        // 家族id
	Icon      string `json:"icon"`      // 家族图片
	Name      string `json:"name"`      // 家族名
	Nameplate string `json:"nameplate"` // 铭牌
hujiebin's avatar
hujiebin committed
21 22
}

hujiebin's avatar
hujiebin committed
23 24
// 家族成员
type CvGroupPowerMember struct {
25 26
	MemberNum uint32 `json:"memberNum"` // 当前成员数
	MemberMax uint32 `json:"memberMax"` // 成员上限
hujiebin's avatar
hujiebin committed
27 28
}

hujiebin's avatar
hujiebin committed
29 30
// 家族等级
type CvGroupPowerGrade struct {
hujiebin's avatar
hujiebin committed
31
	Grade    groupPower_e.GroupPowerGrade `json:"grade"`              // 等级 0:青铜 1:白银 2:黄金 3:黑金
hujiebin's avatar
hujiebin committed
32
	Exp      uint32                       `json:"exp"`                // 经验值
hujiebin's avatar
hujiebin committed
33
	NextExp  uint32                       `json:"nextExp,omitempty"`  // 下个等级所需经验值
hujiebin's avatar
hujiebin committed
34 35 36
	ExpireAt string                       `json:"expireAt,omitempty"` // 有效期
}

hujiebin's avatar
hujiebin committed
37 38
// 家族榜单
type CvGroupPowerRank struct {
hujiebin's avatar
hujiebin committed
39 40
	MyGroupPower *CvGroupPowerRankData  `json:"myGroupPower,omitempty"` // 我的家族排名
	Items        []CvGroupPowerRankData `json:"items"`                  // 列表
hujiebin's avatar
hujiebin committed
41 42
}

hujiebin's avatar
hujiebin committed
43 44 45 46 47
type CvGroupPowerRankTop3 struct {
	Period string                 `json:"period"` // 榜单周期 day:日 week:周 month:月
	Items  []CvGroupPowerRankData `json:"items"`  // 列表
}

hujiebin's avatar
hujiebin committed
48
type CvGroupPowerRankData struct {
hujiebin's avatar
hujiebin committed
49
	CvGroupPowerBase  `json:",inline"`
hujiebin's avatar
hujiebin committed
50 51
	CvGroupPowerGrade `json:",inline"`
	Rank              int `json:"rank"` // 排名
hujiebin's avatar
hujiebin committed
52 53
}

hujiebin's avatar
hujiebin committed
54 55
// 家族之星
type CvGroupPowerStarData struct {
hujiebin's avatar
hujiebin committed
56
	User  user_cv.CvUserTiny `json:"user"`
hujiebin's avatar
hujiebin committed
57
	Score uint32             `json:"score"` // 对应分值
hujiebin's avatar
hujiebin committed
58
}
hujiebin's avatar
hujiebin committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

// 资源等级
type CvResGrade struct {
	Grade   groupPower_e.GroupPowerGrade `json:"grade"`   // 等级
	Icon    string                       `json:"icon"`    // 等级icon
	BigIcon string                       `json:"bigIcon"` // 等级大图标
}

// 特权信息
type CvPrivilege struct {
	Type groupPower_e.GroupPowerPrivilege `json:"type"` // 特权id 1:成员数 2:管理员数 3:家族铭牌 4:家族徽章装饰 5:编辑铭牌 6:家族头饰
	Num  int                              `json:"num"`  // 数目
}

// 家族等级页
type CvGroupPowerGradeDetail struct {
hujiebin's avatar
hujiebin committed
75
	GroupPowerBase  CvGroupPowerBase  `json:"groupPowerBase"`  // 家族基本信息
hujiebin's avatar
hujiebin committed
76 77 78
	GroupPowerGrade CvGroupPowerGrade `json:"groupPowerGrade"` // 家族等级信息
	ResGradeList    []CvResGrade      `json:"resGradeList"`    // 资源等级列表,青铜、白银、黄金、黑金
	PrivilegeList   []CvPrivilege     `json:"privilegeList"`   // 等级特权
hujiebin's avatar
hujiebin committed
79
	IsMember        bool              `json:"isMember"`        // 是否家族成员
hujiebin's avatar
hujiebin committed
80 81 82
}

var CvResGradeList = []CvResGrade{
hujiebin's avatar
hujiebin committed
83 84 85 86
	{groupPower_e.GroupPowerGrade0, "青铜icon", "青铜bigIcon"}, // todo
	{groupPower_e.GroupPowerGrade1, "白银icon", "白银bigIcon"}, // todo
	{groupPower_e.GroupPowerGrade2, "黄金icon", "黄金bigIcon"}, // todo
	{groupPower_e.GroupPowerGrade3, "黑金icon", "黑金bigIcon"}, // todo
hujiebin's avatar
hujiebin committed
87 88 89
}

var GroupPowerGradePrivilegeNum = map[groupPower_e.GroupPowerGrade][]CvPrivilege{
hujiebin's avatar
hujiebin committed
90
	groupPower_e.GroupPowerGrade0: {
hujiebin's avatar
hujiebin committed
91 92 93 94 95
		{groupPower_e.GroupPowerPrivilegeMemberNum, 300},
		{groupPower_e.GroupPowerPrivilegeMgrNum, 10},
		{groupPower_e.GroupPowerPrivilegeNameplate, 1},
		{groupPower_e.GroupPowerPrivilegeMedal, 1},
	},
hujiebin's avatar
hujiebin committed
96
	groupPower_e.GroupPowerGrade1: {
hujiebin's avatar
hujiebin committed
97 98 99 100 101 102
		{groupPower_e.GroupPowerPrivilegeMemberNum, 500},
		{groupPower_e.GroupPowerPrivilegeMgrNum, 15},
		{groupPower_e.GroupPowerPrivilegeNameplate, 1},
		{groupPower_e.GroupPowerPrivilegeMedal, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateEdit, 1},
	},
hujiebin's avatar
hujiebin committed
103
	groupPower_e.GroupPowerGrade2: {
hujiebin's avatar
hujiebin committed
104 105 106 107 108 109 110
		{groupPower_e.GroupPowerPrivilegeMemberNum, 800},
		{groupPower_e.GroupPowerPrivilegeMgrNum, 20},
		{groupPower_e.GroupPowerPrivilegeNameplate, 1},
		{groupPower_e.GroupPowerPrivilegeMedal, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateEdit, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateHeadwear, 1},
	},
hujiebin's avatar
hujiebin committed
111
	groupPower_e.GroupPowerGrade3: {
hujiebin's avatar
hujiebin committed
112 113 114 115 116 117 118 119
		{groupPower_e.GroupPowerPrivilegeMemberNum, 1200},
		{groupPower_e.GroupPowerPrivilegeMgrNum, 25},
		{groupPower_e.GroupPowerPrivilegeNameplate, 1},
		{groupPower_e.GroupPowerPrivilegeMedal, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateEdit, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateHeadwear, 1},
	},
}