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