model.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package broadcast
  2. import (
  3. "gorm.io/gorm"
  4. )
  5. var (
  6. BroadcastGorm *gorm.DB
  7. AnchorGorm *gorm.DB
  8. )
  9. type BroadcastFollow struct {
  10. Id int64 `json:"id" gorm:"id" yaml:"id"`
  11. UserId int64 `json:"user_id" gorm:"user_id" yaml:"user_id"`
  12. FollowList string `json:"-" gorm:"follow_list"`
  13. Follow []int64 `json:"follow" gorm:"-" yaml:"follow"`
  14. }
  15. func (this *BroadcastFollow) TableName() string {
  16. return "broadcast_follow"
  17. }
  18. type BroadcastHistory struct {
  19. Id int64 `json:"id" gorm:"id"`
  20. Date int64 `json:"date" gorm:"date"`
  21. ViewShow string `json:"view_show" gorm:"view_show"`
  22. ProblemTitle string `json:"problem_title" gorm:"problem_title"`
  23. Result string `json:"result" gorm:"result"`
  24. Status bool `json:"status" gorm:"json"`
  25. }
  26. func (this *BroadcastHistory) TableName() string {
  27. return "broadcast_history"
  28. }
  29. type BroadcastQuestion struct {
  30. Id int64 `json:"id" gorm:"id"`
  31. GameShortName string `json:"game_short_name" gorm:"game_short_name" yaml:"game_short_name"`
  32. Problem string `json:"problem" gorm:"problem" yaml:"problem"`
  33. AnswerList string `json:"-" gorm:"answer_list" yaml:"answer_list"`
  34. Answer []string `json:"answer" gorm:"-" yaml:"answer"`
  35. }
  36. func (this *BroadcastQuestion) TableName() string {
  37. return "broadcast_question"
  38. }
  39. type BroadcastShower struct {
  40. Id int64 `json:"id" gorm:"id"`
  41. GameShortName string `json:"game_short_name" gorm:"game_short_name" yaml:"game_short_name"`
  42. BroadcastId int64 `json:"broadcast_id" gorm:"broadcast_id" yaml:"broadcast_id"`
  43. Remark string `json:"remark" gorm:"remark" yaml:"remark"`
  44. Introduction string `json:"introduction" gorm:"introduction" yaml:"introduction"`
  45. BroadcastPlaform string `json:"broadcast_plaform" gorm:"broadcast_plaform" yaml:"broadcast_plaform"`
  46. PlaformId string `json:"plaform_id" gorm:"plaform_id" yaml:"plaform_id"`
  47. BroadcastCode string `json:"broadcast_code" gorm:"broadcast_code" yaml:"broadcast_code"`
  48. Bean int64 `json:"bean" gorm:"bean" yaml:"bean"`
  49. AttendLimit int64 `json:"attend_limit" gorm:"attend_limit" yaml:"attend_limit"`
  50. QuestionLimit int64 `json:"question_limit" gorm:"question_limit" yaml:"question_limit"`
  51. }
  52. func (this *BroadcastShower) TableName() string {
  53. return "broadcast_shower"
  54. }
  55. type BroadCastFollowHistory struct {
  56. Id int64 `json:"id" gorm:"id"`
  57. UserId int64 `json:"user_id" gorm:"user_id"`
  58. BroadcastId int64 `json:"broadcast_id" gorm:"broadcast_id"`
  59. }
  60. type Broad struct {
  61. BroadcastShower
  62. IsReceive bool `json:"is_receive"`
  63. }