card.go 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. package models
  2. import (
  3. "github.com/shopspring/decimal"
  4. "time"
  5. )
  6. type CreateMerchantCardRequest struct {
  7. MerchantCardName string `json:"merchant_card_name"` // 商户卡名称
  8. MerchantOpenID string `json:"open_id"` // openid
  9. CardProjectData []int64 `json:"card_project_data"` // 项目
  10. CardPrice string `json:"card_price"` // 单价
  11. ActivityEndTime string `json:"activity_end_time"` // 活动结束时间
  12. ActivityStartTime string `json:"activity_start_time"` // 活动开始时间
  13. MerchantCardTime string `json:"merchant_card_time"` // 商户卡有效期
  14. Inventory string `json:"inventory"` // 库存数量
  15. QuotaNum string `json:"quota_num"` // 限购数量
  16. UseRule string `json:"use_rule"` // 使用规则
  17. Picture string `json:"picture"` // 图片
  18. RebateRate string `json:"rebate_rate"` // 佣金比例
  19. CancelNumber string `json:"cancel_number"` //核销次数
  20. BackgroundImage string `json:"background_image"` //背景图
  21. }
  22. type GetMerchantCardRequest struct {
  23. MerchantId int64 `json:"merchant_card_id"` //商户卡id
  24. Code string `json:"code"` //b邀请码
  25. }
  26. type GetMerchantCardReply struct {
  27. MerchantCardName string `json:"merchant_card_name"` // 商户卡名称
  28. MerchantOpenID string `json:"merchant_open_id"` // openid
  29. CardProjectData string `json:"card_project_data"` // 项目
  30. CardPrice string `json:"card_price"` // 单价
  31. ActivityEndTime string `json:"activity_end_time"` // 活动结束时间
  32. ActivityStartTime string `json:"activity_start_time"` // 活动开始时间
  33. MerchantCardTime string `json:"merchant_card_time"` // 商户卡有效期
  34. Inventory int64 `json:"inventory"` // 库存数量
  35. QuotaNum int64 `json:"quota_num"` // 限购数量
  36. UseRule string `json:"use_rule"` // 使用规则
  37. Picture string `json:"picture"` // 图片
  38. RebateRate int64 `json:"rebate_rate"`
  39. BackgroundImage string `json:"background_image"` //背景图
  40. W string `json:"w"` // w
  41. H string `json:"h"` // h
  42. X string `json:"x"` // x
  43. Y string `json:"y"` // y
  44. }
  45. // 画布详情
  46. type GetMerchantCanvasCardReply struct {
  47. Static Static `json:"static"`
  48. SwiperList []SwiperList `json:"swiperList"`
  49. RightButton []RightButton `json:"rightButton"`
  50. DataList []DataList `json:"dataList"`
  51. BuyKnowList []BuyKnowList `json:"buyKnowList"`
  52. ShopData ShopData `json:"shopData"`
  53. Base64Img string `json:"base64Img"`
  54. FenxiangShow bool `json:"fenxiangShow"`
  55. MerchantAmount decimal.Decimal `json:"merchantAmount"`
  56. MerchantOriginalAmount decimal.Decimal `json:"merchantOriginalAmount"`
  57. Inventory int64 `json:"inventory"`
  58. IsShare bool `json:"isShare"`
  59. InvitationCode string `json:"invitationCode"`
  60. QRUrl string `json:"qrUrl"`
  61. }
  62. type Static struct {
  63. Background string `json:"background"`
  64. }
  65. type SwiperList struct {
  66. ID int `json:"id"`
  67. URL string `json:"url"`
  68. }
  69. type RightButton struct {
  70. ImageURL string `json:"imageUrl"`
  71. }
  72. type DataList struct {
  73. Name string `json:"name"`
  74. Count int `json:"count"`
  75. Price string `json:"price"`
  76. }
  77. type BuyKnowList struct {
  78. Icon string `json:"icon"`
  79. Title string `json:"title"`
  80. Text string `json:"text"`
  81. }
  82. type ShopData struct {
  83. ImageURL string `json:"imageUrl"`
  84. Name string `json:"name"`
  85. StarRating int `json:"starRating"`
  86. Address string `json:"address"`
  87. Distance string `json:"distance"`
  88. }
  89. type MerchantCardListRequest struct {
  90. OpenId string `json:"open_id"`
  91. PageSize int `json:"page_size"`
  92. PageIndex int `json:"page_index"`
  93. TypeList int `json:"type_list"` //1-未开始 2-进行中 3-已结束
  94. }
  95. type MerchantCardListReply struct {
  96. ID int64 `json:"id"`
  97. MerchantCardName string `json:"merchant_card_name"` // 商户卡名称
  98. MerchantOpenID string `json:"merchant_open_id"` // openid
  99. CardProjectData string `json:"card_project_data"` // 项目
  100. CardPrice string `json:"card_price"` // 单价
  101. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  102. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  103. MerchantCardTime int64 `json:"merchant_card_time"` // 商户卡有效期
  104. Inventory int64 `json:"inventory"` // 库存数量
  105. QuotaNum int64 `json:"quota_num"` // 限购数量
  106. UseRule string `json:"use_rule"` // 使用规则
  107. Picture string `json:"picture"` // 图片
  108. RebateRate int64 `json:"rebate_rate"` // 佣金比例
  109. CreateBy int64 `json:"create_by"` // 创建者
  110. UpdateBy int64 `json:"update_by"` // 更新者
  111. CreatedAt time.Time `json:"created_at"` // 创建时间
  112. UpdatedAt time.Time `json:"updated_at"` // 最后更新时间
  113. DeletedAt time.Time `json:"deleted_at"`
  114. RebateAmount string `json:"rebate_amount"` // 佣金
  115. }
  116. type UpdateMerchantCardRequest struct {
  117. ID int64 `json:"id"`
  118. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  119. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  120. Inventory int64 `json:"inventory"` // 库存数量
  121. QuotaNum int64 `json:"quota_num"` // 限购数量
  122. UseRule string `json:"use_rule"` // 使用规则
  123. Picture string `json:"picture"` // 图片
  124. }
  125. type UpdateMerchantCardWHXYRequest struct {
  126. Whxy string `json:"whxy"` //坐标
  127. MerchantCardId int64 `json:"merchant_card_id"`
  128. }
  129. type WHXYStr struct {
  130. Type string `json:"type"`
  131. URL string `json:"url"`
  132. Y decimal.Decimal `json:"y,omitempty"`
  133. X decimal.Decimal `json:"x,omitempty"`
  134. W decimal.Decimal `json:"w,omitempty"`
  135. H decimal.Decimal `json:"h,omitempty"`
  136. //Rotate int `json:"rotate,omitempty"`
  137. //SourceID any `json:"sourceId,omitempty"`
  138. }