互动
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.

34 lines
1.3 KiB

5 years ago
  1. package models
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "time"
  5. )
  6. const BullyScreenServerTableName = TableNamePrefix + "bully_screen_server"
  7. //霸屏服务
  8. type BullyScreenServer struct {
  9. Id int64 `json:"id"`
  10. ActivityId int64 `json:"activity_id" description:"主活动的id"`
  11. ServerStartTime time.Time `json:"server_start_time" description:"服务开始时间"`
  12. ServerEndTime time.Time `json:"server_end_time" description:"服务结束时间"`
  13. Start string `json:"start" description:"霸屏是否开启 [开启|关闭]"`
  14. ServerDisplay string `json:"server_display" description:"霸屏展示的方式 [消息界面|互动界面]"`
  15. Price float64 `json:"price" description:"每秒的价格 霸屏"`
  16. IsDelete bool `json:"is_delete" xorm:"is_delete"`
  17. CreatedAt time.Time `json:"created_at" xorm:"created"`
  18. UpdatedAt time.Time `json:"updated_at" xorm:"updated"`
  19. }
  20. func (t *BullyScreenServer) TableName() string {
  21. return BullyScreenServerTableName
  22. }
  23. func (t *BullyScreenServer) Alias(name string) string {
  24. return AliasTableName(t, name)
  25. }
  26. func (t *BullyScreenServer) GetByActivityId(aid int64) (bool, error) {
  27. return core.GetXormAuto().Where("is_delete=0 and activity_id=?", aid).Get(t)
  28. }