resource.go 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. package model
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // resource const
  6. const (
  7. IconTypeFix = 1
  8. IconTypeRandom = 2
  9. IconTypeBangumi = 3
  10. NoCategory = 0
  11. IsCategory = 1
  12. AsgTypePic = int8(0)
  13. AsgTypeVideo = int8(1)
  14. // pgc mobile
  15. AsgTypeURL = int8(2)
  16. AsgTypeBangumi = int8(3)
  17. AsgTypeLive = int8(4)
  18. AsgTypeGame = int8(5)
  19. AsgTypeAv = int8(6)
  20. )
  21. // IconTypes icon_type
  22. var IconTypes = map[int]string{
  23. IconTypeFix: "fix",
  24. IconTypeRandom: "random",
  25. IconTypeBangumi: "bangumi",
  26. }
  27. // Rule resource_assignmen rule
  28. type Rule struct {
  29. Cover int32 `json:"is_cover"`
  30. Style int32 `json:"style"`
  31. Label string `json:"label"`
  32. Intro string `json:"intro"`
  33. }
  34. // Resource struct
  35. type Resource struct {
  36. ID int `json:"id"`
  37. Platform int `json:"platform"`
  38. Name string `json:"name"`
  39. Parent int `json:"parent"`
  40. State int `json:"-"`
  41. Counter int `json:"counter"`
  42. Position int `json:"position"`
  43. Rule string `json:"rule"`
  44. Size string `json:"size"`
  45. Previce string `json:"preview"`
  46. Desc string `json:"description"`
  47. Mark string `json:"mark"`
  48. Assignments []*Assignment `json:"assignments"`
  49. CTime xtime.Time `json:"ctime"`
  50. MTime xtime.Time `json:"mtime"`
  51. Level int64 `json:"level"`
  52. Type int `json:"type"`
  53. IsAd int `json:"is_ad"`
  54. }
  55. // Assignment struct
  56. type Assignment struct {
  57. ID int `json:"id"`
  58. AsgID int `json:"-"`
  59. Name string `json:"name"`
  60. ContractID string `json:"contract_id"`
  61. ResID int `json:"resource_id"`
  62. Pic string `json:"pic"`
  63. LitPic string `json:"litpic"`
  64. URL string `json:"url"`
  65. Rule string `json:"rule"`
  66. Weight int `json:"weight"`
  67. Agency string `json:"agency"`
  68. Price float32 `json:"price"`
  69. State int `json:"state"`
  70. Atype int8 `json:"atype"`
  71. Username string `json:"username"`
  72. PlayerCategory int8 `json:"player_category"`
  73. ApplyGroupID int `json:"-"`
  74. STime xtime.Time `json:"stime"`
  75. ETime xtime.Time `json:"etime"`
  76. CTime xtime.Time `json:"ctime"`
  77. MTime xtime.Time `json:"mtime"`
  78. }
  79. // IndexIcon struct
  80. type IndexIcon struct {
  81. ID int64 `json:"id"`
  82. Type int `json:"type"`
  83. Title string `json:"title"`
  84. State int `json:"state"`
  85. Links []string `json:"links"`
  86. Icon string `json:"icon"`
  87. Weight int `json:"weight"`
  88. UserName string `json:"-"`
  89. StTime xtime.Time `json:"sttime"`
  90. EndTime xtime.Time `json:"endtime"`
  91. DelTime xtime.Time `json:"deltime"`
  92. CTime xtime.Time `json:"ctime"`
  93. MTime xtime.Time `json:"mtime"`
  94. }
  95. // PlayerIcon struct
  96. type PlayerIcon struct {
  97. URL1 string `json:"url1"`
  98. Hash1 string `json:"hash1"`
  99. URL2 string `json:"url2"`
  100. Hash2 string `json:"hash2"`
  101. CTime xtime.Time `json:"ctime"`
  102. }
  103. // ResWarnInfo for email
  104. type ResWarnInfo struct {
  105. AID int64
  106. URL string
  107. AssignmentID int
  108. AssignmentName string
  109. ResourceName string
  110. ResourceID int
  111. MaterialID int
  112. UserName string
  113. STime xtime.Time `json:"stime"`
  114. ETime xtime.Time `json:"etime"`
  115. ApplyGroupID int
  116. }
  117. // Cmtbox live danmaku box
  118. type Cmtbox struct {
  119. ID int64 `json:"id"`
  120. LoadCID int64 `json:"load_cid"`
  121. Server string `json:"server"`
  122. Port string `json:"port"`
  123. SizeFactor string `json:"size_factor"`
  124. SpeedFactor string `json:"speed_factor"`
  125. MaxOnscreen string `json:"max_onscreen"`
  126. Style string `json:"style"`
  127. StyleParam string `json:"style_param"`
  128. TopMargin string `json:"top_margin"`
  129. State string `json:"state"`
  130. CTime xtime.Time `json:"ctime"`
  131. MTime xtime.Time `json:"mtime"`
  132. }