mirror of
https://github.com/silenceper/wechat.git
synced 2026-03-01 00:35:26 +08:00
与origin代码同步
This commit is contained in:
@@ -14,16 +14,16 @@ const (
|
||||
messageDelURL = "https://api.weixin.qq.com/cgi-bin/message/recall"
|
||||
)
|
||||
|
||||
//App 应用消息
|
||||
type App struct {
|
||||
// Client 应用消息
|
||||
type Client struct {
|
||||
*context.Context
|
||||
}
|
||||
|
||||
//NewApp 实例化
|
||||
func NewApp(context *context.Context) *App {
|
||||
tpl := new(App)
|
||||
tpl.Context = context
|
||||
return tpl
|
||||
// NewClient 实例化
|
||||
func NewClient(ctx *context.Context) *Client {
|
||||
return &Client{
|
||||
ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// AppMessage 发送的模板消息内容
|
||||
@@ -71,7 +71,7 @@ type resTemplateSend struct {
|
||||
}
|
||||
|
||||
// Send 发送应用消息
|
||||
func (tpl *App) Send(msg *AppMessage) (msgID string, responseCode string, err error) {
|
||||
func (tpl *Client) Send(msg *AppMessage) (msgID string, responseCode string, err error) {
|
||||
var accessToken string
|
||||
accessToken, err = tpl.GetAccessToken()
|
||||
if err != nil {
|
||||
@@ -113,7 +113,7 @@ type TemplateUpdate struct {
|
||||
}
|
||||
|
||||
// UpdateTemplate 更新模版卡片消息
|
||||
func (tpl *App) UpdateTemplate(msg *TemplateUpdate) (msgID string, err error) {
|
||||
func (tpl *Client) UpdateTemplate(msg *TemplateUpdate) (msgID string, err error) {
|
||||
var accessToken string
|
||||
accessToken, err = tpl.GetAccessToken()
|
||||
if err != nil {
|
||||
@@ -143,7 +143,7 @@ type ReqRecall struct {
|
||||
}
|
||||
|
||||
// Recall 撤回应用消息
|
||||
func (tpl *App) Recall(msgID int64) (err error) {
|
||||
func (tpl *Client) Recall(msgID int64) (err error) {
|
||||
var accessToken string
|
||||
accessToken, err = tpl.GetAccessToken()
|
||||
if err != nil {
|
||||
+2
-2
@@ -83,8 +83,8 @@ func (wk *Work) GetExternalContact() *externalcontact.Client {
|
||||
}
|
||||
|
||||
// GetMessageApp 发送应用消息
|
||||
func (wk *Work) GetMessageApp() *message.App {
|
||||
return message.NewApp(wk.ctx)
|
||||
func (wk *Work) GetMessageApp() *message.Client {
|
||||
return message.NewClient(wk.ctx)
|
||||
}
|
||||
|
||||
// GetAddressList get address_list
|
||||
|
||||
Reference in New Issue
Block a user