35 lines
1018 B
Go
35 lines
1018 B
Go
package model
|
|
|
|
// UserCollect 用户收藏管理数据模型
|
|
type UserCollect struct {
|
|
Model
|
|
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
|
Kind UserCollectKind `gorm:"column:kind;type:smallint(6);default:0;comment:收藏数据类型" json:"kind"`
|
|
ObjectID uint64 `gorm:"column:object_id;type:int(11);default:0;comment:收藏对象ID" json:"-"`
|
|
ModelDeleted
|
|
ModelAt
|
|
}
|
|
|
|
type UserCollectKind int
|
|
|
|
const (
|
|
// UserCollectKindForLaboratory 实验室
|
|
UserCollectKindForLaboratory UserCollectKind = iota + 1001
|
|
// UserCollectKindForExpert 专家
|
|
UserCollectKindForExpert
|
|
// UserCollectKindForCompany 公司
|
|
UserCollectKindForCompany
|
|
// UserCollectKindForTechnologyAchievement 技术成果
|
|
UserCollectKindForTechnologyAchievement
|
|
// UserCollectKindForTechnologyProduct 技术产品
|
|
UserCollectKindForTechnologyProduct
|
|
)
|
|
|
|
func (m *UserCollect) TableName() string {
|
|
return "user_collect"
|
|
}
|
|
|
|
func NewUserCollect() *UserCollect {
|
|
return &UserCollect{}
|
|
}
|