Skip to content

Commit

Permalink
新增2023/08/02企微更新内容
Browse files Browse the repository at this point in the history
  • Loading branch information
zsmhub committed Sep 15, 2023
1 parent b6dfc7a commit ccd05e4
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 6 deletions.
15 changes: 9 additions & 6 deletions apis/收银台-创建收款订单.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ import (

type (
ReqOpenOrderPaytool struct {
BusinessType int `json:"business_type"`
CustomCorpid string `json:"custom_corpid,omitempty"`
ProductList PaytoolProductList `json:"product_list"`
NonceStr string `json:"nonce_str"`
Ts int `json:"ts"`
Sig string `json:"sig"`
BusinessType int `json:"business_type"`
PayType int `json:"pay_type"`
BankReceiptMediaId string `json:"bank_receipt_media_id,omitempty"`
Creator string `json:"creator,omitempty"`
CustomCorpid string `json:"custom_corpid,omitempty"`
ProductList PaytoolProductList `json:"product_list"`
NonceStr string `json:"nonce_str"`
Ts int `json:"ts"`
Sig string `json:"sig"`
}

PaytoolProductList struct {
Expand Down
5 changes: 5 additions & 0 deletions apis/获客助手-查询剩余使用量.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ type RespCustomerAcquisitionQuotaExternalcontact struct {
CommonResp
// Total 历史累计使用量
Total int `json:"total"`
// QuotaList 过期额度
QuotaList []struct {
ExpireDate int `json:"expire_date"`
Balance int `json:"balance"`
} `json:"quota_list"`
}

var _ bodyer = RespCustomerAcquisitionQuotaExternalcontact{}
Expand Down
56 changes: 56 additions & 0 deletions callbacks/event使用量已经耗尽事件.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package callbacks

import "encoding/xml"

// 自动生成的回调结构,按需修改, 生成方式: make callback doc=微信文档地址url
// 文档: https://developer.work.weixin.qq.com/document/path/97299#使用量已经耗尽事件

func init() {
//添加可解析的回调事件
supportCallback(EventCustomerAcquisitionBalanceExhausted{})
}

type EventCustomerAcquisitionBalanceExhausted struct {
XMLName xml.Name `xml:"xml"`
Text string `xml:",chardata"`
ToUserName struct {
Text string `xml:",chardata"`
} `xml:"ToUserName"`
FromUserName struct {
Text string `xml:",chardata"`
} `xml:"FromUserName"`
CreateTime struct {
Text string `xml:",chardata"`
} `xml:"CreateTime"`
MsgType struct {
Text string `xml:",chardata"`
} `xml:"MsgType"`
Event struct {
Text string `xml:",chardata"`
} `xml:"Event"`
ChangeType struct {
Text string `xml:",chardata"`
} `xml:"ChangeType"`
}

func (EventCustomerAcquisitionBalanceExhausted) GetMessageType() string {
return "event"
}

func (EventCustomerAcquisitionBalanceExhausted) GetEventType() string {
return "customer_acquisition"
}

func (EventCustomerAcquisitionBalanceExhausted) GetChangeType() string {
return "balance_exhausted"
}

func (m EventCustomerAcquisitionBalanceExhausted) GetTypeKey() string {
return m.GetMessageType() + ":" + m.GetEventType() + ":" + m.GetChangeType()
}

func (EventCustomerAcquisitionBalanceExhausted) ParseFromXml(data []byte) (CallBackExtraInfoInterface, error) {
var temp EventCustomerAcquisitionBalanceExhausted
err := xml.Unmarshal(data, &temp)
return temp, err
}
59 changes: 59 additions & 0 deletions callbacks/event删除获客链接事件.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package callbacks

import "encoding/xml"

// 自动生成的回调结构,按需修改, 生成方式: make callback doc=微信文档地址url
// 文档: https://developer.work.weixin.qq.com/document/path/97299#删除获客链接事件

func init() {
//添加可解析的回调事件
supportCallback(EventCustomerAcquisitionDeleteLink{})
}

type EventCustomerAcquisitionDeleteLink struct {
XMLName xml.Name `xml:"xml"`
Text string `xml:",chardata"`
ToUserName struct {
Text string `xml:",chardata"`
} `xml:"ToUserName"`
FromUserName struct {
Text string `xml:",chardata"`
} `xml:"FromUserName"`
CreateTime struct {
Text string `xml:",chardata"`
} `xml:"CreateTime"`
MsgType struct {
Text string `xml:",chardata"`
} `xml:"MsgType"`
Event struct {
Text string `xml:",chardata"`
} `xml:"Event"`
ChangeType struct {
Text string `xml:",chardata"`
} `xml:"ChangeType"`
LinkId struct {
Text string `xml:",chardata"`
} `xml:"LinkId"`
}

func (EventCustomerAcquisitionDeleteLink) GetMessageType() string {
return "event"
}

func (EventCustomerAcquisitionDeleteLink) GetEventType() string {
return "customer_acquisition"
}

func (EventCustomerAcquisitionDeleteLink) GetChangeType() string {
return "delete_link"
}

func (m EventCustomerAcquisitionDeleteLink) GetTypeKey() string {
return m.GetMessageType() + ":" + m.GetEventType() + ":" + m.GetChangeType()
}

func (EventCustomerAcquisitionDeleteLink) ParseFromXml(data []byte) (CallBackExtraInfoInterface, error) {
var temp EventCustomerAcquisitionDeleteLink
err := xml.Unmarshal(data, &temp)
return temp, err
}
62 changes: 62 additions & 0 deletions callbacks/event微信客户发起会话事件.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package callbacks

import "encoding/xml"

// 自动生成的回调结构,按需修改, 生成方式: make callback doc=微信文档地址url
// 文档: https://developer.work.weixin.qq.com/document/path/97299#微信客户发起会话事件

func init() {
//添加可解析的回调事件
supportCallback(EventCustomerAcquisitionCustomerStartChat{})
}

type EventCustomerAcquisitionCustomerStartChat struct {
XMLName xml.Name `xml:"xml"`
Text string `xml:",chardata"`
ToUserName struct {
Text string `xml:",chardata"`
} `xml:"ToUserName"`
FromUserName struct {
Text string `xml:",chardata"`
} `xml:"FromUserName"`
CreateTime struct {
Text string `xml:",chardata"`
} `xml:"CreateTime"`
MsgType struct {
Text string `xml:",chardata"`
} `xml:"MsgType"`
Event struct {
Text string `xml:",chardata"`
} `xml:"Event"`
ChangeType struct {
Text string `xml:",chardata"`
} `xml:"ChangeType"`
UserID struct {
Text string `xml:",chardata"`
} `xml:"UserID"`
ExternalUserID struct {
Text string `xml:",chardata"`
} `xml:"ExternalUserID"`
}

func (EventCustomerAcquisitionCustomerStartChat) GetMessageType() string {
return "event"
}

func (EventCustomerAcquisitionCustomerStartChat) GetEventType() string {
return "customer_acquisition"
}

func (EventCustomerAcquisitionCustomerStartChat) GetChangeType() string {
return "customer_start_chat"
}

func (m EventCustomerAcquisitionCustomerStartChat) GetTypeKey() string {
return m.GetMessageType() + ":" + m.GetEventType() + ":" + m.GetChangeType()
}

func (EventCustomerAcquisitionCustomerStartChat) ParseFromXml(data []byte) (CallBackExtraInfoInterface, error) {
var temp EventCustomerAcquisitionCustomerStartChat
err := xml.Unmarshal(data, &temp)
return temp, err
}
59 changes: 59 additions & 0 deletions callbacks/event获客链接不可用事件.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package callbacks

import "encoding/xml"

// 自动生成的回调结构,按需修改, 生成方式: make callback doc=微信文档地址url
// 文档: https://developer.work.weixin.qq.com/document/path/97299#获客链接不可用事件

func init() {
//添加可解析的回调事件
supportCallback(EventCustomerAcquisitionLinkUnavailable{})
}

type EventCustomerAcquisitionLinkUnavailable struct {
XMLName xml.Name `xml:"xml"`
Text string `xml:",chardata"`
ToUserName struct {
Text string `xml:",chardata"`
} `xml:"ToUserName"`
FromUserName struct {
Text string `xml:",chardata"`
} `xml:"FromUserName"`
CreateTime struct {
Text string `xml:",chardata"`
} `xml:"CreateTime"`
MsgType struct {
Text string `xml:",chardata"`
} `xml:"MsgType"`
Event struct {
Text string `xml:",chardata"`
} `xml:"Event"`
ChangeType struct {
Text string `xml:",chardata"`
} `xml:"ChangeType"`
LinkId struct {
Text string `xml:",chardata"`
} `xml:"LinkId"`
}

func (EventCustomerAcquisitionLinkUnavailable) GetMessageType() string {
return "event"
}

func (EventCustomerAcquisitionLinkUnavailable) GetEventType() string {
return "customer_acquisition"
}

func (EventCustomerAcquisitionLinkUnavailable) GetChangeType() string {
return "link_unavailable"
}

func (m EventCustomerAcquisitionLinkUnavailable) GetTypeKey() string {
return m.GetMessageType() + ":" + m.GetEventType() + ":" + m.GetChangeType()
}

func (EventCustomerAcquisitionLinkUnavailable) ParseFromXml(data []byte) (CallBackExtraInfoInterface, error) {
var temp EventCustomerAcquisitionLinkUnavailable
err := xml.Unmarshal(data, &temp)
return temp, err
}
56 changes: 56 additions & 0 deletions callbacks/event获客额度即将耗尽事件.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package callbacks

import "encoding/xml"

// 自动生成的回调结构,按需修改, 生成方式: make callback doc=微信文档地址url
// 文档: https://developer.work.weixin.qq.com/document/path/97299#获客额度即将耗尽事件

func init() {
//添加可解析的回调事件
supportCallback(EventCustomerAcquisitionBalanceLow{})
}

type EventCustomerAcquisitionBalanceLow struct {
XMLName xml.Name `xml:"xml"`
Text string `xml:",chardata"`
ToUserName struct {
Text string `xml:",chardata"`
} `xml:"ToUserName"`
FromUserName struct {
Text string `xml:",chardata"`
} `xml:"FromUserName"`
CreateTime struct {
Text string `xml:",chardata"`
} `xml:"CreateTime"`
MsgType struct {
Text string `xml:",chardata"`
} `xml:"MsgType"`
Event struct {
Text string `xml:",chardata"`
} `xml:"Event"`
ChangeType struct {
Text string `xml:",chardata"`
} `xml:"ChangeType"`
}

func (EventCustomerAcquisitionBalanceLow) GetMessageType() string {
return "event"
}

func (EventCustomerAcquisitionBalanceLow) GetEventType() string {
return "customer_acquisition"
}

func (EventCustomerAcquisitionBalanceLow) GetChangeType() string {
return "balance_low"
}

func (m EventCustomerAcquisitionBalanceLow) GetTypeKey() string {
return m.GetMessageType() + ":" + m.GetEventType() + ":" + m.GetChangeType()
}

func (EventCustomerAcquisitionBalanceLow) ParseFromXml(data []byte) (CallBackExtraInfoInterface, error) {
var temp EventCustomerAcquisitionBalanceLow
err := xml.Unmarshal(data, &temp)
return temp, err
}
62 changes: 62 additions & 0 deletions callbacks/event通过获客链接申请好友事件.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package callbacks

import "encoding/xml"

// 自动生成的回调结构,按需修改, 生成方式: make callback doc=微信文档地址url
// 文档: https://developer.work.weixin.qq.com/document/path/97299#通过获客链接申请好友事件

func init() {
//添加可解析的回调事件
supportCallback(EventCustomerAcquisitionFriendRequest{})
}

type EventCustomerAcquisitionFriendRequest struct {
XMLName xml.Name `xml:"xml"`
Text string `xml:",chardata"`
ToUserName struct {
Text string `xml:",chardata"`
} `xml:"ToUserName"`
FromUserName struct {
Text string `xml:",chardata"`
} `xml:"FromUserName"`
CreateTime struct {
Text string `xml:",chardata"`
} `xml:"CreateTime"`
MsgType struct {
Text string `xml:",chardata"`
} `xml:"MsgType"`
Event struct {
Text string `xml:",chardata"`
} `xml:"Event"`
ChangeType struct {
Text string `xml:",chardata"`
} `xml:"ChangeType"`
LinkId struct {
Text string `xml:",chardata"`
} `xml:"LinkId"`
State struct {
Text string `xml:",chardata"`
} `xml:"State"`
}

func (EventCustomerAcquisitionFriendRequest) GetMessageType() string {
return "event"
}

func (EventCustomerAcquisitionFriendRequest) GetEventType() string {
return "customer_acquisition"
}

func (EventCustomerAcquisitionFriendRequest) GetChangeType() string {
return "friend_request"
}

func (m EventCustomerAcquisitionFriendRequest) GetTypeKey() string {
return m.GetMessageType() + ":" + m.GetEventType() + ":" + m.GetChangeType()
}

func (EventCustomerAcquisitionFriendRequest) ParseFromXml(data []byte) (CallBackExtraInfoInterface, error) {
var temp EventCustomerAcquisitionFriendRequest
err := xml.Unmarshal(data, &temp)
return temp, err
}

0 comments on commit ccd05e4

Please sign in to comment.