card.go 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. }
  40. // 画布详情
  41. type GetMerchantCanvasCardReply struct {
  42. Static Static `json:"static"`
  43. SwiperList []SwiperList `json:"swiperList"`
  44. RightButton []RightButton `json:"rightButton"`
  45. DataList []DataList `json:"dataList"`
  46. BuyKnowList []BuyKnowList `json:"buyKnowList"`
  47. ShopData ShopData `json:"shopData"`
  48. Base64Img string `json:"base64Img"`
  49. FenxiangShow bool `json:"fenxiangShow"`
  50. MerchantAmount decimal.Decimal `json:"merchantAmount"`
  51. MerchantOriginalAmount decimal.Decimal `json:"merchantOriginalAmount"`
  52. Inventory int64 `json:"inventory"`
  53. IsShare bool `json:"isShare"`
  54. InvitationCode string `json:"invitationCode"`
  55. }
  56. type Static struct {
  57. Background string `json:"background"`
  58. }
  59. type SwiperList struct {
  60. ID int `json:"id"`
  61. URL string `json:"url"`
  62. }
  63. type RightButton struct {
  64. ImageURL string `json:"imageUrl"`
  65. }
  66. type DataList struct {
  67. Name string `json:"name"`
  68. Count int `json:"count"`
  69. Price string `json:"price"`
  70. }
  71. type BuyKnowList struct {
  72. Icon string `json:"icon"`
  73. Title string `json:"title"`
  74. Text string `json:"text"`
  75. }
  76. type ShopData struct {
  77. ImageURL string `json:"imageUrl"`
  78. Name string `json:"name"`
  79. StarRating int `json:"starRating"`
  80. Address string `json:"address"`
  81. Distance string `json:"distance"`
  82. }
  83. type MerchantCardListRequest struct {
  84. OpenId string `json:"open_id"`
  85. PageSize int `json:"page_size"`
  86. PageIndex int `json:"page_index"`
  87. TypeList int `json:"type_list"` //1-未开始 2-进行中 3-已结束
  88. }
  89. type MerchantCardListReply struct {
  90. ID int64 `json:"id"`
  91. MerchantCardName string `json:"merchant_card_name"` // 商户卡名称
  92. MerchantOpenID string `json:"merchant_open_id"` // openid
  93. CardProjectData string `json:"card_project_data"` // 项目
  94. CardPrice string `json:"card_price"` // 单价
  95. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  96. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  97. MerchantCardTime int64 `json:"merchant_card_time"` // 商户卡有效期
  98. Inventory int64 `json:"inventory"` // 库存数量
  99. QuotaNum int64 `json:"quota_num"` // 限购数量
  100. UseRule string `json:"use_rule"` // 使用规则
  101. Picture string `json:"picture"` // 图片
  102. RebateRate int64 `json:"rebate_rate"` // 佣金比例
  103. CreateBy int64 `json:"create_by"` // 创建者
  104. UpdateBy int64 `json:"update_by"` // 更新者
  105. CreatedAt time.Time `json:"created_at"` // 创建时间
  106. UpdatedAt time.Time `json:"updated_at"` // 最后更新时间
  107. DeletedAt time.Time `json:"deleted_at"`
  108. RebateAmount string `json:"rebate_amount"` // 佣金
  109. }
  110. type UpdateMerchantCardRequest struct {
  111. ID int64 `json:"id"`
  112. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  113. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  114. Inventory int64 `json:"inventory"` // 库存数量
  115. QuotaNum int64 `json:"quota_num"` // 限购数量
  116. UseRule string `json:"use_rule"` // 使用规则
  117. Picture string `json:"picture"` // 图片
  118. }
  119. type UpdateMerchantCardWHXYRequest struct {
  120. Whxy string `json:"whxy"` //坐标
  121. MerchantCardId int64 `json:"merchant_card_id"`
  122. }
  123. type WHXYStr struct {
  124. Type string `json:"type"`
  125. URL string `json:"url"`
  126. Y decimal.Decimal `json:"y,omitempty"`
  127. X decimal.Decimal `json:"x,omitempty"`
  128. W decimal.Decimal `json:"w,omitempty"`
  129. H decimal.Decimal `json:"h,omitempty"`
  130. Rotate int `json:"rotate,omitempty"`
  131. SourceID any `json:"sourceId,omitempty"`
  132. }