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