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