类 MessageUtil

java.lang.Object
com.sh.weixin.util.MessageUtil

public class MessageUtil extends Object

Description:

Title:首亨软件 - TSS/CRM等

从以下版本开始:
2014年2月14日
  • 字段详细资料

    • RESP_MESSAGE_TYPE_TEXT

      public static final String RESP_MESSAGE_TYPE_TEXT
      返回消息类型:文本
      另请参阅:
    • RESP_MESSAGE_TYPE_MUSIC

      public static final String RESP_MESSAGE_TYPE_MUSIC
      返回消息类型:音乐
      另请参阅:
    • RESP_MESSAGE_TYPE_NEWS

      public static final String RESP_MESSAGE_TYPE_NEWS
      返回消息类型:图文
      另请参阅:
    • REQ_MESSAGE_TYPE_TEXT

      public static final String REQ_MESSAGE_TYPE_TEXT
      请求消息类型:文本
      另请参阅:
    • REQ_MESSAGE_TYPE_IMAGE

      public static final String REQ_MESSAGE_TYPE_IMAGE
      请求消息类型:图片
      另请参阅:
    • REQ_MESSAGE_TYPE_LOCATION

      public static final String REQ_MESSAGE_TYPE_LOCATION
      请求消息类型:地理位置
      另请参阅:
    • REQ_MESSAGE_TYPE_VOICE

      public static final String REQ_MESSAGE_TYPE_VOICE
      请求消息类型:音频
      另请参阅:
    • REQ_MESSAGE_TYPE_EVENT

      public static final String REQ_MESSAGE_TYPE_EVENT
      请求消息类型:推送
      另请参阅:
    • EVENT_TYPE_SUBSCRIBE

      public static final String EVENT_TYPE_SUBSCRIBE
      事件类型:subscribe(订阅)
      另请参阅:
    • EVENT_TYPE_UNSUBSCRIBE

      public static final String EVENT_TYPE_UNSUBSCRIBE
      事件类型:unsubscribe(取消订阅)
      另请参阅:
    • EVENT_TYPE_TEMPLATESENDJOBFINISH

      public static final String EVENT_TYPE_TEMPLATESENDJOBFINISH
      事件类型:模板消息通知事件
      另请参阅:
    • EVENT_TYPE_CLICK

      public static final String EVENT_TYPE_CLICK
      事件类型:CLICK(自定义菜单点击事件)
      另请参阅:
    • EVENT_TYPE_SCANCODE_WAITMSG

      public static final String EVENT_TYPE_SCANCODE_WAITMSG
      事件类型:扫码推事件且弹出“消息接收中”提示框的事件推送
      另请参阅:
    • EVENT_TYPE_LOCATION

      public static final String EVENT_TYPE_LOCATION
      事件类型:上报地理位置事件
      另请参阅:
    • EVENT_TYPE_enter_agent

      public static final String EVENT_TYPE_enter_agent
      事件类型:成员进入应用的事件
      另请参阅:
    • EVENT_TYPE_transfer_customer_service

      public static final String EVENT_TYPE_transfer_customer_service
      事件类型:消息转发到客服
      另请参阅:
  • 构造器详细资料

    • MessageUtil

      public MessageUtil()
  • 方法详细资料

    • parseXml

      public static Map<String,String> parseXml(jakarta.servlet.http.HttpServletRequest request, FlowContext context) throws Exception
      解析微信发来的请求(XML)
      参数:
      request - HttpServletRequest
      context - FlowContext
      返回:
      Map
      抛出:
      Exception - Exception
    • parseXml

      public static Map<String,String> parseXml(String xmlStr, FlowContext context) throws Exception
      抛出:
      Exception
    • textMessageToXml

      public static String textMessageToXml(TextMessage textMessage, String type)
      文本消息对象转换成xml
      参数:
      textMessage - 文本消息对象
      type - 1:客服消息 其他:普通消息
      返回:
      xml
    • miniProgramMessageToXml

      public static String miniProgramMessageToXml(MiniProgramPageMessage message, String type)
      小程序
      参数:
      message - MiniProgramPageMessage
      type - String
      返回:
      String
    • musicMessageToXml

      public static String musicMessageToXml(MusicMessage musicMessage)
      音乐消息对象转换成xml
      参数:
      musicMessage - 音乐消息对象
      返回:
      xml
    • newsMessageToXml

      public static String newsMessageToXml(NewsMessage newsMessage, String type)
      图文消息对象转换成xml
      参数:
      newsMessage - 图文消息对象
      type - 1:客服消息 其他:普通消息
      返回:
      xml