
1package main
2
3import (
4 "bytes"
5 "demo/wxpay_brand_utility"
6 "encoding/json"
7 "fmt"
8 "net/http"
9 "net/url"
10 "time"
11)
12
13func main() {
14
15 config, err := wxpay_brand_utility.CreateBrandConfig(
16 "xxxxxxxx",
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 := &CreateProductCouponRequest{
28 OutRequestNo: wxpay_brand_utility.String("12345_20250101_A3489"),
29 Scope: PRODUCTCOUPONSCOPE_ALL.Ptr(),
30 Type: PRODUCTCOUPONTYPE_DISCOUNT.Ptr(),
31 UsageMode: USAGEMODE_PROGRESSIVE_BUNDLE.Ptr(),
32
33 ProgressiveBundleUsageInfo: &ProgressiveBundleUsageInfo{
34 Count: wxpay_brand_utility.Int64(3),
35 IntervalDays: wxpay_brand_utility.Int64(1),
36 },
37
38 DisplayInfo: &ProductCouponDisplayInfo{
39 Name: wxpay_brand_utility.String("全场多次折扣券"),
40 ImageUrl: wxpay_brand_utility.String("https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"),
41 BackgroundUrl: wxpay_brand_utility.String("https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"),
42 DetailImageUrlList: []string{
43 "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx",
44 },
45 },
46 OutProductNo: wxpay_brand_utility.String("Product_1234567890"),
47
48 StockBundle: &StockBundleForCreate{
49 Remark: wxpay_brand_utility.String("8月工作日有效批次"),
50 CouponCodeMode: COUPONCODEMODE_UPLOAD.Ptr(),
51 StockSendRule: &StockSendRuleForBundle{
52 MaxCount: wxpay_brand_utility.Int64(10000000),
53 MaxCountPerUser: wxpay_brand_utility.Int64(1),
54 },
55
56 ProgressiveBundleUsageRule: &StockBundleUsageRule{
57 CouponAvailablePeriod: &CouponAvailablePeriod{
58 AvailableBeginTime: wxpay_brand_utility.String("2025-08-01T00:00:00+08:00"),
59 AvailableEndTime: wxpay_brand_utility.String("2025-08-31T23:59:59+08:00"),
60 AvailableDays: wxpay_brand_utility.Int64(30),
61 WeeklyAvailablePeriod: &FixedWeekPeriod{
62 DayList: []WeekEnum{
63 WEEKENUM_MONDAY,
64 WEEKENUM_TUESDAY,
65 WEEKENUM_WEDNESDAY,
66 WEEKENUM_THURSDAY,
67 WEEKENUM_FRIDAY,
68 },
69 },
70 },
71
72 DiscountCouponList: []DiscountCouponUsageRule{
73 {
74 Threshold: wxpay_brand_utility.Int64(10000),
75 PercentOff: wxpay_brand_utility.Int64(50),
76 },
77 {
78 Threshold: wxpay_brand_utility.Int64(10000),
79 PercentOff: wxpay_brand_utility.Int64(20),
80 },
81 {
82 Threshold: wxpay_brand_utility.Int64(10000),
83 PercentOff: wxpay_brand_utility.Int64(30),
84 },
85 },
86 },
87
88 UsageRuleDisplayInfo: &UsageRuleDisplayInfo{
89 CouponUsageMethodList: []CouponUsageMethod{
90 COUPONUSAGEMETHOD_OFFLINE,
91 COUPONUSAGEMETHOD_MINI_PROGRAM,
92 COUPONUSAGEMETHOD_PAYMENT_CODE,
93 },
94 MiniProgramAppid: wxpay_brand_utility.String("wx1234567890"),
95 MiniProgramPath: wxpay_brand_utility.String("/pages/index/product"),
96 UsageDescription: wxpay_brand_utility.String("工作日可用"),
97 CouponAvailableStoreInfo: &CouponAvailableStoreInfo{
98 Description: wxpay_brand_utility.String("所有门店可用,可使用小程序查看门店列表"),
99 MiniProgramAppid: wxpay_brand_utility.String("wx1234567890"),
100 MiniProgramPath: wxpay_brand_utility.String("/pages/index/store-list"),
101 },
102 },
103
104 CouponDisplayInfo: &CouponDisplayInfo{
105 CodeDisplayMode: COUPONCODEDISPLAYMODE_QRCODE.Ptr(),
106 BackgroundColor: wxpay_brand_utility.String("Color010"),
107 EntranceMiniProgram: &EntranceMiniProgram{
108 Appid: wxpay_brand_utility.String("wx1234567890"),
109 Path: wxpay_brand_utility.String("/pages/index/product"),
110 EntranceWording: wxpay_brand_utility.String("欢迎选购"),
111 GuidanceWording: wxpay_brand_utility.String("获取更多优惠"),
112 },
113 EntranceOfficialAccount: &EntranceOfficialAccount{
114 Appid: wxpay_brand_utility.String("wx1234567890"),
115 },
116 EntranceFinder: &EntranceFinder{
117 FinderId: wxpay_brand_utility.String("gh_12345678"),
118 FinderVideoId: wxpay_brand_utility.String("UDFsdf24df34dD456Hdf34"),
119 FinderVideoCoverImageUrl: wxpay_brand_utility.String("https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"),
120 },
121 },
122 StoreScope: STOCKSTORESCOPE_NONE.Ptr(),
123 NotifyConfig: &NotifyConfig{
124 NotifyAppid: wxpay_brand_utility.String("wx4fd12345678"),
125 },
126 },
127 }
128
129 response, err := CreateProductCoupon(config, request)
130 if err != nil {
131 fmt.Printf("请求失败: %+v\n", err)
132
133 return
134 }
135
136
137 fmt.Printf("请求成功: %+v\n", response)
138}
139
140func CreateProductCoupon(config *wxpay_brand_utility.BrandConfig, request *CreateProductCouponRequest) (response *CreateProductCouponResponse, err error) {
141 const (
142 host = "https://api.mch.weixin.qq.com"
143 method = "POST"
144 path = "/brand/marketing/product-coupon/product-coupons"
145 )
146
147 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path))
148 if err != nil {
149 return nil, err
150 }
151 reqBody, err := json.Marshal(request)
152 if err != nil {
153 return nil, err
154 }
155 httpRequest, err := http.NewRequest(method, reqUrl.String(), bytes.NewReader(reqBody))
156 if err != nil {
157 return nil, err
158 }
159 httpRequest.Header.Set("Accept", "application/json")
160 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId())
161 httpRequest.Header.Set("Content-Type", "application/json")
162 authorization, err := wxpay_brand_utility.BuildAuthorization(config.BrandId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), reqBody)
163 if err != nil {
164 return nil, err
165 }
166 httpRequest.Header.Set("Authorization", authorization)
167
168 client := &http.Client{}
169 httpResponse, err := client.Do(httpRequest)
170 if err != nil {
171 return nil, err
172 }
173 respBody, err := wxpay_brand_utility.ExtractResponseBody(httpResponse)
174 if err != nil {
175 return nil, err
176 }
177 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 {
178
179 err = wxpay_brand_utility.ValidateResponse(
180 config.WechatPayPublicKeyId(),
181 config.WechatPayPublicKey(),
182 &httpResponse.Header,
183 respBody,
184 )
185 if err != nil {
186 return nil, err
187 }
188 response := &CreateProductCouponResponse{}
189 if err := json.Unmarshal(respBody, response); err != nil {
190 return nil, err
191 }
192
193 return response, nil
194 } else {
195 return nil, wxpay_brand_utility.NewApiException(
196 httpResponse.StatusCode,
197 httpResponse.Header,
198 respBody,
199 )
200 }
201}
202
203type CreateProductCouponRequest struct {
204 OutRequestNo *string `json:"out_request_no,omitempty"`
205 Scope *ProductCouponScope `json:"scope,omitempty"`
206 Type *ProductCouponType `json:"type,omitempty"`
207 UsageMode *UsageMode `json:"usage_mode,omitempty"`
208 SingleUsageInfo *SingleUsageInfo `json:"single_usage_info,omitempty"`
209 ProgressiveBundleUsageInfo *ProgressiveBundleUsageInfo `json:"progressive_bundle_usage_info,omitempty"`
210 DisplayInfo *ProductCouponDisplayInfo `json:"display_info,omitempty"`
211 OutProductNo *string `json:"out_product_no,omitempty"`
212 Stock *StockForCreate `json:"stock,omitempty"`
213 StockBundle *StockBundleForCreate `json:"stock_bundle,omitempty"`
214}
215
216type CreateProductCouponResponse struct {
217 ProductCouponId *string `json:"product_coupon_id,omitempty"`
218 Scope *ProductCouponScope `json:"scope,omitempty"`
219 Type *ProductCouponType `json:"type,omitempty"`
220 UsageMode *UsageMode `json:"usage_mode,omitempty"`
221 SingleUsageInfo *SingleUsageInfo `json:"single_usage_info,omitempty"`
222 ProgressiveBundleUsageInfo *ProgressiveBundleUsageInfo `json:"progressive_bundle_usage_info,omitempty"`
223 DisplayInfo *ProductCouponDisplayInfo `json:"display_info,omitempty"`
224 OutProductNo *string `json:"out_product_no,omitempty"`
225 State *ProductCouponState `json:"state,omitempty"`
226 Stock *StockEntity `json:"stock,omitempty"`
227 StockBundle *StockBundleEntity `json:"stock_bundle,omitempty"`
228}
229
230type ProductCouponScope string
231
232func (e ProductCouponScope) Ptr() *ProductCouponScope {
233 return &e
234}
235
236const (
237 PRODUCTCOUPONSCOPE_ALL ProductCouponScope = "ALL"
238 PRODUCTCOUPONSCOPE_SINGLE ProductCouponScope = "SINGLE"
239)
240
241type ProductCouponType string
242
243func (e ProductCouponType) Ptr() *ProductCouponType {
244 return &e
245}
246
247const (
248 PRODUCTCOUPONTYPE_NORMAL ProductCouponType = "NORMAL"
249 PRODUCTCOUPONTYPE_DISCOUNT ProductCouponType = "DISCOUNT"
250 PRODUCTCOUPONTYPE_EXCHANGE ProductCouponType = "EXCHANGE"
251)
252
253type UsageMode string
254
255func (e UsageMode) Ptr() *UsageMode {
256 return &e
257}
258
259const (
260 USAGEMODE_SINGLE UsageMode = "SINGLE"
261 USAGEMODE_PROGRESSIVE_BUNDLE UsageMode = "PROGRESSIVE_BUNDLE"
262)
263
264type SingleUsageInfo struct {
265 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
266 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
267}
268
269type ProgressiveBundleUsageInfo struct {
270 Count *int64 `json:"count,omitempty"`
271 IntervalDays *int64 `json:"interval_days,omitempty"`
272}
273
274type ProductCouponDisplayInfo struct {
275 Name *string `json:"name,omitempty"`
276 ImageUrl *string `json:"image_url,omitempty"`
277 BackgroundUrl *string `json:"background_url,omitempty"`
278 DetailImageUrlList []string `json:"detail_image_url_list,omitempty"`
279 OriginalPrice *int64 `json:"original_price,omitempty"`
280 ComboPackageList []ComboPackage `json:"combo_package_list,omitempty"`
281}
282
283type StockForCreate struct {
284 Remark *string `json:"remark,omitempty"`
285 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
286 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"`
287 SingleUsageRule *SingleUsageRule `json:"single_usage_rule,omitempty"`
288 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
289 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
290 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
291 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
292}
293
294type StockBundleForCreate struct {
295 Remark *string `json:"remark,omitempty"`
296 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
297 StockSendRule *StockSendRuleForBundle `json:"stock_send_rule,omitempty"`
298 ProgressiveBundleUsageRule *StockBundleUsageRule `json:"progressive_bundle_usage_rule,omitempty"`
299 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
300 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
301 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
302 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
303}
304
305type ProductCouponState string
306
307func (e ProductCouponState) Ptr() *ProductCouponState {
308 return &e
309}
310
311const (
312 PRODUCTCOUPONSTATE_AUDITING ProductCouponState = "AUDITING"
313 PRODUCTCOUPONSTATE_EFFECTIVE ProductCouponState = "EFFECTIVE"
314 PRODUCTCOUPONSTATE_DEACTIVATED ProductCouponState = "DEACTIVATED"
315)
316
317type StockEntity struct {
318 ProductCouponId *string `json:"product_coupon_id,omitempty"`
319 StockId *string `json:"stock_id,omitempty"`
320 Remark *string `json:"remark,omitempty"`
321 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
322 CouponCodeCountInfo *CouponCodeCountInfo `json:"coupon_code_count_info,omitempty"`
323 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"`
324 SingleUsageRule *SingleUsageRule `json:"single_usage_rule,omitempty"`
325 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
326 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
327 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
328 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
329 SentCountInfo *StockSentCountInfo `json:"sent_count_info,omitempty"`
330 State *StockState `json:"state,omitempty"`
331 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
332 DeactivateTime *time.Time `json:"deactivate_time,omitempty"`
333 DeactivateReason *string `json:"deactivate_reason,omitempty"`
334}
335
336type StockBundleEntity struct {
337 StockBundleId *string `json:"stock_bundle_id,omitempty"`
338 StockList []StockEntityInBundle `json:"stock_list,omitempty"`
339}
340
341type NormalCouponUsageRule struct {
342 Threshold *int64 `json:"threshold,omitempty"`
343 DiscountAmount *int64 `json:"discount_amount,omitempty"`
344}
345
346type DiscountCouponUsageRule struct {
347 Threshold *int64 `json:"threshold,omitempty"`
348 PercentOff *int64 `json:"percent_off,omitempty"`
349}
350
351type ComboPackage struct {
352 Name *string `json:"name,omitempty"`
353 PickCount *int64 `json:"pick_count,omitempty"`
354 ChoiceList []ComboPackageChoice `json:"choice_list,omitempty"`
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 StockSendRule struct {
370 MaxCount *int64 `json:"max_count,omitempty"`
371 MaxCountPerDay *int64 `json:"max_count_per_day,omitempty"`
372 MaxCountPerUser *int64 `json:"max_count_per_user,omitempty"`
373}
374
375type SingleUsageRule struct {
376 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
377 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
378 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
379 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,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}
390
391type CouponDisplayInfo struct {
392 CodeDisplayMode *CouponCodeDisplayMode `json:"code_display_mode,omitempty"`
393 BackgroundColor *string `json:"background_color,omitempty"`
394 EntranceMiniProgram *EntranceMiniProgram `json:"entrance_mini_program,omitempty"`
395 EntranceOfficialAccount *EntranceOfficialAccount `json:"entrance_official_account,omitempty"`
396 EntranceFinder *EntranceFinder `json:"entrance_finder,omitempty"`
397}
398
399type NotifyConfig struct {
400 NotifyAppid *string `json:"notify_appid,omitempty"`
401}
402
403type StockStoreScope string
404
405func (e StockStoreScope) Ptr() *StockStoreScope {
406 return &e
407}
408
409const (
410 STOCKSTORESCOPE_NONE StockStoreScope = "NONE"
411 STOCKSTORESCOPE_ALL StockStoreScope = "ALL"
412 STOCKSTORESCOPE_SPECIFIC StockStoreScope = "SPECIFIC"
413)
414
415type StockSendRuleForBundle struct {
416 MaxCount *int64 `json:"max_count,omitempty"`
417 MaxCountPerDay *int64 `json:"max_count_per_day,omitempty"`
418 MaxCountPerUser *int64 `json:"max_count_per_user,omitempty"`
419}
420
421type StockBundleUsageRule struct {
422 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
423 NormalCouponList []NormalCouponUsageRule `json:"normal_coupon_list,omitempty"`
424 DiscountCouponList []DiscountCouponUsageRule `json:"discount_coupon_list,omitempty"`
425 ExchangeCouponList []ExchangeCouponUsageRule `json:"exchange_coupon_list,omitempty"`
426}
427
428type CouponCodeCountInfo struct {
429 TotalCount *int64 `json:"total_count,omitempty"`
430 AvailableCount *int64 `json:"available_count,omitempty"`
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 StockEntityInBundle struct {
453 ProductCouponId *string `json:"product_coupon_id,omitempty"`
454 StockId *string `json:"stock_id,omitempty"`
455 Remark *string `json:"remark,omitempty"`
456 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
457 CouponCodeCountInfo *CouponCodeCountInfo `json:"coupon_code_count_info,omitempty"`
458 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"`
459 ProgressiveBundleUsageRule *StockUsageRule `json:"progressive_bundle_usage_rule,omitempty"`
460 StockBundleInfo *StockBundleInfo `json:"stock_bundle_info,omitempty"`
461 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
462 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
463 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
464 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
465 SentCountInfo *StockSentCountInfo `json:"sent_count_info,omitempty"`
466 State *StockState `json:"state,omitempty"`
467 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
468 DeactivateTime *time.Time `json:"deactivate_time,omitempty"`
469 DeactivateReason *string `json:"deactivate_reason,omitempty"`
470}
471
472type ComboPackageChoice struct {
473 Name *string `json:"name,omitempty"`
474 Price *int64 `json:"price,omitempty"`
475 Count *int64 `json:"count,omitempty"`
476 ImageUrl *string `json:"image_url,omitempty"`
477 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
478 MiniProgramPath *string `json:"mini_program_path,omitempty"`
479}
480
481type CouponAvailablePeriod struct {
482 AvailableBeginTime *string `json:"available_begin_time,omitempty"`
483 AvailableEndTime *string `json:"available_end_time,omitempty"`
484 AvailableDays *int64 `json:"available_days,omitempty"`
485 WaitDaysAfterReceive *int64 `json:"wait_days_after_receive,omitempty"`
486 WeeklyAvailablePeriod *FixedWeekPeriod `json:"weekly_available_period,omitempty"`
487 IrregularAvailablePeriodList []TimePeriod `json:"irregular_available_period_list,omitempty"`
488}
489
490type ExchangeCouponUsageRule struct {
491 Threshold *int64 `json:"threshold,omitempty"`
492 ExchangePrice *int64 `json:"exchange_price,omitempty"`
493}
494
495type CouponUsageMethod string
496
497func (e CouponUsageMethod) Ptr() *CouponUsageMethod {
498 return &e
499}
500
501const (
502 COUPONUSAGEMETHOD_OFFLINE CouponUsageMethod = "OFFLINE"
503 COUPONUSAGEMETHOD_MINI_PROGRAM CouponUsageMethod = "MINI_PROGRAM"
504 COUPONUSAGEMETHOD_APP CouponUsageMethod = "APP"
505 COUPONUSAGEMETHOD_PAYMENT_CODE CouponUsageMethod = "PAYMENT_CODE"
506)
507
508type CouponAvailableStoreInfo struct {
509 Description *string `json:"description,omitempty"`
510 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
511 MiniProgramPath *string `json:"mini_program_path,omitempty"`
512}
513
514type CouponCodeDisplayMode string
515
516func (e CouponCodeDisplayMode) Ptr() *CouponCodeDisplayMode {
517 return &e
518}
519
520const (
521 COUPONCODEDISPLAYMODE_INVISIBLE CouponCodeDisplayMode = "INVISIBLE"
522 COUPONCODEDISPLAYMODE_BARCODE CouponCodeDisplayMode = "BARCODE"
523 COUPONCODEDISPLAYMODE_QRCODE CouponCodeDisplayMode = "QRCODE"
524)
525
526type EntranceMiniProgram struct {
527 Appid *string `json:"appid,omitempty"`
528 Path *string `json:"path,omitempty"`
529 EntranceWording *string `json:"entrance_wording,omitempty"`
530 GuidanceWording *string `json:"guidance_wording,omitempty"`
531}
532
533type EntranceOfficialAccount struct {
534 Appid *string `json:"appid,omitempty"`
535}
536
537type EntranceFinder struct {
538 FinderId *string `json:"finder_id,omitempty"`
539 FinderVideoId *string `json:"finder_video_id,omitempty"`
540 FinderVideoCoverImageUrl *string `json:"finder_video_cover_image_url,omitempty"`
541}
542
543type StockUsageRule struct {
544 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
545 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
546 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
547 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"`
548}
549
550type StockBundleInfo struct {
551 StockBundleId *string `json:"stock_bundle_id,omitempty"`
552 StockBundleIndex *int64 `json:"stock_bundle_index,omitempty"`
553}
554
555type FixedWeekPeriod struct {
556 DayList []WeekEnum `json:"day_list,omitempty"`
557 DayPeriodList []PeriodOfTheDay `json:"day_period_list,omitempty"`
558}
559
560type TimePeriod struct {
561 BeginTime *string `json:"begin_time,omitempty"`
562 EndTime *string `json:"end_time,omitempty"`
563}
564
565type WeekEnum string
566
567func (e WeekEnum) Ptr() *WeekEnum {
568 return &e
569}
570
571const (
572 WEEKENUM_MONDAY WeekEnum = "MONDAY"
573 WEEKENUM_TUESDAY WeekEnum = "TUESDAY"
574 WEEKENUM_WEDNESDAY WeekEnum = "WEDNESDAY"
575 WEEKENUM_THURSDAY WeekEnum = "THURSDAY"
576 WEEKENUM_FRIDAY WeekEnum = "FRIDAY"
577 WEEKENUM_SATURDAY WeekEnum = "SATURDAY"
578 WEEKENUM_SUNDAY WeekEnum = "SUNDAY"
579)
580
581type PeriodOfTheDay struct {
582 BeginTime *int64 `json:"begin_time,omitempty"`
583 EndTime *int64 `json:"end_time,omitempty"`
584}
585