互动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
2.0 KiB

package models
import (
"github.com/ouxuanserver/osmanthuswine/src/core"
"time"
)
const DanMuServerTableName = TableNamePrefix + "dan_mu_server"
type DanMuServer struct {
Id int64 `json:"id" xorm:"not null pk autoincr"`
ActivityId int64 `json:"activity_id" xorm:"not null comment('互动id') INT(11)" description:"主活动id"`
DanmuSwitch string `json:"danmu_switch" xorm:"not null default('关闭') comment('弹幕服务开启、关闭') VARCHAR(255)"`
DanmuOpacity int `json:"danmu_opacity" xorm:"not null default(100) comment('弹幕透明度') INT(11)"`
DanmuSpeed int `json:"danmu_speed" xorm:"not null default(50) comment('弹幕速度') INT(11)"`
DanmuPosition string `json:"danmu_position" xorm:"not null default('顶部') comment('弹幕位置[顶部 底部 满屏]')"`
DanmuFontSize string `json:"danmu_font_size" xorm:"not null default('中') comment('字号大小[大 中 小]')"`
ServerDisplay string `json:"server_display" xorm:"not null default('消息界面') comment('霸屏展示方式 [消息界面|互动界面]') VARCHAR(255)"`
ServerStartTime time.Time `json:"server_start_time" xorm:"not null default('1970-01-01 08:00:00') comment('开启时间') DATETIME"`
ServerEndTime time.Time `json:"server_end_time" xorm:"not null default('1970-01-01 08:00:00') comment('结束时间') DATETIME" description:"关闭时间"`
IsDelete bool `json:"is_delete" xorm:"not null default(0) comment('软删除') TINYINT(1)"`
CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME" description:"创建时间"`
UpdatedAt time.Time `json:"updated_at" xorm:"not null default(CURRENT_TIMESTAMP) updated comment('更新时间') TIMESTAMP" description:"更新时间"`
}
func (t *DanMuServer) TableName() string {
return DanMuServerTableName
}
func (t *DanMuServer) GetByActivityId(aid int64) (bool, error) {
return core.GetXormAuto().Where("is_delete=0 and activity_id=?", aid).Get(t)
}