feat:完善项目

This commit is contained in:
henry
2021-09-28 11:47:19 +08:00
commit da7b3130fe
167 changed files with 456676 additions and 0 deletions

28
app/service/session.go Normal file
View File

@ -0,0 +1,28 @@
package service
import (
"SciencesServer/utils"
"encoding/json"
)
type Session struct {
UID uint64 `json:"uid"` // 唯一标识ID
Token string `json:"token"` // token
Name string `json:"name"` // 名称
Mobile string `json:"mobile"` // 手机号码
IsAdmin bool `json:"is_admin"` // 是否超管
TenantID uint64 `json:"tenant_id"` // 租户ID
TenantKey string `json:"tenant_key"` // 租户标识,用来区别分库管理
}
func (this *Session) MarshalBinary() ([]byte, error) {
return json.Marshal(this)
}
func (this *Session) UnmarshalBinary(data []byte) error {
return utils.FromJSONBytes(data, this)
}
func NewSession() *Session {
return &Session{}
}