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