params.go 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. package model
  2. import (
  3. "net"
  4. "go-common/library/time"
  5. )
  6. // ArgDevice .
  7. type ArgDevice struct {
  8. Device string `form:"device" default:"pc"`
  9. Build int64 `form:"build" default:"0"`
  10. }
  11. // ArgMid .
  12. type ArgMid struct {
  13. Mid int64 `form:"mid" validate:"required"`
  14. }
  15. //ArgPannel .
  16. type ArgPannel struct {
  17. Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
  18. Platform string `form:"platform" validate:"required"`
  19. }
  20. //ArgChangeHistory .
  21. type ArgChangeHistory struct {
  22. Mid int64 `form:"mid" validate:"required"`
  23. Pn int `form:"pn"`
  24. Ps int `form:"ps"`
  25. }
  26. // ArgAddOrder add order form.
  27. type ArgAddOrder struct {
  28. AppID int64 `form:"appId" default:"0"`
  29. Months int64 `form:"months" validate:"required"`
  30. AppsubID string `form:"appsubId"`
  31. BmID int64 `form:"bmid"`
  32. }
  33. //ArgCreateOrder .
  34. type ArgCreateOrder struct {
  35. Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
  36. AppID int64 `form:"app_id" default:"0"`
  37. AppSubID string `form:"app_sub_id"`
  38. Months int16 `form:"months" validate:"required,min=1,gte=1"`
  39. OrderType int8 `form:"order_type" `
  40. DType int8 `form:"dtype"`
  41. Bmid int64 `form:"bmid"`
  42. Platform string `form:"platform"`
  43. Price float64 `form:"price"`
  44. IP string `form:"ip"`
  45. }
  46. //ArgCreateOrder2 .
  47. type ArgCreateOrder2 struct {
  48. Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
  49. Month int32 `form:"months" validate:"required,min=1,gte=1"`
  50. Platform string `form:"platform"`
  51. MobiApp string `form:"mobi_app"`
  52. Device string `form:"device"`
  53. AppID int64 `form:"appId"`
  54. AppSubID string `form:"appSubId"`
  55. OrderType int8 `form:"orderType"`
  56. Dtype int8 `form:"dtype"`
  57. ReturnURL string `form:"returnUrl"`
  58. CouponToken string `form:"coupon_token"`
  59. Bmid int64 `form:"bmid"`
  60. PanelType string `form:"panel_type" default:"normal"`
  61. Build int64 `form:"build"`
  62. IP net.IP
  63. }
  64. // ArgPrice def.
  65. type ArgPrice struct {
  66. Month int16 `form:"month"`
  67. Platform int `form:"platform"`
  68. Mt int8 `form:"mt"`
  69. DiscountStatus int8
  70. }
  71. // ArgPriceV2 arg price v2.
  72. type ArgPriceV2 struct {
  73. Mid int64
  74. Month int16
  75. SubType int8
  76. Token string
  77. Platform string
  78. PanelType string
  79. MobiApp string
  80. Device string
  81. Build int64
  82. }
  83. // ArgCreateOrderPlatform def.
  84. type ArgCreateOrderPlatform struct {
  85. Mid int64 `form:"mid"`
  86. AppID int64 `form:"appId"`
  87. Bmid int64 `form:"bmid"`
  88. Month int16 `form:"months"`
  89. Price float64 `form:"price"`
  90. Platform int `form:"platform"`
  91. Dtype int8 `form:"dtype"`
  92. OrderType int8 `form:"orderType"`
  93. AppSubID string `form:"appsubId"`
  94. }
  95. // ArgUseBatch def.
  96. type ArgUseBatch struct {
  97. BatchID int64 `form:"batch_id" validate:"required" json:"batch_id"`
  98. Mid int64 `form:"mid" validate:"required" json:"mid"`
  99. OrderNo string `form:"order_no" validate:"required" json:"order_no"`
  100. Remark string `form:"remark" validate:"required" json:"remark"`
  101. Appkey string `form:"appkey" validate:"required" json:"appkey"`
  102. Sign string `form:"sign"`
  103. Ts int64 `form:"ts"`
  104. }
  105. //ToMap .
  106. func (arg *ArgUseBatch) ToMap() map[string]interface{} {
  107. mapVal := make(map[string]interface{})
  108. mapVal["batch_id"] = arg.BatchID
  109. mapVal["mid"] = arg.Mid
  110. mapVal["order_no"] = arg.OrderNo
  111. mapVal["remark"] = arg.Remark
  112. mapVal["appkey"] = arg.Appkey
  113. mapVal["sign"] = arg.Sign
  114. mapVal["ts"] = arg.Ts
  115. return mapVal
  116. }
  117. // ArgBuyVip def.
  118. type ArgBuyVip struct {
  119. AppID int64 `form:"appId" default:"0"`
  120. Months int16 `form:"months" validate:"required"`
  121. PayWay string `form:"payWay" validate:"required"`
  122. Bmid int64 `form:"bmid"`
  123. BankCode string `form:"bank_code"`
  124. ProductID string `form:"productId"`
  125. AppSubID string `form:"appsubId"`
  126. AccessKey string `form:"access_key"`
  127. Platform string `form:"platform"`
  128. }
  129. //ArgBuyPoint .
  130. type ArgBuyPoint struct {
  131. Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
  132. Month int16 `form:"month" validate:"required" `
  133. }
  134. // ArgOldPayOrder def.
  135. type ArgOldPayOrder struct {
  136. OrderNo string `form:"order_no" validate:"required"`
  137. AppID int64 `form:"app_id"`
  138. Platform int8 `form:"platform" `
  139. OrderType int8 `form:"order_type"`
  140. AppSubID string `form:"app_sub_id"`
  141. Mid int64 `form:"mid"`
  142. ToMid int64 `form:"to_mid"`
  143. BuyMonths int16 `form:"buy_months" validate:"required,min=1,gte=1"`
  144. Money float64 `form:"money" validate:"required"`
  145. Status int8 `form:"status"`
  146. PayType int8 `form:"pay_type"`
  147. RechargeBp float64 `form:"recharge_bp"`
  148. ThirdTradeNo string `form:"third_trade_no"`
  149. }
  150. // ArgVipConfig .
  151. type ArgVipConfig struct {
  152. Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
  153. Device string `form:"device"`
  154. MobiApp string `form:"mobi_app"`
  155. SortType int8 `form:"sort_type"`
  156. PanelType string `form:"panel_type" default:"normal"`
  157. Build int64 `form:"build"`
  158. }
  159. //ArgCodeOpened code opened.
  160. type ArgCodeOpened struct {
  161. BisAppkey string `form:"bis_appkey"`
  162. BisSign string `form:"bis_sign"`
  163. BisTs int64 `form:"bis_ts"`
  164. StartTime time.Time `form:"start_time"`
  165. EndTime time.Time `form:"end_time"`
  166. Cursor int64 `form:"cursor"`
  167. }
  168. //ToMap .
  169. func (arg *ArgCodeOpened) ToMap() map[string]interface{} {
  170. mapval := make(map[string]interface{})
  171. mapval["appkey"] = arg.BisAppkey
  172. mapval["sign"] = arg.BisSign
  173. mapval["ts"] = arg.BisTs
  174. mapval["start_time"] = arg.StartTime
  175. mapval["end_time"] = arg.EndTime
  176. mapval["cursor"] = arg.Cursor
  177. return mapval
  178. }
  179. // ArgVipConfigMonth .
  180. type ArgVipConfigMonth struct {
  181. Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
  182. Device string `form:"device"`
  183. MobiApp string `form:"mobi_app"`
  184. Month int16 `form:"month" validate:"required,min=1,gte=1"`
  185. SubType int8 `form:"sub_type" validate:"min=0,max=1"`
  186. CouponToken string `form:"coupon_token"`
  187. Platform string `form:"platform" default:"pc"`
  188. PanelType string `form:"panel_type" default:"normal"`
  189. IgnoreAutoRenewStatus int8 `form:"ignore_autorenew_status"`
  190. Build int64 `form:"build"`
  191. }
  192. //ArgCancelUseCoupon cancel use coupon.
  193. type ArgCancelUseCoupon struct {
  194. Mid int64 `form:"mid" validate:"required,min=1,gte=1"`
  195. CouponToken string `form:"coupon_token" validate:"required"`
  196. }
  197. // ArgAssociateVip associate vip arg.
  198. type ArgAssociateVip struct {
  199. Platform string `form:"platform"`
  200. MobiApp string `form:"mobi_app"`
  201. Device string `form:"device"`
  202. }
  203. // ArgPriceByProduct arg price by product.
  204. type ArgPriceByProduct struct {
  205. ProductID string `form:"product_id" validate:"required"`
  206. }
  207. // ArgVipPriceByID arg vip price.
  208. type ArgVipPriceByID struct {
  209. ID int64 `form:"id" validate:"required"`
  210. }