feat:完善项目信息

This commit is contained in:
henry
2022-01-11 10:41:46 +08:00
parent 6712feec35
commit 7cab0fb354
24 changed files with 188 additions and 169 deletions

View File

@ -1,54 +0,0 @@
package service
import (
"SciencesServer/utils"
"encoding/json"
)
type Session struct {
Token string `json:"token"` // token
UID uint64 `json:"uid"` // 唯一标识ID
TenantID uint64 `json:"tenant_id"` // 租户ID
Name string `json:"name"` // 名称
Mobile string `json:"mobile"` // 手机号码
IsAdmin bool `json:"is_admin"` // 是否超管
}
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{}
}
// SessionEnterprise 企业用户
type SessionEnterprise 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"` // 手机号码
Identity int `json:"identity"` // 总身份信息
SelectIdentity int `json:"select_identity"` // 选中身份信息
}
func (this *SessionEnterprise) UIDToString() string {
return utils.UintToString(this.UID)
}
func (this *SessionEnterprise) MarshalBinary() ([]byte, error) {
return json.Marshal(this)
}
func (this *SessionEnterprise) UnmarshalBinary(data []byte) error {
return utils.FromJSONBytes(data, this)
}
func NewSessionEnterprise() *SessionEnterprise {
return &SessionEnterprise{}
}