-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zsmhub
committed
Dec 2, 2024
1 parent
4e672b0
commit b44ced9
Showing
10 changed files
with
363 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package callbacks | ||
|
||
import "encoding/json" | ||
|
||
// 优惠券信息更新通知 | ||
// 文档: https://developers.weixin.qq.com/doc/channels/API/coupon/ec_callback/channels_ec_coupon_info_change.html | ||
|
||
func init() { | ||
//添加可解析的回调事件 | ||
supportCallback(ChannelsEcCouponInfoChange{}) | ||
} | ||
|
||
type ChannelsEcCouponInfoChange struct { | ||
CreateTime int `json:"CreateTime"` | ||
Event string `json:"Event"` | ||
FromUserName string `json:"FromUserName"` | ||
MsgType string `json:"MsgType"` | ||
ToUserName string `json:"ToUserName"` | ||
CouponInfo struct { | ||
ChangeTime string `json:"change_time"` | ||
CouponID string `json:"coupon_id"` | ||
} `json:"coupon_info"` | ||
} | ||
|
||
func (ChannelsEcCouponInfoChange) GetMessageType() string { | ||
return "event" | ||
} | ||
|
||
func (ChannelsEcCouponInfoChange) GetEventType() string { | ||
return "channels_ec_coupon_info_change" | ||
} | ||
|
||
func (m ChannelsEcCouponInfoChange) GetTypeKey() string { | ||
return m.GetMessageType() + ":" + m.GetEventType() | ||
} | ||
|
||
func (ChannelsEcCouponInfoChange) ParseFromJson(data []byte) (CallbackExtraInfoInterface, error) { | ||
var temp ChannelsEcCouponInfoChange | ||
err := json.Unmarshal(data, &temp) | ||
return temp, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package callbacks | ||
|
||
import "encoding/json" | ||
|
||
// 优惠券核销通知 | ||
// 文档: https://developers.weixin.qq.com/doc/channels/API/coupon/ec_callback/channels_ec_user_coupon_use.html | ||
|
||
func init() { | ||
//添加可解析的回调事件 | ||
supportCallback(ChannelsEcUserCouponUse{}) | ||
} | ||
|
||
type ChannelsEcUserCouponUse struct { | ||
CreateTime int `json:"CreateTime"` | ||
Event string `json:"Event"` | ||
FromUserName string `json:"FromUserName"` | ||
MsgType string `json:"MsgType"` | ||
ToUserName string `json:"ToUserName"` | ||
UseInfo struct { | ||
CouponID string `json:"coupon_id"` | ||
OrderID string `json:"order_id"` | ||
UseTime string `json:"use_time"` | ||
UserCouponID string `json:"user_coupon_id"` | ||
} `json:"use_info"` | ||
} | ||
|
||
func (ChannelsEcUserCouponUse) GetMessageType() string { | ||
return "event" | ||
} | ||
|
||
func (ChannelsEcUserCouponUse) GetEventType() string { | ||
return "channels_ec_user_coupon_use" | ||
} | ||
|
||
func (m ChannelsEcUserCouponUse) GetTypeKey() string { | ||
return m.GetMessageType() + ":" + m.GetEventType() | ||
} | ||
|
||
func (ChannelsEcUserCouponUse) ParseFromJson(data []byte) (CallbackExtraInfoInterface, error) { | ||
var temp ChannelsEcUserCouponUse | ||
err := json.Unmarshal(data, &temp) | ||
return temp, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package callbacks | ||
|
||
import "encoding/json" | ||
|
||
// 优惠券过期通知 | ||
// 文档: https://developers.weixin.qq.com/doc/channels/API/coupon/ec_callback/channels_ec_coupon_expire.html | ||
|
||
func init() { | ||
//添加可解析的回调事件 | ||
supportCallback(ChannelsEcCouponExpire{}) | ||
} | ||
|
||
type ChannelsEcCouponExpire struct { | ||
CreateTime int `json:"CreateTime"` | ||
Event string `json:"Event"` | ||
FromUserName string `json:"FromUserName"` | ||
MsgType string `json:"MsgType"` | ||
ToUserName string `json:"ToUserName"` | ||
CouponInfo struct { | ||
CouponID string `json:"coupon_id"` | ||
ExpireTime string `json:"expire_time"` | ||
} `json:"coupon_info"` | ||
} | ||
|
||
func (ChannelsEcCouponExpire) GetMessageType() string { | ||
return "event" | ||
} | ||
|
||
func (ChannelsEcCouponExpire) GetEventType() string { | ||
return "channels_ec_coupon_expire" | ||
} | ||
|
||
func (m ChannelsEcCouponExpire) GetTypeKey() string { | ||
return m.GetMessageType() + ":" + m.GetEventType() | ||
} | ||
|
||
func (ChannelsEcCouponExpire) ParseFromJson(data []byte) (CallbackExtraInfoInterface, error) { | ||
var temp ChannelsEcCouponExpire | ||
err := json.Unmarshal(data, &temp) | ||
return temp, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package callbacks | ||
|
||
import "encoding/json" | ||
|
||
// 优惠券返还通知 | ||
// 文档: https://developers.weixin.qq.com/doc/channels/API/coupon/ec_callback/channels_ec_user_coupon_unuse.html | ||
|
||
func init() { | ||
//添加可解析的回调事件 | ||
supportCallback(ChannelsEcUserCouponUnuse{}) | ||
} | ||
|
||
type ChannelsEcUserCouponUnuse struct { | ||
CreateTime int `json:"CreateTime"` | ||
Event string `json:"Event"` | ||
FromUserName string `json:"FromUserName"` | ||
MsgType string `json:"MsgType"` | ||
ToUserName string `json:"ToUserName"` | ||
UseInfo struct { | ||
CouponID string `json:"coupon_id"` | ||
OrderID string `json:"order_id"` | ||
UnuseTime string `json:"unuse_time"` | ||
UserCouponID string `json:"user_coupon_id"` | ||
} `json:"use_info"` | ||
} | ||
|
||
func (ChannelsEcUserCouponUnuse) GetMessageType() string { | ||
return "event" | ||
} | ||
|
||
func (ChannelsEcUserCouponUnuse) GetEventType() string { | ||
return "channels_ec_user_coupon_unuse" | ||
} | ||
|
||
func (m ChannelsEcUserCouponUnuse) GetTypeKey() string { | ||
return m.GetMessageType() + ":" + m.GetEventType() | ||
} | ||
|
||
func (ChannelsEcUserCouponUnuse) ParseFromJson(data []byte) (CallbackExtraInfoInterface, error) { | ||
var temp ChannelsEcUserCouponUnuse | ||
err := json.Unmarshal(data, &temp) | ||
return temp, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package callbacks | ||
|
||
import "encoding/json" | ||
|
||
// 作废优惠券通知 | ||
// 文档: https://developers.weixin.qq.com/doc/channels/API/coupon/ec_callback/channels_ec_coupon_invalid.html | ||
|
||
func init() { | ||
//添加可解析的回调事件 | ||
supportCallback(ChannelsEcCouponInvalid{}) | ||
} | ||
|
||
type ChannelsEcCouponInvalid struct { | ||
CreateTime int `json:"CreateTime"` | ||
Event string `json:"Event"` | ||
FromUserName string `json:"FromUserName"` | ||
MsgType string `json:"MsgType"` | ||
ToUserName string `json:"ToUserName"` | ||
CouponInfo struct { | ||
CouponID string `json:"coupon_id"` | ||
InvalidTime string `json:"invalid_time"` | ||
} `json:"coupon_info"` | ||
} | ||
|
||
func (ChannelsEcCouponInvalid) GetMessageType() string { | ||
return "event" | ||
} | ||
|
||
func (ChannelsEcCouponInvalid) GetEventType() string { | ||
return "channels_ec_coupon_invalid" | ||
} | ||
|
||
func (m ChannelsEcCouponInvalid) GetTypeKey() string { | ||
return m.GetMessageType() + ":" + m.GetEventType() | ||
} | ||
|
||
func (ChannelsEcCouponInvalid) ParseFromJson(data []byte) (CallbackExtraInfoInterface, error) { | ||
var temp ChannelsEcCouponInvalid | ||
err := json.Unmarshal(data, &temp) | ||
return temp, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package callbacks | ||
|
||
import "encoding/json" | ||
|
||
// 创建优惠券通知 | ||
// 文档: https://developers.weixin.qq.com/doc/channels/API/coupon/ec_callback/channels_ec_coupon_create.html | ||
|
||
func init() { | ||
//添加可解析的回调事件 | ||
supportCallback(ChannelsEcCouponCreate{}) | ||
} | ||
|
||
type ChannelsEcCouponCreate struct { | ||
CreateTime int `json:"CreateTime"` | ||
Event string `json:"Event"` | ||
FromUserName string `json:"FromUserName"` | ||
MsgType string `json:"MsgType"` | ||
ToUserName string `json:"ToUserName"` | ||
CouponInfo struct { | ||
CouponID string `json:"coupon_id"` | ||
CreateTime string `json:"create_time"` | ||
} `json:"coupon_info"` | ||
} | ||
|
||
func (ChannelsEcCouponCreate) GetMessageType() string { | ||
return "event" | ||
} | ||
|
||
func (ChannelsEcCouponCreate) GetEventType() string { | ||
return "channels_ec_coupon_create" | ||
} | ||
|
||
func (m ChannelsEcCouponCreate) GetTypeKey() string { | ||
return m.GetMessageType() + ":" + m.GetEventType() | ||
} | ||
|
||
func (ChannelsEcCouponCreate) ParseFromJson(data []byte) (CallbackExtraInfoInterface, error) { | ||
var temp ChannelsEcCouponCreate | ||
err := json.Unmarshal(data, &temp) | ||
return temp, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package callbacks | ||
|
||
import "encoding/json" | ||
|
||
// 删除优惠券通知 | ||
// 文档: https://developers.weixin.qq.com/doc/channels/API/coupon/ec_callback/channels_ec_coupon_delete.html | ||
|
||
func init() { | ||
//添加可解析的回调事件 | ||
supportCallback(ChannelsEcCouponDelete{}) | ||
} | ||
|
||
type ChannelsEcCouponDelete struct { | ||
CreateTime int `json:"CreateTime"` | ||
Event string `json:"Event"` | ||
FromUserName string `json:"FromUserName"` | ||
MsgType string `json:"MsgType"` | ||
ToUserName string `json:"ToUserName"` | ||
CouponInfo struct { | ||
CouponID string `json:"coupon_id"` | ||
DeleteTime string `json:"delete_time"` | ||
} `json:"coupon_info"` | ||
} | ||
|
||
func (ChannelsEcCouponDelete) GetMessageType() string { | ||
return "event" | ||
} | ||
|
||
func (ChannelsEcCouponDelete) GetEventType() string { | ||
return "channels_ec_coupon_delete" | ||
} | ||
|
||
func (m ChannelsEcCouponDelete) GetTypeKey() string { | ||
return m.GetMessageType() + ":" + m.GetEventType() | ||
} | ||
|
||
func (ChannelsEcCouponDelete) ParseFromJson(data []byte) (CallbackExtraInfoInterface, error) { | ||
var temp ChannelsEcCouponDelete | ||
err := json.Unmarshal(data, &temp) | ||
return temp, err | ||
} |
Oops, something went wrong.