Files

35 lines
699 B
Go
Raw Normal View History

2021-11-24 10:50:09 +08:00
package session
import (
"SciencesServer/utils"
"encoding/json"
)
type Manage struct {
UID uint64 `json:"uid"` // 唯一标识ID
Token string `json:"token"` // token
Name string `json:"name"` // 名称
Mobile string `json:"mobile"` // 手机号码
IsAdmin bool `json:"is_admin"` // 是否超管
2021-11-24 10:50:09 +08:00
}
func (this *Manage) SetToken(token string) {
this.Token = token
}
func (this *Manage) GetToken() string {
return this.GetToken()
}
func (this *Manage) MarshalBinary() ([]byte, error) {
return json.Marshal(this)
}
func (this *Manage) UnmarshalBinary(data []byte) error {
return utils.FromJSONBytes(data, this)
}
func NewManage() *Manage {
return &Manage{}
}