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