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