package session import ( "SciencesServer/utils" "encoding/json" ) // Enterprise 企业用户 type Enterprise struct { Token string `json:"token"` // token UID uint64 `json:"uid"` // 唯一标识ID ManageUID uint64 `json:"manage_uid"` // 管理平台用户唯一ID Name string `json:"name"` // 名称 Mobile string `json:"mobile"` // 手机号码 Identity int `json:"identity"` // 总身份信息 SelectIdentity int `json:"select_identity"` // 选中身份信息 } func (this *Enterprise) SetToken(token string) { this.Token = token } func (this *Enterprise) GetToken() string { return this.Token } func (this *Enterprise) UIDToString() string { return utils.UintToString(this.UID) } func (this *Enterprise) MarshalBinary() ([]byte, error) { return json.Marshal(this) } func (this *Enterprise) UnmarshalBinary(data []byte) error { return utils.FromJSONBytes(data, this) } func NewEnterprise() *Enterprise { return &Enterprise{} }