Comments (10)
type RequestAccountServiceSendMsg struct {
ToUser stringjson:"touser"
OpenKfid stringjson:"open_kfid"
MsgID stringjson:"msgid"
MsgType stringjson:"msgtype"
Text RequestAccountServiceMsgTextjson:"text,omitempty"
Image RequestAccountServiceMsgImagejson:"image,omitempty"
Voice RequestAccountServiceMsgVoicejson:"voice,omitempty"
File RequestAccountServiceMsgFilejson:"file,omitempty"
Link RequestAccountServiceMsgLinkjson:"link,omitempty"
MiniProgram RequestAccountServiceMsgMiniProgramjson:"miniprogram,omitempty"
Menu RequestAccountServiceMsgMenujson:"msgmenu,omitempty"
Location RequestAccountServiceMsgLocationjson:"location,omitempty"
}
这个发消息的对象是不是有点问题吧,应该是 *RequestAccountServiceMsgText,不然 omitempty 没用吧
你看到挺仔细,这个请查看最新的版本 : https://github.com/ArtisanCloud/PowerWeChat/tree/v3.1.13
已经追加了*
from powerwechat.
pls check v3.1.15
帮你添加了omit for
type RequestAccountServiceSendMsg struct {
ToUser string json:"touser"
OpenKfid string json:"open_kfid"
MsgID string json:"msgid,omitempty"
MsgType string json:"msgtype,omitempty"
Text *RequestAccountServiceMsgText json:"text,omitempty"
Image *RequestAccountServiceMsgImage json:"image,omitempty"
Voice *RequestAccountServiceMsgVoice json:"voice,omitempty"
File *RequestAccountServiceMsgFile json:"file,omitempty"
Link *RequestAccountServiceMsgLink json:"link,omitempty"
MiniProgram *RequestAccountServiceMsgMiniProgram json:"miniprogram,omitempty"
Menu *RequestAccountServiceMsgMenu json:"msgmenu,omitempty"
Location *RequestAccountServiceMsgLocation json:"location,omitempty"
}
from powerwechat.
应该用什么
msg := models.???{}
from powerwechat.
type RequestAccountServiceSendMsg struct {
ToUser string json:"touser"
OpenKfid string json:"open_kfid"
MsgID string json:"msgid"
MsgType string json:"msgtype"
Text RequestAccountServiceMsgText json:"text,omitempty"
Image RequestAccountServiceMsgImage json:"image,omitempty"
Voice RequestAccountServiceMsgVoice json:"voice,omitempty"
File RequestAccountServiceMsgFile json:"file,omitempty"
Link RequestAccountServiceMsgLink json:"link,omitempty"
MiniProgram RequestAccountServiceMsgMiniProgram json:"miniprogram,omitempty"
Menu RequestAccountServiceMsgMenu json:"msgmenu,omitempty"
Location RequestAccountServiceMsgLocation json:"location,omitempty"
}
这个发消息的对象是不是有点问题吧,应该是 *RequestAccountServiceMsgText,不然 omitempty 没用吧
from powerwechat.
应该用什么 msg := models.???{}
具体使用方法是:
通过GetEvent后,再通过定义个事件内容结构体,通过event.ReadMessage(&msg)去解析获取。
我已经上传到develop分支了,请试着用一下,如果没问题,我可以打一个版本
如果有问题,请随时添加我的微信,我可以帮助协助
from powerwechat.
type RequestAccountServiceSendMsg struct {
ToUser stringjson:"touser"
OpenKfid stringjson:"open_kfid"
MsgID stringjson:"msgid"
MsgType stringjson:"msgtype"
Text RequestAccountServiceMsgTextjson:"text,omitempty"
Image RequestAccountServiceMsgImagejson:"image,omitempty"
Voice RequestAccountServiceMsgVoicejson:"voice,omitempty"
File RequestAccountServiceMsgFilejson:"file,omitempty"
Link RequestAccountServiceMsgLinkjson:"link,omitempty"
MiniProgram RequestAccountServiceMsgMiniProgramjson:"miniprogram,omitempty"
Menu RequestAccountServiceMsgMenujson:"msgmenu,omitempty"
Location RequestAccountServiceMsgLocationjson:"location,omitempty"
}
这个发消息的对象是不是有点问题吧,应该是 *RequestAccountServiceMsgText,不然 omitempty 没用吧你看到挺仔细,这个请查看最新的版本 : https://github.com/ArtisanCloud/PowerWeChat/tree/v3.1.13 已经追加了*
主要是我在开发企业微信客服...此外帮忙检查一下这些对象吧,很多都是 optional 的,比如 MsgID string json:"msgid"
,这个字段没加上 omitempty 传到微信会提示不合法的空字符串 msgid,必须要 omit 掉...
from powerwechat.
thx 有空我就测一下 实在是太忙了
from powerwechat.
from powerwechat.
哦 抱歉 看到了 hashmap 结构你们过滤了
from powerwechat.
哦 抱歉 看到了 hashmap 结构你们过滤了
no problem
from powerwechat.
Related Issues (20)
- request failed: Request access_token fail: &{{{ } 40013 invalid appid rid: 655d878c-2e41a3f4-65f9b9ba HOT 2
- 希望能关闭日志输出 HOT 1
- 微信支付配置优化。。。 HOT 1
- 微信小程序无法获取小程序码 HOT 2
- 无法获取小程序码 HOT 3
- 微信支付中主动查询结果对象和解析微信通知的结果对象中部分属性定义不一致问题 HOT 7
- ide无法正确识别嵌套方法 HOT 4
- V3版本发送消息用户收不到 HOT 1
- 类型错误 HOT 1
- 不支持商家转账批次回调通知吗? HOT 1
- 框架有自动更新平台证书吗? HOT 1
- Q: 程序启动后会默认创建 wechat 目录 HOT 1
- 微信API请求类型错误 HOT 2
- services.PaymentApp.Security.GetCertificates(c.Request.Context())方法有可能实现为不需要传c.Request.Context()的吗? HOT 1
- 微信支付v3 API列表(投诉查询及处理接口) HOT 2
- 小游戏虚拟支付功能可以接入吗 HOT 2
- 企微回调是必须的吗? HOT 1
- 接收微信服务器消息不支持json格式数据吗 HOT 1
- “获取应用的jsapi_ticket”这个接口,文档里写的需要参数access_token,为什么函数里不传这个参数? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerwechat.