Package com.bytedesk.wechat.mp
Class WeChatMpMessageService
java.lang.Object
com.bytedesk.wechat.mp.WeChatMpMessageService
微信公众号
客服消息:https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html#7
- Author:
- kefux.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IMessageSendService
private final HttpRestService
private final WeChatMpMediaRestService
private final WeChatMpThreadService
private final WeChatMpTokenService
private final WeChatMpUserApiService
private final WeChatMpUserService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateMessageProtobuf
(WeChatMpEntity mpEntity, ThreadProtobuf threadProtobuf, WeChatMpUserEntity visitor, me.chanjar.weixin.mp.bean.message.WxMpXmlMessage xmlMessage) getMediaUrl
(String wxappid, String mediaid) getShortUrl
(String wxappid, String longUrl) getWechatMiniQrcodeUnlimited
(String wxappid, String id) 微信小程序码 wxacode.getUnlimited 获取小程序码,适用于需要的码数量极多的业务场景。handleEvent
(WeChatMpEntity mpEntity, me.chanjar.weixin.mp.bean.message.WxMpXmlMessage xmlMessage) void
handleMessage
(WeChatMpEntity mpEntity, me.chanjar.weixin.mp.bean.message.WxMpXmlMessage xmlMessage) static int
saveToImgByInputStream
(InputStream inputStreams, String imgPath, String imgName) 将二进制转换成文件保存void
sendAudioMessage
(WeChatMpEntity mpEntity, String openid, String voiceUrl) type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) media: form-data中媒体文件标识,有filename、filelength、content-type等信息 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.htmlvoid
sendImageMessage
(WeChatMpEntity mpEntity, String openid, String imageUrl) type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) media: form-data中媒体文件标识,有filename、filelength、content-type等信息 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.htmlsendImageMessageAutoReply
(String wxappid, String openid, String imageUrl) void
sendMiniProgramPage
(WeChatMpEntity mpEntity, String openid, String title, String appid, String pagepath, String thumb_media_id) void
sendMsgMenuMessage
(WeChatMpEntity mpEntity, String openid) void
sendMsgMenuMessageSatisfy
(String mid, String wxappid, String openid, String threadTid) void
sendMsgMenuMessageSatisfy
(String mid, String wxappid, String openid, String headContent, String tailContent, String threadTid) void
sendMusicMessage
(Thread thread, String mid, String wxappid, String openid, String musicUrl, String title, String description) type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) media: form-data中媒体文件标识,有filename、filelength、content-type等信息 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.htmlsendMusicMessageAutoReply
(String wxappid, String openid, String musicUrl, String title, String description) void
sendTextMessage
(WeChatMpEntity mpEntity, String openid, String content) 发送文本消息 https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html#7 TODO: 微信公众号内点击消息内容文字,自动发送消息到服务端 例如:显示的文字 您可能也想看看(请点击) ☞ 这款产品有没有病种的限制?sendTextMessageAutoReply
(String wxappid, String openid, String content) void
sendTypingMessage
(WeChatMpEntity mpEntity, String openid) void
sendVideoMessage
(WeChatMpEntity mpEntity, String openid, String videoUrl, String title, String description) type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) media: form-data中媒体文件标识,有filename、filelength、content-type等信息 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.htmlsendVideoMessageAutoReply
(String wxappid, String openid, String videoUrl, String title, String description) sendVoiceMessageAutoReply
(String wxappid, String openid, String voiceUrl) void
sendWxCardMessage
(WeChatMpEntity mpEntity, String openid, String card_id)
-
Field Details
-
restService
-
weChatMpTokenService
-
WeChatMpUserService
-
WeChatMpUserApiService
-
weChatMpThreadService
-
messageSendService
-
weChatMpMediaRestService
-
-
Constructor Details
-
WeChatMpMessageService
public WeChatMpMessageService()
-
-
Method Details
-
handleMessage
public void handleMessage(WeChatMpEntity mpEntity, me.chanjar.weixin.mp.bean.message.WxMpXmlMessage xmlMessage) -
handleEvent
public Boolean handleEvent(WeChatMpEntity mpEntity, me.chanjar.weixin.mp.bean.message.WxMpXmlMessage xmlMessage) -
createMessageProtobuf
public MessageProtobuf createMessageProtobuf(WeChatMpEntity mpEntity, ThreadProtobuf threadProtobuf, WeChatMpUserEntity visitor, me.chanjar.weixin.mp.bean.message.WxMpXmlMessage xmlMessage) -
sendTextMessage
发送文本消息 https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html#7 TODO: 微信公众号内点击消息内容文字,自动发送消息到服务端 例如:显示的文字 您可能也想看看(请点击) ☞ 这款产品有没有病种的限制? ☞ 有什么保险 ☞人寿保险和这个冲突吗 https://blog.csdn.net/gyr962/article/details/122261060 TODO: 微信公众号内点击消息内容文字,打开小程序(仅支持公众号打开小程序,微信客服内会打开超链接) 文本内容点击跳萝卜丝小程序 说明: 1.data-miniprogram-appid 项,填写小程序appid,则表示该链接跳小程序; 2.data-miniprogram-path项,填写小程序路径,路径与 app.json 中保持一致,可带参数; 3.对于不支持data-miniprogram-appid 项的客户端版本,如果有 herf 项,则仍然保持跳 href 中的网页链接; 4.data-miniprogram-appid对应的小程序必须与公众号有绑定关系。 发送超链接 kefux -
sendImageMessage
type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) media: form-data中媒体文件标识,有filename、filelength、content-type等信息 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html -
sendAudioMessage
type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) media: form-data中媒体文件标识,有filename、filelength、content-type等信息 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html -
sendVideoMessage
public void sendVideoMessage(WeChatMpEntity mpEntity, String openid, String videoUrl, String title, String description) type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) media: form-data中媒体文件标识,有filename、filelength、content-type等信息 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html -
sendTypingMessage
-
sendMusicMessage
public void sendMusicMessage(Thread thread, String mid, String wxappid, String openid, String musicUrl, String title, String description) type: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) media: form-data中媒体文件标识,有filename、filelength、content-type等信息 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html -
sendMsgMenuMessage
-
sendMsgMenuMessageSatisfy
-
sendMsgMenuMessageSatisfy
-
sendWxCardMessage
-
sendMiniProgramPage
-
sendTextMessageAutoReply
-
sendImageMessageAutoReply
-
sendVoiceMessageAutoReply
-
sendVideoMessageAutoReply
-
sendMusicMessageAutoReply
-
getMediaUrl
-
getWechatMiniQrcodeUnlimited
微信小程序码 wxacode.getUnlimited 获取小程序码,适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/qr-code/wxacode.getUnlimited.html -
saveToImgByInputStream
将二进制转换成文件保存- Parameters:
inputStreams
- 二进制流imgPath
- 图片的保存路径imgName
- 图片的名称- Returns:
- 1:保存正常 0:保存失败
-
getShortUrl
-