feat:完善项目信息
This commit is contained in:
35
app/session/admin.go
Normal file
35
app/session/admin.go
Normal file
@ -0,0 +1,35 @@
|
||||
package session
|
||||
|
||||
import (
|
||||
"SciencesServer/utils"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
type Admin struct {
|
||||
UID uint64 `json:"uid"` // 唯一标识ID
|
||||
TenantID uint64 `json:"tenant_id"` // 租户ID
|
||||
Token string `json:"token"` // token
|
||||
Name string `json:"name"` // 名称
|
||||
Mobile string `json:"mobile"` // 手机号码
|
||||
IsAdmin bool `json:"is_admin"` // 是否超管
|
||||
}
|
||||
|
||||
func (this *Admin) SetToken(token string) {
|
||||
this.Token = token
|
||||
}
|
||||
|
||||
func (this *Admin) GetToken() string {
|
||||
return this.GetToken()
|
||||
}
|
||||
|
||||
func (this *Admin) MarshalBinary() ([]byte, error) {
|
||||
return json.Marshal(this)
|
||||
}
|
||||
|
||||
func (this *Admin) UnmarshalBinary(data []byte) error {
|
||||
return utils.FromJSONBytes(data, this)
|
||||
}
|
||||
|
||||
func NewAdmin() *Admin {
|
||||
return &Admin{}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
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"` // 是否超管
|
||||
}
|
||||
|
||||
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{}
|
||||
}
|
Reference in New Issue
Block a user