- 修改了 Login 方法的返回类型,使用新的 PlayerLoginInfo 结构体 - 新增 NewPlayerLoginInfo 函数用于创建并初始化 PlayerLoginInfo 对象 - 重构了 LoginSidInfo 和 LoginUserInfo 文件中的结构体 - 优化了数据初始化和默认值设置的方式
23 lines
743 B
Go
23 lines
743 B
Go
package model
|
|
|
|
// TeamInfo 战队信息结构
|
|
type TeamInfo struct {
|
|
//Head handler.TomeeHeader `cmd:"1001" struc:"[0]pad"` // 命令头
|
|
ID uint32 `struc:"uint32" default:"0"` // 默认值0
|
|
Priv uint32 `struc:"uint32" default:"1"` // 默认值1
|
|
SuperCore uint32 `struc:"uint32" default:"1"` // 默认值1
|
|
IsShow uint32 `struc:"uint32" default:"1"` // 默认值1
|
|
AllContribution uint32 `struc:"uint32" default:"1"` // 默认值1
|
|
CanExContribution uint32 `struc:"uint32" default:"1"` // 默认值1
|
|
}
|
|
|
|
// InitDefaults 初始化默认值
|
|
func (t *TeamInfo) InitDefaults() {
|
|
t.ID = 0
|
|
t.Priv = 1
|
|
t.SuperCore = 1
|
|
t.IsShow = 1
|
|
t.AllContribution = 1
|
|
t.CanExContribution = 1
|
|
}
|