feat:完善项目信息
This commit is contained in:
@ -14,7 +14,7 @@ type TechnologyPaper struct {
|
||||
Ext string `gorm:"column:ext;type:varchar(30);default:'';comment:引用格式" json:"ext"`
|
||||
Author string `gorm:"column:author;type:varchar(100);default:'';comment:作者" json:"author"`
|
||||
PublishAt time.Time `gorm:"column:publish_at;type:datetime;not null;comment:出版日期" json:"publish_at"`
|
||||
Keyword string `gorm:"column:keyword;type:varchar(100);default:'';comment:关键词" json:"keyword"`
|
||||
Keyword string `gorm:"column:keyword;type:varchar(100);default:'';comment:关键词" json:"-"`
|
||||
Tag string `gorm:"column:tags;type:varchar(255);default:'';comment:标签" json:"-"`
|
||||
Remark string `gorm:"column:remark;type:varchar(255);default:'';comment:备注" json:"remark"`
|
||||
ModelDeleted
|
||||
@ -25,6 +25,16 @@ func (m *TechnologyPaper) TableName() string {
|
||||
return m.NewTableName("technology_paper")
|
||||
}
|
||||
|
||||
func (m *TechnologyPaper) GetKeywordAttribute() []string {
|
||||
out := make([]string, 0)
|
||||
_ = utils.FromJSON(m.Keyword, &out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *TechnologyPaper) SetKeywordAttribute(value []string) {
|
||||
m.Keyword = utils.AnyToJSON(value)
|
||||
}
|
||||
|
||||
func (m *TechnologyPaper) GetTagAttribute() []string {
|
||||
tags := make([]string, 0)
|
||||
_ = utils.FromJSON(m.Tag, &tags)
|
||||
|
Reference in New Issue
Block a user