first commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package mysqlmodel
|
||||
|
||||
type ClosetShare struct {
|
||||
Model
|
||||
ShareUUID string `gorm:"column:share_uuid"` // 分享UUID
|
||||
UserID int64 `gorm:"column:user_id"` // 所属用户ID
|
||||
ShareType int8 `gorm:"column:share_type"` // 分享类型 1=部分衣物分享 2=全量快照分享
|
||||
ExpireTime int64 `gorm:"column:expire_time"` // 过期时间
|
||||
Status int8 `gorm:"column:status"` // 分享状态 1=正常 2=用户取消 3=已过期 4=管理员封禁
|
||||
}
|
||||
|
||||
func (ClosetShare) TableName() string {
|
||||
return "closet_shares"
|
||||
}
|
||||
|
||||
type ClosetShareItem struct {
|
||||
Model
|
||||
ShareUUID string `gorm:"column:share_uuid"` // 分享UUID
|
||||
ClothesID int64 `gorm:"column:clothes_id"` // 衣物ID
|
||||
}
|
||||
|
||||
func (ClosetShareItem) TableName() string {
|
||||
return "closet_share_items"
|
||||
}
|
||||
|
||||
// ClosetShareReceiver 衣柜分享接收人关联。
|
||||
type ClosetShareReceiver struct {
|
||||
Model
|
||||
ShareUUID string `gorm:"column:share_uuid;uniqueIndex:uk_closet_share_receiver,priority:1"` // 分享UUID
|
||||
ReceiverUserID int64 `gorm:"column:receiver_user_id;uniqueIndex:uk_closet_share_receiver,priority:2"` // 接收人用户ID
|
||||
}
|
||||
|
||||
func (ClosetShareReceiver) TableName() string {
|
||||
return "closet_share_receivers"
|
||||
}
|
||||
Reference in New Issue
Block a user