welfare.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. package model
  2. import (
  3. "go-common/library/time"
  4. )
  5. // Welfare vip_welfare table
  6. type Welfare struct {
  7. ID int `json:"id"`
  8. WelfareName string `json:"welfare_name" form:"welfare_name"`
  9. WelfareDesc string `json:"welfare_desc" form:"welfare_desc"`
  10. HomepageUri string `json:"homepage_uri" form:"homepage_uri"`
  11. BackdropUri string `json:"backdrop_uri" form:"backdrop_uri"`
  12. Recommend int `json:"recommend"`
  13. Rank int `json:"rank"`
  14. Tid int `json:"tid"`
  15. UsageForm int `json:"usage_form" form:"usage_form"`
  16. ReceiveRate int `json:"receive_rate" form:"receive_rate"`
  17. ReceiveUri string `json:"receive_uri" form:"receive_uri"`
  18. VipType int `json:"vip_type" form:"vip_type"`
  19. State int `json:"state"`
  20. OperID int `json:"oper_id"`
  21. OperName string `json:"oper_name"`
  22. Stime time.Time `json:"stime"`
  23. Etime time.Time `json:"etime"`
  24. Ctime time.Time `json:"ctime"`
  25. Mtime time.Time `json:"mtime"`
  26. }
  27. // WelfareType vip_welfare_type table
  28. type WelfareType struct {
  29. ID int `json:"id"`
  30. Name string `json:"name"`
  31. State int `json:"state"`
  32. OperID int `json:"oper_id"`
  33. OperName string `json:"oper_name"`
  34. }
  35. // WelfareCodeBatch vip_welfare_code_batch table
  36. type WelfareCodeBatch struct {
  37. ID int `json:"id" gorm:"-;primary_key;AUTO_INCREMENT" form:"id"`
  38. BatchName string `json:"batch_name"`
  39. Wid int `json:"wid"`
  40. Count int `json:"count"`
  41. ReceivedCount int `json:"received_count"`
  42. Ver int `json:"ver"`
  43. State int `json:"state"`
  44. OperID int `json:"oper_id"`
  45. OperName string `json:"oper_name"`
  46. Vtime time.Time `json:"vtime"`
  47. Ctime time.Time `json:"ctime"`
  48. Mtime time.Time `json:"mtime"`
  49. }
  50. // WelfareCode vip_welfare_code table
  51. type WelfareCode struct {
  52. ID int `json:"id"`
  53. Bid int `json:"bid"`
  54. Wid int `json:"wid"`
  55. Code string `json:"code"`
  56. Mid int `json:"mid"`
  57. State int `json:"state"`
  58. Ctime time.Time `json:"ctime"`
  59. Mtime time.Time `json:"mtime"`
  60. }
  61. //WelfareTypeRes welfare type response
  62. type WelfareTypeRes struct {
  63. ID int `json:"id"`
  64. Name string `json:"name"`
  65. }
  66. // WelfareReq save or update welfare params
  67. type WelfareReq struct {
  68. ID int `form:"id"`
  69. WelfareName string `form:"name" validate:"required"`
  70. WelfareDesc string `form:"desc" validate:"required"`
  71. HomepageUri string `form:"homepage_uri"`
  72. BackdropUri string `form:"backdrop_uri"`
  73. Recommend int `form:"recommend"`
  74. Rank int `form:"rank" validate:"required"`
  75. Tid int `form:"tid"`
  76. UsageForm int `form:"usage_form" validate:"required"`
  77. ReceiveRate int `form:"receive_rate"`
  78. ReceiveUri string `form:"receive_uri"`
  79. VipType int `form:"vip_type" validate:"required"`
  80. Stime time.Time `form:"stime" validate:"required"`
  81. Etime time.Time `form:"etime" validate:"required"`
  82. OperID int `json:"-"`
  83. OperName string `json:"-"`
  84. }
  85. //WelfareRes welfare type response
  86. type WelfareRes struct {
  87. ID int `json:"id" gorm:"column:id"`
  88. Name string `json:"name" gorm:"column:welfare_name"`
  89. Desc string `json:"desc" gorm:"column:welfare_desc"`
  90. TID int `json:"tid" gorm:"column:tid"`
  91. HomepageUri string `json:"homepage_uri"`
  92. BackdropUri string `json:"backdrop_uri"`
  93. Recommend int `json:"recommend"`
  94. Rank int `json:"rank"`
  95. UsageForm int `json:"usage_form"`
  96. Stime time.Time `json:"stime"`
  97. Etime time.Time `json:"etime"`
  98. ReceiveRate int `json:"receive_rate"`
  99. ReceiveUri string `json:"receive_uri"`
  100. VipType int `json:"vip_type"`
  101. ReceivedCount int `json:"received_count"`
  102. Count int `json:"count"`
  103. }
  104. //WelfareBatchRes welfare batch response
  105. type WelfareBatchRes struct {
  106. ID int `json:"id"`
  107. Name string `json:"batch_name" gorm:"column:batch_name"`
  108. WID int `json:"wid" gorm:"column:wid"`
  109. Ver int `json:"ver"`
  110. OperId int `json:"oper_id"`
  111. OperName string `json:"oper_name"`
  112. Vtime time.Time `json:"vtime"`
  113. Ctime time.Time `json:"ctime"`
  114. ReceivedCount int `json:"received_count"`
  115. Count int `json:"count"`
  116. }
  117. // TableName vip_welfare_type
  118. func (*WelfareType) TableName() string {
  119. return "vip_welfare_type"
  120. }
  121. // TableName vip_welfare
  122. func (*Welfare) TableName() string {
  123. return "vip_welfare"
  124. }
  125. // TableName vip_welfare_code_batch
  126. func (*WelfareCodeBatch) TableName() string {
  127. return "vip_welfare_code_batch"
  128. }
  129. // TableName vip_welfare_code
  130. func (*WelfareCode) TableName() string {
  131. return "vip_welfare_code"
  132. }