Files

41 lines
1.3 KiB
Go
Raw Normal View History

2021-09-28 11:47:19 +08:00
package model
2021-12-01 11:31:55 +08:00
import "encoding/json"
2021-09-28 11:47:19 +08:00
type SysTenant struct {
Model
2021-12-03 14:18:06 +08:00
Key string `gorm:"column:key;type:varchar(30);default:'';comment:key" json:"key"`
2021-09-28 11:47:19 +08:00
ParentID uint64 `gorm:"column:parent_id;type:int;default:0;comment:父级ID" json:"-"`
Image
2021-12-03 14:18:06 +08:00
Name string `gorm:"column:name;type:varchar(30);default:'';comment:名称" json:"name"`
Code string `gorm:"column:code;type:varchar(30);default:'';comment:信用代码" json:"code"`
2021-10-08 17:33:19 +08:00
Images
Area
2021-12-03 14:18:06 +08:00
Position string `gorm:"column:position;type:varchar(255);default:'';comment:坐标" json:"-"`
Industry string `gorm:"column:industry;type:varchar(255);default:'';comment:所属领域;行业信息" json:"-"`
2021-10-08 17:33:19 +08:00
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
2021-12-03 14:18:06 +08:00
Config string `gorm:"column:config;type:varchar(255);default:'';comment:配置信息" json:"-"`
Remark string `gorm:"column:remark;type:varchar(255);default:'';comment:备注信息" json:"remark"`
2021-09-28 11:47:19 +08:00
ModelDeleted
ModelAt
}
func (m *SysTenant) TableName() string {
return "sys_tenant"
}
2021-12-01 11:31:55 +08:00
func (m *SysTenant) GetIndustryAttribute() []string {
out := make([]string, 0)
_ = json.Unmarshal([]byte(m.Industry), &out)
return out
}
func (m *SysTenant) SetIndustryAttribute(value []string) {
_bytes, _ := json.Marshal(value)
m.Industry = string(_bytes)
}
2021-09-28 11:47:19 +08:00
func NewSysTenant() *SysTenant {
return &SysTenant{}
}