active.config.go 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. package models
  2. import "github.com/shopspring/decimal"
  3. type CreateActiveConfigRequest struct {
  4. MerchantOpenID string `json:"merchant_open_id"`
  5. DrawOneBiZhong int64 `json:"draw_one_bi_zhong"`
  6. GroupBuyUrl string `json:"group_buy_url"`
  7. DrawId []int64 `json:"draw_id"`
  8. GroupBuyId []int64 `json:"group_buy_id"`
  9. GroupBuyMode int `json:"group_buy_mode"` // 0-不开团 1-虚拟开团 2-真实开团
  10. DrawMode int `json:"draw_mode"` // 抽奖模式 0-不抽奖,1-盲盒
  11. ActivityEndTime string `json:"activity_end_time"` // 活动结束时间
  12. ActivityStartTime string `json:"activity_start_time"` // 活动开始时间
  13. ActiveName string `json:"active_name"` // 活动名称
  14. BackgroundImage string `json:"background_image"` // 海报
  15. }
  16. type ActiveConfigRequest struct {
  17. ActiveConfigId int64 `json:"active_config_id"`
  18. MerchantOpenID string `json:"merchant_open_id"`
  19. }
  20. type ActiveConfigReply struct {
  21. MerchantName string `json:"merchant_name"` //商家名称
  22. DrawOneBiZhong int64 `json:"draw_one_bi_zhong"` //
  23. GroupBuyUrl string `json:"group_buy_url"` //
  24. GroupBuyMode int `json:"group_buy_mode"` // 0-不开团 1-虚拟开团 2-真实开团
  25. DrawMode int `json:"draw_mode"` //抽奖模式 0-不抽奖,1-盲盒
  26. ActivityEndTime string `json:"activity_end_time"` //活动结束时间
  27. ActivityStartTime string `json:"activity_start_time"` //活动开始时间
  28. ActiveName string `json:"active_name"` //活动名称
  29. BackgroundImage string `json:"background_image"` // 海报
  30. DrawProduct []DrawProduct `json:"draw_product"` //中奖商品
  31. DrawGroupBuy []DrawGroupBuy `json:"draw_group_buy"` //活动拼团
  32. }
  33. type DrawProduct struct {
  34. DrawProductName string `json:"draw_product_name"` // 抽奖名称
  35. DrawOdds int `json:"draw_odds"` // 中奖概率
  36. Stock int `json:"stock"` // 剩余库存
  37. IsPrize bool `json:"is_prize"` // 是否需要兑奖 谢谢惠顾不需要兑奖
  38. DrawUrl string `json:"draw_url"` // 中奖图片
  39. TotalStock int `json:"total_stock"` // 总库存
  40. }
  41. type DrawGroupBuy struct {
  42. GroupBuyName string `json:"group_buy_name"` // 拼团名
  43. GroupBuyMode int `json:"group_buy_mode"` // 拼团模式 1-真实拼团 2-虚拟拼团
  44. MerchantOpenID string `json:"merchant_open_id"` //
  45. OriginalPrice decimal.Decimal `json:"original_price"` // 原价
  46. GroupBuyOneNum int `json:"group_buy_one_num"` // 人数
  47. GroupBuyOnePrice decimal.Decimal `json:"group_buy_one_price"` // 价格
  48. GroupBuyTwoNum int `json:"group_buy_two_num"` // 人数
  49. GroupBuyTwoPrice decimal.Decimal `json:"group_buy_two_price"` // 价格
  50. GroupBuyThreeNum int `json:"group_buy_three_num"` //
  51. GroupBuyThreePrice decimal.Decimal `json:"group_buy_three_price"` //
  52. GroupBuyFourNum int `json:"group_buy_four_num"` //
  53. GroupBuyFourPrice decimal.Decimal `json:"group_buy_four_price"` //
  54. GroupBuyUrl string `json:"group_buy_url"` // 图片
  55. ActivityEndTime string `json:"activity_end_time"` // 活动结束时间
  56. ActivityStartTime string `json:"activity_start_time"` // 活动开始时间
  57. RebateRate int `json:"rebate_rate"` // 佣金比例
  58. GroupBuyProject []GroupBuyProject `json:"group_buy_project"`
  59. }
  60. type GroupBuyProject struct {
  61. ProjectName string `json:"project_name"`
  62. CancelNum int `json:"cancel_num"`
  63. }
  64. type ActiveConfigListRequest struct {
  65. OpenId string `json:"open_id"`
  66. PageSize int `json:"page_size"`
  67. PageIndex int `json:"page_index"`
  68. }
  69. type ActiveConfigListReply struct {
  70. ID int64 `json:"id"` //id
  71. ActiveName string `json:"active_name"` // 活动名称
  72. ActivityEnd string `json:"activity_end"` // 活动结束时间
  73. ActivityStart string `json:"activity_start"` //活动开始时间
  74. CreatedAt string `json:"created_at"` //创建时间
  75. }
  76. // 抽奖
  77. type DrawRequest struct {
  78. ClientOpenID string `json:"client_open_id"` //open-id
  79. ActiveConfigID int64 `json:"active_config_id"` //活动ID
  80. }
  81. // 奖品返回
  82. type DrawReply struct {
  83. ID int64 `json:"id"` //id
  84. DrawUrl string `json:"draw_url"` //奖品url
  85. DrawProductName string `json:"draw_product_name"` //奖品名称
  86. Version int `json:"version"`
  87. }
  88. const (
  89. NotWon = 1 //未中奖
  90. NotClaimed = 2 //未兑奖
  91. Claimed = 3 //已兑奖
  92. )
  93. type ActiveConfigWHXYRequest struct {
  94. WHXY string `json:"whxy"` //坐标
  95. ActiveConfigId int64 `json:"activeConfigId"` //
  96. }
  97. type ClientActiveQRRequest struct {
  98. ActiveConfigId int64 `json:"active_config_id"` //
  99. }
  100. type GroupBuyUnifiedOrderRequest struct {
  101. RequestId string `json:"request_id"` //request id
  102. OutTradeNo string `json:"out_trade_no"` //交易id
  103. ActiveConfigId int64 `json:"activeConfigId"` //
  104. ClientOpenId string `json:"client_open_id"` //openid
  105. Amount decimal.Decimal `json:"amount"` //交易金额
  106. InvitationCode string `json:"invitation_code"` //邀请码
  107. }
  108. type GroupBuyUnifiedOrderReply struct {
  109. Timestamp string `json:"timestamp"` // 时间戳
  110. NonceStr string `json:"nonce_str"` // 随机字符串,长度为32个字符以下
  111. Package string `json:"package"` // prepay_id 参数值
  112. PaySign string `json:"pay_sign"` // 签名
  113. SignType string `json:"sign_type"` // 签名类型
  114. }