封装的方法类
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user