struct.go 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. package main
  2. import "time"
  3. // 弹幕
  4. type LiveDM struct {
  5. Data LiveDmData `json:"data"`
  6. Cmd string `json:"cmd"`
  7. }
  8. type LiveDmData struct {
  9. Uid int64 `json:"uid"`
  10. Uname string `json:"uname"`
  11. Uface string `json:"uface"`
  12. RoomID int64 `json:"room_id"`
  13. FansMedalLevel int64 `json:"fans_medal_level"`
  14. FansMedalName string `json:"fans_medal_name"`
  15. FansMedalWearningStatus bool `json:"fans_medal_wearning_status"`
  16. GuardLevel int64 `json:"guard_level"`
  17. Msg string `json:"msg"`
  18. Timestamp int64 `json:"timestamp"`
  19. }
  20. type LiveGift struct {
  21. Data LiveGiftData `json:"data"`
  22. Cmd string `json:"cmd"`
  23. }
  24. type LiveGiftData struct {
  25. Uid int64 `json:"uid"`
  26. Uname string `json:"uname"`
  27. Uface string `json:"uface"`
  28. GiftID int64 `json:"gift_id"`
  29. GiftName string `json:"gift_name"`
  30. GiftNum int64 `json:"gift_num"`
  31. Price int64 `json:"price"`
  32. Paid bool `json:"paid"`
  33. FansMedalLevel int64 `json:"fans_medal_level"`
  34. FansMedalName string `json:"fans_medal_name"`
  35. FansMedalWearningStatus bool `json:"fans_medal_wearning_status"`
  36. GuardLevel int64 `json:"guard_level"`
  37. Timestamp int64 `json:"timestamp"`
  38. RoomID int64 `json:"room_id"`
  39. AnchorInfo AnchorInfo `json:"anchor_info"`
  40. }
  41. type AnchorInfo struct {
  42. Uid int64 `json:"uid"`
  43. Uname string `json:"uname"`
  44. Uface string `json:"uface"`
  45. }
  46. type CouponRecord struct {
  47. Id uint `gorm:"column:id"`
  48. AccountId string `gorm:"column:account_id"` //账户ID
  49. AddCnt int `gorm:"column:add_cnt"` //礼劵变动数
  50. Type int `gorm:"column:type"` //type:1 消耗 2:弹幕增加 3:打赏增加 4:贴纸兑换增加 5:礼包增加 6:新人礼包
  51. BoxRecordId int `gorm:"column:box_record_id"` //礼盒ID
  52. PackRecordId int `gorm:"column:pack_record_id"` //礼包ID
  53. Day string `gorm:"column:day"` //日期
  54. CreatedAt time.Time `gorm:"column:created_at"`
  55. UpdatedAt time.Time `gorm:"column:updated_at"`
  56. GiftRecordId uint `gorm:"column:gift_record_id"` //礼品ID
  57. }
  58. type Account struct {
  59. Id uint `gorm:"column:id"`
  60. Username string `gorm:"column:username"` //用户名
  61. Coupon int `gorm:"column:coupon"` //礼劵数
  62. Paster int `gorm:"column:paster"` //贴纸数
  63. CreatedAt time.Time `gorm:"column:created_at"`
  64. UpdatedAt time.Time `gorm:"column:updated_at"`
  65. Token string `gorm:"column:token"` //token json
  66. Avatar string `gorm:"column:avatar"` //头像
  67. Openid string `gorm:"column:openid"`
  68. Session string `gorm:"column:session"` //登录凭证
  69. SessionExpire int64 `gorm:"column:session_expire"` //过期时间
  70. LastHitCnt uint8 `gorm:"column:last_hit_cnt"` //最近未抽到SSR的次数
  71. Code string `gorm:"column:code"` //用来和uid验证的验证码
  72. Uid uint `gorm:"column:uid"` //直播间中粉丝的uid
  73. }
  74. type Config struct {
  75. Id int `gorm:"column:id"`
  76. Name string `gorm:"column:name"`
  77. Key string `gorm:"column:key"` //键名
  78. Type int8 `gorm:"column:type"`
  79. Val1 string `gorm:"column:val1"`
  80. Val string `gorm:"column:val"` //键值
  81. Beizhu string `gorm:"column:beizhu"`
  82. CreatedAt time.Time `gorm:"column:created_at"`
  83. UpdatedAt time.Time `gorm:"column:updated_at"`
  84. }
  85. type Liuyan struct {
  86. Cmd string `json:"cmd"`
  87. Data LiuyanData `json:"data"`
  88. }
  89. type LiuyanData struct {
  90. RoomID int `json:"room_id"`
  91. Uid int `json:"uid"`
  92. Uname string `json:"uname"`
  93. Uface string `json:"uface"`
  94. MessageID int `json:"message_id"`
  95. Message string `json:"message"`
  96. Rmb int64 `json:"rmb"`
  97. Timestamp int `json:"timestamp"`
  98. StartTime int `json:"start_time"`
  99. EndTime int `json:"end_time"`
  100. GuardLevel int `json:"guard_level"`
  101. FansMedalLevel int `json:"fans_medal_level"`
  102. FansMedalName string `json:"fans_medal_name"`
  103. FansMedalWearningStatus bool `json:"fans_medal_wearning_status"`
  104. }