feat: user & article: dev complete
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// BackArticle article struct
|
||||
type BackArticle struct {
|
||||
ID int `gorm:"primaryKey;column:id" json:"id"` // 文章id
|
||||
ID int `gorm:"primaryKey;column:id" json:"-"` // 文章id
|
||||
CreateTime time.Time `gorm:"column:create_time" json:"createTime"` // 文章新建时间
|
||||
CreateUser string `gorm:"column:create_user" json:"createUser"` // 文章创建者id
|
||||
ModifyTime time.Time `gorm:"column:modify_time" json:"modifyTime"` // 文章最后更新时间
|
||||
@@ -13,4 +16,20 @@ type BackArticle struct {
|
||||
Resume string `gorm:"column:resume" json:"resume"` // 文章简述
|
||||
Cover string `gorm:"column:cover" json:"cover"` // 文章封面
|
||||
Content string `gorm:"column:content" json:"content"` // 文章内容(如有需要可迁移至对象存储)
|
||||
IsPublish int8 `gorm:"column:is_publish" json:"isPublish"` // 发布状态(0:未发布, 1: 发布)
|
||||
IsDelete int8 `gorm:"column:is_delete" json:"isDelete"` // 删除标志
|
||||
}
|
||||
|
||||
func init() {
|
||||
initJcMap[BackArticle]()
|
||||
}
|
||||
|
||||
//func ArticleMapJ2c(jsonMap map[string]interface{}, ignoreNil bool) map[string]interface{} {
|
||||
// colMap := make(map[string]interface{})
|
||||
// for k, v := range jsonMap {
|
||||
// if colKey := colKey != "" && (!ignoreNil && v == nil) {
|
||||
// colMap[colKey] = v
|
||||
// }
|
||||
// }
|
||||
// return colMap
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user