20 lines
1.0 KiB
Go
20 lines
1.0 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// AuthorConfig 作者详情配置,小程序「关于作者」页展示,单行记录
|
|
type AuthorConfig struct {
|
|
ID int `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
|
Name string `gorm:"column:name;size:80;not null" json:"name"`
|
|
Avatar string `gorm:"column:avatar;size:4" json:"avatar"` // 首字母占位,无头像时显示
|
|
AvatarImg string `gorm:"column:avatar_img;size:500" json:"avatarImg"` // 头像图片 URL
|
|
Title string `gorm:"column:title;size:200" json:"title"`
|
|
Bio string `gorm:"column:bio;type:text" json:"bio"`
|
|
Stats string `gorm:"column:stats;type:text" json:"-"` // JSON: [{"label":"","value":""}]
|
|
Highlights string `gorm:"column:highlights;type:text" json:"-"` // JSON: ["a","b"]
|
|
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
|
|
}
|
|
|
|
func (AuthorConfig) TableName() string { return "author_config" }
|