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