Giter Club home page Giter Club logo

Comments (10)

Matrix-X avatar Matrix-X commented on May 24, 2024 1

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 没用吧

你看到挺仔细,这个请查看最新的版本 : https://github.com/ArtisanCloud/PowerWeChat/tree/v3.1.13
已经追加了*

from powerwechat.

Matrix-X avatar Matrix-X commented on May 24, 2024 1

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.

mofadeyunduo avatar mofadeyunduo commented on May 24, 2024

应该用什么
msg := models.???{}

image
没有
image
OpenKfId

from powerwechat.

mofadeyunduo avatar mofadeyunduo commented on May 24, 2024

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.

Matrix-X avatar Matrix-X commented on May 24, 2024

应该用什么 msg := models.???{}

image 没有 image OpenKfId

我新加了一个数据类型
image

具体使用方法是:

通过GetEvent后,再通过定义个事件内容结构体,通过event.ReadMessage(&msg)去解析获取。
image

我已经上传到develop分支了,请试着用一下,如果没问题,我可以打一个版本

如果有问题,请随时添加我的微信,我可以帮助协助

from powerwechat.

mofadeyunduo avatar mofadeyunduo commented on May 24, 2024

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 没用吧

你看到挺仔细,这个请查看最新的版本 : https://github.com/ArtisanCloud/PowerWeChat/tree/v3.1.13 已经追加了*

主要是我在开发企业微信客服...此外帮忙检查一下这些对象吧,很多都是 optional 的,比如 MsgID string json:"msgid",这个字段没加上 omitempty 传到微信会提示不合法的空字符串 msgid,必须要 omit 掉...

from powerwechat.

mofadeyunduo avatar mofadeyunduo commented on May 24, 2024

thx 有空我就测一下 实在是太忙了

from powerwechat.

mofadeyunduo avatar mofadeyunduo commented on May 24, 2024

image
这个接口最后一个参数是选填...

from powerwechat.

mofadeyunduo avatar mofadeyunduo commented on May 24, 2024

哦 抱歉 看到了 hashmap 结构你们过滤了

from powerwechat.

Matrix-X avatar Matrix-X commented on May 24, 2024

哦 抱歉 看到了 hashmap 结构你们过滤了

no problem

from powerwechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.