37 lines
1.2 KiB
Go
37 lines
1.2 KiB
Go
package model
|
|
|
|
import "encoding/json"
|
|
|
|
// ServiceInnovate 创新服务数据模型
|
|
type ServiceInnovate struct {
|
|
Model
|
|
ModelTenant
|
|
KindID uint64 `gorm:"column:kind_id;type:int(11);default:0;comment:类型ID" json:"-"`
|
|
Title string `gorm:"column:title;type:varchar(50);default:'';comment:创新服务标题" json:"title"`
|
|
Description string `gorm:"column:description;type:varchar(255);default:'';comment:创新服务描述" json:"description"`
|
|
Content string `gorm:"column:content;type:text;comment:创新服务内容" json:"content"`
|
|
Tag string `gorm:"column:tag;type:varchar(255);default:'';comment:创新服务标签" json:"-"`
|
|
Sort int `gorm:"column:sort;type:tinyint(3);default:0;comment:排序,数值越小,优先排序" json:"sort"`
|
|
ModelDeleted
|
|
ModelAt
|
|
}
|
|
|
|
func (m *ServiceInnovate) TableName() string {
|
|
return "service_innovate"
|
|
}
|
|
|
|
func (m *ServiceInnovate) GetTagAttribute() []string {
|
|
out := make([]string, 0)
|
|
_ = json.Unmarshal([]byte(m.Tag), &out)
|
|
return out
|
|
}
|
|
|
|
func (m *ServiceInnovate) SetTagAttribute(value []string) {
|
|
_bytes, _ := json.Marshal(value)
|
|
m.Tag = string(_bytes)
|
|
}
|
|
|
|
func NewServiceInnovate() *ServiceInnovate {
|
|
return &ServiceInnovate{}
|
|
}
|