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

import (
	"git.hilo.cn/hilo-common/resource/mysql"
	"hilo-group/_const/enum/groupPower_e"
hujiebin's avatar
hujiebin committed
6
	"hilo-group/cv/user_cv"
hujiebin's avatar
hujiebin committed
7 8
)

hujiebin's avatar
hujiebin committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
// 家族基本信息
type CvGroupPowerInfo struct {
	GroupPowerId mysql.ID `json:"groupPowerId"` // 家族id
	Icon         string   `json:"icon"`         // 家族图片
	Name         string   `json:"name"`         // 家族名
	Nameplate    string   `json:"nameplate"`    // 铭牌
}

// 家族等级
type CvGroupPowerGrade struct {
	Grade    groupPower_e.GroupPowerGrade `json:"grade"`              // 等级 0:无 1:青铜 2:白银 3:黄金 4:黑金
	Exp      mysql.Num                    `json:"exp"`                // 经验值
	NextExp  mysql.Num                    `json:"nextExp,omitempty"`  // 升级所需经验值
	ExpireAt string                       `json:"expireAt,omitempty"` // 有效期
	ShowExp  bool                         `json:"showExp"`            // 是否展示经验值
}

hujiebin's avatar
hujiebin committed
26 27
// 家族榜单
type CvGroupPowerRank struct {
hujiebin's avatar
hujiebin committed
28 29
	MyGroupPower CvGroupPowerRankData   `json:"myGroupPower"` // 我的家族排名
	Items        []CvGroupPowerRankData `json:"items"`        // 列表
hujiebin's avatar
hujiebin committed
30 31
}

hujiebin's avatar
hujiebin committed
32
type CvGroupPowerRankData struct {
hujiebin's avatar
hujiebin committed
33 34 35
	CvGroupPowerInfo  `json:",inline"`
	CvGroupPowerGrade `json:",inline"`
	Rank              int `json:"rank"` // 排名
hujiebin's avatar
hujiebin committed
36 37
}

hujiebin's avatar
hujiebin committed
38 39
// 家族之星
type CvGroupPowerStarData struct {
hujiebin's avatar
hujiebin committed
40
	user_cv.CvUserTiny `json:",inline"`
hujiebin's avatar
hujiebin committed
41
	Score              mysql.Num `json:"score"` // 对应分值
hujiebin's avatar
hujiebin committed
42
}
hujiebin's avatar
hujiebin committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103

// 资源等级
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 {
	GroupPowerInfo  CvGroupPowerInfo  `json:"groupPowerInfo"`  // 家族基本信息
	GroupPowerGrade CvGroupPowerGrade `json:"groupPowerGrade"` // 家族等级信息
	ResGradeList    []CvResGrade      `json:"resGradeList"`    // 资源等级列表,青铜、白银、黄金、黑金
	PrivilegeList   []CvPrivilege     `json:"privilegeList"`   // 等级特权
}

var CvResGradeList = []CvResGrade{
	{groupPower_e.GroupPowerGrade1, "青铜icon", "青铜bigIcon"}, // todo
	{groupPower_e.GroupPowerGrade2, "白银icon", "白银bigIcon"}, // todo
	{groupPower_e.GroupPowerGrade3, "黄金icon", "黄金bigIcon"}, // todo
	{groupPower_e.GroupPowerGrade4, "黑金icon", "黑金bigIcon"}, // todo
}

var GroupPowerGradePrivilegeNum = map[groupPower_e.GroupPowerGrade][]CvPrivilege{
	groupPower_e.GroupPowerGrade0: {},
	groupPower_e.GroupPowerGrade1: {
		{groupPower_e.GroupPowerPrivilegeMemberNum, 300},
		{groupPower_e.GroupPowerPrivilegeMgrNum, 10},
		{groupPower_e.GroupPowerPrivilegeNameplate, 1},
		{groupPower_e.GroupPowerPrivilegeMedal, 1},
	},
	groupPower_e.GroupPowerGrade2: {
		{groupPower_e.GroupPowerPrivilegeMemberNum, 500},
		{groupPower_e.GroupPowerPrivilegeMgrNum, 15},
		{groupPower_e.GroupPowerPrivilegeNameplate, 1},
		{groupPower_e.GroupPowerPrivilegeMedal, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateEdit, 1},
	},
	groupPower_e.GroupPowerGrade3: {
		{groupPower_e.GroupPowerPrivilegeMemberNum, 800},
		{groupPower_e.GroupPowerPrivilegeMgrNum, 20},
		{groupPower_e.GroupPowerPrivilegeNameplate, 1},
		{groupPower_e.GroupPowerPrivilegeMedal, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateEdit, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateHeadwear, 1},
	},
	groupPower_e.GroupPowerGrade4: {
		{groupPower_e.GroupPowerPrivilegeMemberNum, 1200},
		{groupPower_e.GroupPowerPrivilegeMgrNum, 25},
		{groupPower_e.GroupPowerPrivilegeNameplate, 1},
		{groupPower_e.GroupPowerPrivilegeMedal, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateEdit, 1},
		{groupPower_e.GroupPowerPrivilegeNameplateHeadwear, 1},
	},
}