feat:优化项目信息
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package model
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type SysTenant struct {
|
||||
Model
|
||||
Key string `gorm:"column:key;type:varchar(30);default:null;comment:key" json:"key"`
|
||||
@ -10,7 +12,7 @@ type SysTenant struct {
|
||||
Images
|
||||
Area
|
||||
Position string `gorm:"column:position;type:varchar(255);default:null;comment:坐标" json:"-"`
|
||||
Industry uint64 `gorm:"column:industry;type:int(11);default:0;comment:所属领域" json:"industry"`
|
||||
Industry string `gorm:"column:industry;type:varchar(255);default:null;comment:所属领域;行业信息" json:"-"`
|
||||
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
|
||||
Config string `gorm:"column:config;type:varchar(255);default:null;comment:配置信息" json:"-"`
|
||||
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注信息" json:"remark"`
|
||||
@ -22,6 +24,17 @@ func (m *SysTenant) TableName() string {
|
||||
return "sys_tenant"
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
func NewSysTenant() *SysTenant {
|
||||
return &SysTenant{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user