mirror of
https://shylinux.com/x/enterprise
synced 2025-04-25 17:18:06 +08:00
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package model
|
|
|
|
import "shylinux.com/x/mysql-story/src/db"
|
|
|
|
const (
|
|
UID = "uid"
|
|
NAME = "name"
|
|
TYPE = "type"
|
|
ROLE = "role"
|
|
TITLE = "title"
|
|
CONTENT = "content"
|
|
USER_UID = "user_uid"
|
|
USER_CHANNEL_ROLE = "user_channel_role"
|
|
CHANNEL_UID = "channel_uid"
|
|
CHANNEL_NAME = "channel_name"
|
|
CHANNEL_TYPE = "channel_type"
|
|
PROMOTION_UID = "_uid"
|
|
COMPANY_UID = "company_uid"
|
|
CITY_UID = "city_uid"
|
|
)
|
|
|
|
type UserChannel struct {
|
|
db.ModelWithUID
|
|
UserUID string `gorm:"type:char(32);index"`
|
|
ChannelUID string `gorm:"type:char(32);index"`
|
|
Role uint8 `gorm:"default:0"`
|
|
}
|
|
type Channel struct {
|
|
db.ModelWithUID
|
|
CompanyUID string `gorm:"type:char(32);index"`
|
|
Name string `gorm:"type:varchar(64)"`
|
|
Type uint8 `gorm:"default:0"`
|
|
}
|
|
type Promotion struct {
|
|
db.ModelWithUID
|
|
ChannelUID string `gorm:"type:char(32);index"`
|
|
UserUID string `gorm:"type:char(32);index"`
|
|
Title string `gorm:"type:varchar(64)"`
|
|
Content string
|
|
}
|
|
|
|
|
|
func init() { db.CmdModels("", &UserChannel{}, &Channel{}, &Promotion{}) } |