Class WeChatMiniMessageService

java.lang.Object
com.bytedesk.wechat.mini.WeChatMiniMessageService

@Service public class WeChatMiniMessageService extends Object
微信公众号 客服消息:https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html#7
Author:
kefux.com
  • Field Details

  • Constructor Details

    • WeChatMiniMessageService

      public WeChatMiniMessageService()
  • Method Details

    • handleMessage

      public void handleMessage(WeChatMiniEntity mpEntity, cn.binarywang.wx.miniapp.bean.WxMaMessage xmlMessage)
    • handleEvent

      public Boolean handleEvent(WeChatMiniEntity mpEntity, cn.binarywang.wx.miniapp.bean.WxMaMessage xmlMessage)
    • createMessageProtobuf

      public MessageProtobuf createMessageProtobuf(WeChatMiniEntity mpEntity, ThreadProtobuf threadProtobuf, WeChatMiniUserEntity visitor, cn.binarywang.wx.miniapp.bean.WxMaMessage xmlMessage)
    • sendTextMessage

      public void sendTextMessage(WeChatMiniEntity mpEntity, String openid, String content)
      发送文本消息 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

      public void sendImageMessage(WeChatMiniEntity 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.html
    • sendAudioMessage

      public void sendAudioMessage(WeChatMiniEntity 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.html
    • sendVideoMessage

      public void sendVideoMessage(WeChatMiniEntity 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

      public void sendTypingMessage(WeChatMiniEntity mpEntity, String openid)
    • 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

      public void sendMsgMenuMessage(WeChatMiniEntity mpEntity, String openid)
    • sendMsgMenuMessageSatisfy

      public void sendMsgMenuMessageSatisfy(String mid, String wxappid, String openid, String threadTid)
    • sendMsgMenuMessageSatisfy

      public void sendMsgMenuMessageSatisfy(String mid, String wxappid, String openid, String headContent, String tailContent, String threadTid)
    • sendWxCardMessage

      public void sendWxCardMessage(WeChatMiniEntity mpEntity, String openid, String card_id)
    • sendMiniProgramPage

      public void sendMiniProgramPage(WeChatMiniEntity mpEntity, String openid, String title, String appid, String pagepath, String thumb_media_id)
    • sendTextMessageAutoReply

      public String sendTextMessageAutoReply(String wxappid, String openid, String content)
    • sendImageMessageAutoReply

      public String sendImageMessageAutoReply(String wxappid, String openid, String imageUrl)
    • sendVoiceMessageAutoReply

      public String sendVoiceMessageAutoReply(String wxappid, String openid, String voiceUrl)
    • sendVideoMessageAutoReply

      public String sendVideoMessageAutoReply(String wxappid, String openid, String videoUrl, String title, String description)
    • sendMusicMessageAutoReply

      public String sendMusicMessageAutoReply(String wxappid, String openid, String musicUrl, String title, String description)
    • getMediaUrl

      public String getMediaUrl(String wxappid, String mediaid)
    • getWechatMiniQrcodeUnlimited

      public String getWechatMiniQrcodeUnlimited(String wxappid, String id)
      微信小程序码 wxacode.getUnlimited 获取小程序码,适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/qr-code/wxacode.getUnlimited.html
    • saveToImgByInputStream

      public static int saveToImgByInputStream(InputStream inputStreams, String imgPath, String imgName)
      将二进制转换成文件保存
      Parameters:
      inputStreams - 二进制流
      imgPath - 图片的保存路径
      imgName - 图片的名称
      Returns:
      1:保存正常 0:保存失败