26 lines
441 B
Go
26 lines
441 B
Go
![]() |
package session
|
||
|
|
||
|
import (
|
||
|
"SciencesServer/utils"
|
||
|
"encoding/json"
|
||
|
)
|
||
|
|
||
|
// Tenant 租户数据信息
|
||
|
type Tenant struct {
|
||
|
ID uint64 `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Domain string `json:"domain"`
|
||
|
}
|
||
|
|
||
|
func (this *Tenant) MarshalBinary() ([]byte, error) {
|
||
|
return json.Marshal(this)
|
||
|
}
|
||
|
|
||
|
func (this *Tenant) UnmarshalBinary(data []byte) error {
|
||
|
return utils.FromJSONBytes(data, this)
|
||
|
}
|
||
|
|
||
|
func NewTenant() *Tenant {
|
||
|
return &Tenant{}
|
||
|
}
|