Class WeChatMpMessageService

java.lang.Object
com.bytedesk.wechat.mp.WeChatMpMessageService

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

  • Constructor Details

    • WeChatMpMessageService

      public WeChatMpMessageService()
  • Method Details

    • sendImageMessageAutoReply

      public String sendImageMessageAutoReply(String wxappid, 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
    • sendVoiceMessageAutoReply

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

      public String sendVideoMessageAutoReply(String wxappid, String openid, String videoUrl, 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:保存失败
    • getShortUrl

      public String getShortUrl(String wxappid, String longUrl)