
1package main
2
3import (
4 "demo/wxpay_utility"
5 "encoding/json"
6 "fmt"
7 "net/http"
8 "net/url"
9 "strings"
10 "time"
11)
12
13func main() {
14
15 config, err := wxpay_utility.CreateMchConfig(
16 "19xxxxxxxx",
17 "1DDE55AD98Exxxxxxxxxx",
18 "/path/to/apiclient_key.pem",
19 "PUB_KEY_ID_xxxxxxxxxxxxx",
20 "/path/to/wxp_pub.pem",
21 )
22 if err != nil {
23 fmt.Println(err)
24 return
25 }
26
27 request := &ListUserProductCouponsRequest{
28 ProductCouponId: wxpay_utility.String("1000000013"),
29 StockId: wxpay_utility.String("1000000013001"),
30 Appid: wxpay_utility.String("wx233544546545989"),
31 Openid: wxpay_utility.String("oh-394z-6CGkNoJrsDLTTUKiAnp4"),
32 PageSize: wxpay_utility.Int64(10),
33 BrandId: wxpay_utility.String("120344"),
34 }
35
36 response, err := ListUserProductCoupons(config, request)
37 if err != nil {
38 fmt.Printf("请求失败: %+v\n", err)
39
40 return
41 }
42
43
44 fmt.Printf("请求成功: %+v\n", response)
45}
46
47func ListUserProductCoupons(config *wxpay_utility.MchConfig, request *ListUserProductCouponsRequest) (response *ListUserProductCouponsResponse, err error) {
48 const (
49 host = "https://api.mch.weixin.qq.com"
50 method = "GET"
51 path = "/v3/marketing/partner/product-coupon/users/{openid}/coupons"
52 )
53
54 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path))
55 if err != nil {
56 return nil, err
57 }
58 reqUrl.Path = strings.Replace(reqUrl.Path, "{openid}", url.PathEscape(*request.Openid), -1)
59 query := reqUrl.Query()
60 if request.ProductCouponId != nil {
61 query.Add("product_coupon_id", *request.ProductCouponId)
62 }
63 if request.StockId != nil {
64 query.Add("stock_id", *request.StockId)
65 }
66 if request.Appid != nil {
67 query.Add("appid", *request.Appid)
68 }
69 if request.CouponState != nil {
70 query.Add("coupon_state", fmt.Sprintf("%v", *request.CouponState))
71 }
72 if request.UserCouponBundleId != nil {
73 query.Add("user_coupon_bundle_id", *request.UserCouponBundleId)
74 }
75 if request.PageSize != nil {
76 query.Add("page_size", fmt.Sprintf("%v", *request.PageSize))
77 }
78 if request.PageToken != nil {
79 query.Add("page_token", *request.PageToken)
80 }
81 if request.BrandId != nil {
82 query.Add("brand_id", *request.BrandId)
83 }
84 reqUrl.RawQuery = query.Encode()
85 httpRequest, err := http.NewRequest(method, reqUrl.String(), nil)
86 if err != nil {
87 return nil, err
88 }
89 httpRequest.Header.Set("Accept", "application/json")
90 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId())
91 authorization, err := wxpay_utility.BuildAuthorization(config.MchId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), nil)
92 if err != nil {
93 return nil, err
94 }
95 httpRequest.Header.Set("Authorization", authorization)
96
97 client := &http.Client{}
98 httpResponse, err := client.Do(httpRequest)
99 if err != nil {
100 return nil, err
101 }
102 respBody, err := wxpay_utility.ExtractResponseBody(httpResponse)
103 if err != nil {
104 return nil, err
105 }
106 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 {
107
108 err = wxpay_utility.ValidateResponse(
109 config.WechatPayPublicKeyId(),
110 config.WechatPayPublicKey(),
111 &httpResponse.Header,
112 respBody,
113 )
114 if err != nil {
115 return nil, err
116 }
117 response := &ListUserProductCouponsResponse{}
118 if err := json.Unmarshal(respBody, response); err != nil {
119 return nil, err
120 }
121
122 return response, nil
123 } else {
124 return nil, wxpay_utility.NewApiException(
125 httpResponse.StatusCode,
126 httpResponse.Header,
127 respBody,
128 )
129 }
130}
131
132type ListUserProductCouponsRequest struct {
133 ProductCouponId *string `json:"product_coupon_id,omitempty"`
134 StockId *string `json:"stock_id,omitempty"`
135 Appid *string `json:"appid,omitempty"`
136 Openid *string `json:"openid,omitempty"`
137 UserCouponBundleId *string `json:"user_coupon_bundle_id,omitempty"`
138 PageSize *int64 `json:"page_size,omitempty"`
139 PageToken *string `json:"page_token,omitempty"`
140 BrandId *string `json:"brand_id,omitempty"`
141 CouponState *UserProductCouponState `json:"coupon_state,omitempty"`
142}
143
144func (o *ListUserProductCouponsRequest) MarshalJSON() ([]byte, error) {
145 type Alias ListUserProductCouponsRequest
146 a := &struct {
147 ProductCouponId *string `json:"product_coupon_id,omitempty"`
148 StockId *string `json:"stock_id,omitempty"`
149 Appid *string `json:"appid,omitempty"`
150 Openid *string `json:"openid,omitempty"`
151 UserCouponBundleId *string `json:"user_coupon_bundle_id,omitempty"`
152 PageSize *int64 `json:"page_size,omitempty"`
153 PageToken *string `json:"page_token,omitempty"`
154 BrandId *string `json:"brand_id,omitempty"`
155 CouponState *UserProductCouponState `json:"coupon_state,omitempty"`
156 *Alias
157 }{
158
159 ProductCouponId: nil,
160 StockId: nil,
161 Appid: nil,
162 Openid: nil,
163 UserCouponBundleId: nil,
164 PageSize: nil,
165 PageToken: nil,
166 BrandId: nil,
167 CouponState: nil,
168 Alias: (*Alias)(o),
169 }
170 return json.Marshal(a)
171}
172
173type ListUserProductCouponsResponse struct {
174 TotalCount *int64 `json:"total_count,omitempty"`
175 UserCouponList []UserProductCouponEntity `json:"user_coupon_list,omitempty"`
176 NextPageToken *string `json:"next_page_token,omitempty"`
177}
178
179type UserProductCouponState string
180
181func (e UserProductCouponState) Ptr() *UserProductCouponState {
182 return &e
183}
184
185const (
186 USERPRODUCTCOUPONSTATE_CONFIRMING UserProductCouponState = "CONFIRMING"
187 USERPRODUCTCOUPONSTATE_PENDING UserProductCouponState = "PENDING"
188 USERPRODUCTCOUPONSTATE_EFFECTIVE UserProductCouponState = "EFFECTIVE"
189 USERPRODUCTCOUPONSTATE_USED UserProductCouponState = "USED"
190 USERPRODUCTCOUPONSTATE_EXPIRED UserProductCouponState = "EXPIRED"
191 USERPRODUCTCOUPONSTATE_DELETED UserProductCouponState = "DELETED"
192 USERPRODUCTCOUPONSTATE_DEACTIVATED UserProductCouponState = "DEACTIVATED"
193)
194
195type UserProductCouponEntity struct {
196 CouponCode *string `json:"coupon_code,omitempty"`
197 CouponState *UserProductCouponState `json:"coupon_state,omitempty"`
198 ValidBeginTime *time.Time `json:"valid_begin_time,omitempty"`
199 ValidEndTime *time.Time `json:"valid_end_time,omitempty"`
200 ReceiveTime *string `json:"receive_time,omitempty"`
201 SendRequestNo *string `json:"send_request_no,omitempty"`
202 SendChannel *UserProductCouponSendChannel `json:"send_channel,omitempty"`
203 ConfirmRequestNo *string `json:"confirm_request_no,omitempty"`
204 ConfirmTime *time.Time `json:"confirm_time,omitempty"`
205 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
206 DeactivateTime *string `json:"deactivate_time,omitempty"`
207 DeactivateReason *string `json:"deactivate_reason,omitempty"`
208 SingleUsageDetail *CouponUsageDetail `json:"single_usage_detail,omitempty"`
209 ProgressiveBundleUsageDetail *CouponUsageDetail `json:"progressive_bundle_usage_detail,omitempty"`
210 UserProductCouponBundleInfo *UserProductCouponBundleInfo `json:"user_product_coupon_bundle_info,omitempty"`
211 ProductCoupon *ProductCouponEntity `json:"product_coupon,omitempty"`
212 Stock *StockEntity `json:"stock,omitempty"`
213 Attach *string `json:"attach,omitempty"`
214 ChannelCustomInfo *string `json:"channel_custom_info,omitempty"`
215 CouponTagInfo *CouponTagInfo `json:"coupon_tag_info,omitempty"`
216 BrandId *string `json:"brand_id,omitempty"`
217}
218
219type UserProductCouponSendChannel string
220
221func (e UserProductCouponSendChannel) Ptr() *UserProductCouponSendChannel {
222 return &e
223}
224
225const (
226 USERPRODUCTCOUPONSENDCHANNEL_BRAND_MANAGE UserProductCouponSendChannel = "BRAND_MANAGE"
227 USERPRODUCTCOUPONSENDCHANNEL_API UserProductCouponSendChannel = "API"
228 USERPRODUCTCOUPONSENDCHANNEL_RECEIVE_COMPONENT UserProductCouponSendChannel = "RECEIVE_COMPONENT"
229 USERPRODUCTCOUPONSENDCHANNEL_MEMBER UserProductCouponSendChannel = "MEMBER"
230 USERPRODUCTCOUPONSENDCHANNEL_STICKER_GIFT UserProductCouponSendChannel = "STICKER_GIFT"
231)
232
233type CouponUsageDetail struct {
234 UseRequestNo *string `json:"use_request_no,omitempty"`
235 UseTime *time.Time `json:"use_time,omitempty"`
236 ReturnRequestNo *string `json:"return_request_no,omitempty"`
237 ReturnTime *time.Time `json:"return_time,omitempty"`
238 AssociatedOrderInfo *UserProductCouponAssociatedOrderInfo `json:"associated_order_info,omitempty"`
239 AssociatedPayScoreOrderInfo *UserProductCouponAssociatedPayScoreOrderInfo `json:"associated_pay_score_order_info,omitempty"`
240 SavedAmount *int64 `json:"saved_amount,omitempty"`
241 UseProductNoList []string `json:"use_product_no_list,omitempty"`
242}
243
244type UserProductCouponBundleInfo struct {
245 UserCouponBundleId *string `json:"user_coupon_bundle_id,omitempty"`
246 UserCouponBundleIndex *int64 `json:"user_coupon_bundle_index,omitempty"`
247 TotalCount *int64 `json:"total_count,omitempty"`
248 UsedCount *int64 `json:"used_count,omitempty"`
249}
250
251type ProductCouponEntity struct {
252 ProductCouponId *string `json:"product_coupon_id,omitempty"`
253 Scope *ProductCouponScope `json:"scope,omitempty"`
254 Type *ProductCouponType `json:"type,omitempty"`
255 UsageMode *UsageMode `json:"usage_mode,omitempty"`
256 SingleUsageInfo *SingleUsageInfo `json:"single_usage_info,omitempty"`
257 ProgressiveBundleUsageInfo *ProgressiveBundleUsageInfo `json:"progressive_bundle_usage_info,omitempty"`
258 DisplayInfo *ProductCouponDisplayInfo `json:"display_info,omitempty"`
259 OutProductNo *string `json:"out_product_no,omitempty"`
260 State *ProductCouponState `json:"state,omitempty"`
261 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
262 DeactivateTime *string `json:"deactivate_time,omitempty"`
263 DeactivateReason *string `json:"deactivate_reason,omitempty"`
264 BrandId *string `json:"brand_id,omitempty"`
265 ShowAsExchange *bool `json:"show_as_exchange,omitempty"`
266 AvailableProductNoList []string `json:"available_product_no_list,omitempty"`
267}
268
269type StockEntity struct {
270 ProductCouponId *string `json:"product_coupon_id,omitempty"`
271 StockId *string `json:"stock_id,omitempty"`
272 Remark *string `json:"remark,omitempty"`
273 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
274 CouponCodeCountInfo *CouponCodeCountInfo `json:"coupon_code_count_info,omitempty"`
275 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"`
276 SingleUsageRule *SingleUsageRule `json:"single_usage_rule,omitempty"`
277 ProgressiveBundleUsageRule *StockUsageRule `json:"progressive_bundle_usage_rule,omitempty"`
278 StockBundleInfo *StockBundleInfo `json:"stock_bundle_info,omitempty"`
279 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
280 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
281 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
282 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
283 SentCountInfo *StockSentCountInfo `json:"sent_count_info,omitempty"`
284 State *StockState `json:"state,omitempty"`
285 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
286 DeactivateTime *time.Time `json:"deactivate_time,omitempty"`
287 DeactivateReason *string `json:"deactivate_reason,omitempty"`
288 BrandId *string `json:"brand_id,omitempty"`
289}
290
291type CouponTagInfo struct {
292 CouponTagList []UserProductCouponTag `json:"coupon_tag_list,omitempty"`
293 MemberTagInfo *MemberTagInfo `json:"member_tag_info,omitempty"`
294}
295
296type UserProductCouponAssociatedOrderInfo struct {
297 TransactionId *string `json:"transaction_id,omitempty"`
298 OutTradeNo *string `json:"out_trade_no,omitempty"`
299 Mchid *string `json:"mchid,omitempty"`
300 SubMchid *string `json:"sub_mchid,omitempty"`
301}
302
303type UserProductCouponAssociatedPayScoreOrderInfo struct {
304 OrderId *string `json:"order_id,omitempty"`
305 OutOrderNo *string `json:"out_order_no,omitempty"`
306 Mchid *string `json:"mchid,omitempty"`
307 SubMchid *string `json:"sub_mchid,omitempty"`
308}
309
310type ProductCouponScope string
311
312func (e ProductCouponScope) Ptr() *ProductCouponScope {
313 return &e
314}
315
316const (
317 PRODUCTCOUPONSCOPE_ALL ProductCouponScope = "ALL"
318 PRODUCTCOUPONSCOPE_SINGLE ProductCouponScope = "SINGLE"
319 PRODUCTCOUPONSCOPE_CATEGORY ProductCouponScope = "CATEGORY"
320)
321
322type ProductCouponType string
323
324func (e ProductCouponType) Ptr() *ProductCouponType {
325 return &e
326}
327
328const (
329 PRODUCTCOUPONTYPE_NORMAL ProductCouponType = "NORMAL"
330 PRODUCTCOUPONTYPE_DISCOUNT ProductCouponType = "DISCOUNT"
331 PRODUCTCOUPONTYPE_EXCHANGE ProductCouponType = "EXCHANGE"
332)
333
334type UsageMode string
335
336func (e UsageMode) Ptr() *UsageMode {
337 return &e
338}
339
340const (
341 USAGEMODE_SINGLE UsageMode = "SINGLE"
342 USAGEMODE_PROGRESSIVE_BUNDLE UsageMode = "PROGRESSIVE_BUNDLE"
343)
344
345type SingleUsageInfo struct {
346 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
347 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
348}
349
350type ProgressiveBundleUsageInfo struct {
351 Count *int64 `json:"count,omitempty"`
352 IntervalDays *int64 `json:"interval_days,omitempty"`
353}
354
355type ProductCouponDisplayInfo struct {
356 Name *string `json:"name,omitempty"`
357 ImageUrl *string `json:"image_url,omitempty"`
358 BackgroundUrl *string `json:"background_url,omitempty"`
359 DetailImageUrlList []string `json:"detail_image_url_list,omitempty"`
360 OriginalPrice *int64 `json:"original_price,omitempty"`
361 ComboPackageList []ComboPackage `json:"combo_package_list,omitempty"`
362}
363
364type ProductCouponState string
365
366func (e ProductCouponState) Ptr() *ProductCouponState {
367 return &e
368}
369
370const (
371 PRODUCTCOUPONSTATE_AUDITING ProductCouponState = "AUDITING"
372 PRODUCTCOUPONSTATE_EFFECTIVE ProductCouponState = "EFFECTIVE"
373 PRODUCTCOUPONSTATE_DEACTIVATED ProductCouponState = "DEACTIVATED"
374)
375
376type CouponCodeMode string
377
378func (e CouponCodeMode) Ptr() *CouponCodeMode {
379 return &e
380}
381
382const (
383 COUPONCODEMODE_WECHATPAY CouponCodeMode = "WECHATPAY"
384 COUPONCODEMODE_UPLOAD CouponCodeMode = "UPLOAD"
385 COUPONCODEMODE_API_ASSIGN CouponCodeMode = "API_ASSIGN"
386)
387
388type CouponCodeCountInfo struct {
389 TotalCount *int64 `json:"total_count,omitempty"`
390 AvailableCount *int64 `json:"available_count,omitempty"`
391}
392
393type StockSendRule struct {
394 MaxCount *int64 `json:"max_count,omitempty"`
395 MaxCountPerDay *int64 `json:"max_count_per_day,omitempty"`
396 MaxCountPerUser *int64 `json:"max_count_per_user,omitempty"`
397}
398
399type SingleUsageRule struct {
400 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
401 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
402 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
403 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"`
404}
405
406type StockUsageRule struct {
407 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
408 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
409 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
410 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"`
411}
412
413type StockBundleInfo struct {
414 StockBundleId *string `json:"stock_bundle_id,omitempty"`
415 StockBundleIndex *int64 `json:"stock_bundle_index,omitempty"`
416}
417
418type UsageRuleDisplayInfo struct {
419 CouponUsageMethodList []CouponUsageMethod `json:"coupon_usage_method_list,omitempty"`
420 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
421 MiniProgramPath *string `json:"mini_program_path,omitempty"`
422 AppPath *string `json:"app_path,omitempty"`
423 UsageDescription *string `json:"usage_description,omitempty"`
424 CouponAvailableStoreInfo *CouponAvailableStoreInfo `json:"coupon_available_store_info,omitempty"`
425 AppJumpType *AppJumpType `json:"app_jump_type,omitempty"`
426 PasscodeLink *string `json:"passcode_link,omitempty"`
427}
428
429type CouponDisplayInfo struct {
430 CodeDisplayMode *CouponCodeDisplayMode `json:"code_display_mode,omitempty"`
431 BackgroundColor *string `json:"background_color,omitempty"`
432 EntranceMiniProgram *EntranceMiniProgram `json:"entrance_mini_program,omitempty"`
433 EntranceOfficialAccount *EntranceOfficialAccount `json:"entrance_official_account,omitempty"`
434}
435
436type NotifyConfig struct {
437 NotifyAppid *string `json:"notify_appid,omitempty"`
438}
439
440type StockStoreScope string
441
442func (e StockStoreScope) Ptr() *StockStoreScope {
443 return &e
444}
445
446const (
447 STOCKSTORESCOPE_NONE StockStoreScope = "NONE"
448 STOCKSTORESCOPE_ALL StockStoreScope = "ALL"
449 STOCKSTORESCOPE_SPECIFIC StockStoreScope = "SPECIFIC"
450)
451
452type StockSentCountInfo struct {
453 TotalCount *int64 `json:"total_count,omitempty"`
454 TodayCount *int64 `json:"today_count,omitempty"`
455}
456
457type StockState string
458
459func (e StockState) Ptr() *StockState {
460 return &e
461}
462
463const (
464 STOCKSTATE_AUDITING StockState = "AUDITING"
465 STOCKSTATE_SENDING StockState = "SENDING"
466 STOCKSTATE_PAUSED StockState = "PAUSED"
467 STOCKSTATE_STOPPED StockState = "STOPPED"
468 STOCKSTATE_DEACTIVATED StockState = "DEACTIVATED"
469)
470
471type UserProductCouponTag string
472
473func (e UserProductCouponTag) Ptr() *UserProductCouponTag {
474 return &e
475}
476
477const (
478 USERPRODUCTCOUPONTAG_MEMBER UserProductCouponTag = "MEMBER"
479 USERPRODUCTCOUPONTAG_MEMBER_ACTIVITY UserProductCouponTag = "MEMBER_ACTIVITY"
480)
481
482type MemberTagInfo struct {
483 MemberCardId *string `json:"member_card_id,omitempty"`
484}
485
486type NormalCouponUsageRule struct {
487 Threshold *int64 `json:"threshold,omitempty"`
488 DiscountAmount *int64 `json:"discount_amount,omitempty"`
489}
490
491type DiscountCouponUsageRule struct {
492 Threshold *int64 `json:"threshold,omitempty"`
493 PercentOff *int64 `json:"percent_off,omitempty"`
494}
495
496type ComboPackage struct {
497 Name *string `json:"name,omitempty"`
498 PickCount *int64 `json:"pick_count,omitempty"`
499 ChoiceList []ComboPackageChoice `json:"choice_list,omitempty"`
500}
501
502type CouponAvailablePeriod struct {
503 AvailableBeginTime *string `json:"available_begin_time,omitempty"`
504 AvailableEndTime *string `json:"available_end_time,omitempty"`
505 AvailableDays *int64 `json:"available_days,omitempty"`
506 WaitDaysAfterReceive *int64 `json:"wait_days_after_receive,omitempty"`
507 WeeklyAvailablePeriod *FixedWeekPeriod `json:"weekly_available_period,omitempty"`
508 IrregularAvailablePeriodList []TimePeriod `json:"irregular_available_period_list,omitempty"`
509 AvailableSeconds *int64 `json:"available_seconds,omitempty"`
510}
511
512type ExchangeCouponUsageRule struct {
513 Threshold *int64 `json:"threshold,omitempty"`
514 ExchangePrice *int64 `json:"exchange_price,omitempty"`
515}
516
517type CouponUsageMethod string
518
519func (e CouponUsageMethod) Ptr() *CouponUsageMethod {
520 return &e
521}
522
523const (
524 COUPONUSAGEMETHOD_OFFLINE CouponUsageMethod = "OFFLINE"
525 COUPONUSAGEMETHOD_MINI_PROGRAM CouponUsageMethod = "MINI_PROGRAM"
526 COUPONUSAGEMETHOD_APP CouponUsageMethod = "APP"
527 COUPONUSAGEMETHOD_PAYMENT_CODE CouponUsageMethod = "PAYMENT_CODE"
528)
529
530type CouponAvailableStoreInfo struct {
531 Description *string `json:"description,omitempty"`
532 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
533 MiniProgramPath *string `json:"mini_program_path,omitempty"`
534}
535
536type AppJumpType string
537
538func (e AppJumpType) Ptr() *AppJumpType {
539 return &e
540}
541
542const (
543 APPJUMPTYPE_H5 AppJumpType = "H5"
544 APPJUMPTYPE_PASSCODE_LINK AppJumpType = "PASSCODE_LINK"
545 APPJUMPTYPE_USAGE_GUIDE AppJumpType = "USAGE_GUIDE"
546)
547
548type CouponCodeDisplayMode string
549
550func (e CouponCodeDisplayMode) Ptr() *CouponCodeDisplayMode {
551 return &e
552}
553
554const (
555 COUPONCODEDISPLAYMODE_INVISIBLE CouponCodeDisplayMode = "INVISIBLE"
556 COUPONCODEDISPLAYMODE_BARCODE CouponCodeDisplayMode = "BARCODE"
557 COUPONCODEDISPLAYMODE_QRCODE CouponCodeDisplayMode = "QRCODE"
558)
559
560type EntranceMiniProgram struct {
561 Appid *string `json:"appid,omitempty"`
562 Path *string `json:"path,omitempty"`
563 EntranceWording *string `json:"entrance_wording,omitempty"`
564 GuidanceWording *string `json:"guidance_wording,omitempty"`
565}
566
567type EntranceOfficialAccount struct {
568 Appid *string `json:"appid,omitempty"`
569}
570
571type ComboPackageChoice struct {
572 Name *string `json:"name,omitempty"`
573 Price *int64 `json:"price,omitempty"`
574 Count *int64 `json:"count,omitempty"`
575 ImageUrl *string `json:"image_url,omitempty"`
576 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
577 MiniProgramPath *string `json:"mini_program_path,omitempty"`
578}
579
580type FixedWeekPeriod struct {
581 DayList []WeekEnum `json:"day_list,omitempty"`
582 DayPeriodList []PeriodOfTheDay `json:"day_period_list,omitempty"`
583}
584
585type TimePeriod struct {
586 BeginTime *string `json:"begin_time,omitempty"`
587 EndTime *string `json:"end_time,omitempty"`
588}
589
590type WeekEnum string
591
592func (e WeekEnum) Ptr() *WeekEnum {
593 return &e
594}
595
596const (
597 WEEKENUM_MONDAY WeekEnum = "MONDAY"
598 WEEKENUM_TUESDAY WeekEnum = "TUESDAY"
599 WEEKENUM_WEDNESDAY WeekEnum = "WEDNESDAY"
600 WEEKENUM_THURSDAY WeekEnum = "THURSDAY"
601 WEEKENUM_FRIDAY WeekEnum = "FRIDAY"
602 WEEKENUM_SATURDAY WeekEnum = "SATURDAY"
603 WEEKENUM_SUNDAY WeekEnum = "SUNDAY"
604)
605
606type PeriodOfTheDay struct {
607 BeginTime *int64 `json:"begin_time,omitempty"`
608 EndTime *int64 `json:"end_time,omitempty"`
609}
610