封装的方法类

This commit is contained in:
Yun
2023-09-16 20:14:20 +08:00
commit 1bbc7db405
59 changed files with 3671 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package wechatx
import (
"time"
uuid "github.com/satori/go.uuid"
)
// 构造消息
func (w *wechat) BuildTextMsg(to string, content string) *WechatMessage {
msg := &WechatMessage{
ToUserName: to,
FromUserName: w.sourceId,
CreateTime: time.Now().Unix(),
MsgType: "text",
Content: content,
MsgId: uuid.NewV4().String(),
}
return msg
}