Files

38 lines
1.1 KiB
Go

package models
import (
"time"
"work_cation/pkg/gormx"
"work_cation/pkg/utils"
)
type BaseCard struct {
UUID string `json:"uuid"` // id ip加时间戳生成
UserID string `json:"user_id"` // 用户id 标识
Title string `json:"title"` // 标题
Text string `json:"text"` // 内容
Covers gormx.ListString `json:"covers"` // 封面
ToolType string `json:"tool_type"` // 工具类型
UpdateTx time.Time `json:"update_tx"` // 更新时间
Number int `json:"number"` // 数量
Goods int `json:"goods"` // 点赞数
Collection int `json:"collection"` // 收藏数
}
const (
ToolTypeErlang = "erlangCard" // 卡片
ToolTypeNoVarErlang = "erlangNoVarCard"
ToolTypeExecFiles = "execFiles" // 可执行文件
)
func NewBaseCard(t, userId string) BaseCard {
return BaseCard{
UUID: utils.Uuid.CreateUUID(),
UserID: userId,
Title: "未命名",
Text: "未命名",
ToolType: t,
UpdateTx: time.Now(),
}
}