com.belerweb.social.weixin.bean
Class Message

java.lang.Object
  extended by com.belerweb.social.bean.JsonBean
      extended by com.belerweb.social.weixin.bean.Message

public class Message
extends JsonBean

普通消息


Constructor Summary
Message()
           
Message(MsgType msgType)
           
 
Method Summary
 Message addVariable(Variable variable)
           
 List<Article> getArticles()
          多条图文消息信息,默认第一个item为大图
 String getContent()
          文本消息内容
 Date getCreateTime()
          消息创建时间
 String getDescription()
          链接消息/音乐消息特有:消息描述
 String getEventKey()
          事件KEY值,QR扫描/自定义菜单时特有
 EventType getEventType()
          事件特有:事件类型
 String getFromUser()
          发送方帐号
 String getHqMusicUrl()
          高质量音乐链接,WIFI环境优先使用该链接播放音乐
 String getLabel()
          位置消息特有: 地理位置信息
 Double getLat()
          位置消息特有:地理位置纬度
 Double getLon()
          位置消息特有:地理位置经度
 String getMediaId()
          图片/语音/视频特有:消息媒体id,可以调用多媒体文件下载接口拉取数据。
 Long getMsgId()
          消息id
 MsgType getMsgType()
          消息类型
 String getMusicUrl()
          音乐链接
 String getPicUrl()
          图片消息特有:图片链接
 Double getPrecision()
          上报地理位置事件特有: 地理位置精度
 String getRecognition()
          语音消息特有: 语音识别结果,UTF8编码,只有在开启语音识别后才有此结果
 Integer getScale()
          位置消息特有: 地图缩放大小
 String getTemplateId()
          模板消息id
 String getThumbMediaId()
          视频消息/音乐消息特有:视频消息缩略图的媒体id,可以调用多媒体文件下载接口拉取数据。
 String getTicket()
          扫描二维码,用户已关注时的事件推送特有 二维码的ticket,可用来换取二维码图片
 String getTitle()
          链接消息/音乐消息特有:消息标题
 String getTopColor()
          模板消息头部颜色
 String getToUser()
          接受方帐号
 String getUrl()
          链接消息特有:消息链接
 List<Variable> getVariables()
          模板消息变量
 VoiceType getVoiceType()
          语音消息特有:语音格式
static Message parse(org.json.JSONObject jsonObject)
           
static Message parse(String xml)
           
 void setArticles(List<Article> articles)
           
 void setContent(String content)
           
 void setCreateTime(Date createTime)
           
 void setDescription(String description)
           
 void setEventKey(String eventKey)
           
 void setEventType(EventType eventType)
           
 void setFromUser(String fromUser)
           
 void setHqMusicUrl(String hqMusicUrl)
           
 void setLabel(String label)
           
 void setLat(Double lat)
           
 void setLon(Double lon)
           
 void setMediaId(String mediaId)
           
 void setMsgId(Long msgId)
           
 void setMsgType(MsgType msgType)
           
 void setMusicUrl(String musicUrl)
           
 void setPicUrl(String picUrl)
           
 void setPrecision(Double precision)
           
 void setRecognition(String recognition)
           
 void setScale(Integer scale)
           
 void setTemplateId(String templateId)
           
 void setThumbMediaId(String thumbMediaId)
           
 void setTicket(String ticket)
           
 void setTitle(String title)
           
 void setTopColor(String topColor)
           
 void setToUser(String toUser)
           
 void setUrl(String url)
           
 void setVariables(List<Variable> variables)
           
 void setVoiceType(VoiceType voiceType)
           
 String toJSON()
          将Message转换成JSON格式,用于发送客服消息
 String toXML()
          将Message转换成XML格式,用于发送被动响应消息
 
Methods inherited from class com.belerweb.social.bean.JsonBean
getJsonObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message()

Message

public Message(MsgType msgType)
Method Detail

getMsgId

public Long getMsgId()
消息id


setMsgId

public void setMsgId(Long msgId)

getFromUser

public String getFromUser()
发送方帐号


setFromUser

public void setFromUser(String fromUser)

getToUser

public String getToUser()
接受方帐号


setToUser

public void setToUser(String toUser)

getCreateTime

public Date getCreateTime()
消息创建时间


setCreateTime

public void setCreateTime(Date createTime)

getMsgType

public MsgType getMsgType()
消息类型


setMsgType

public void setMsgType(MsgType msgType)

getContent

public String getContent()
文本消息内容


setContent

public void setContent(String content)

getMediaId

public String getMediaId()
图片/语音/视频特有:消息媒体id,可以调用多媒体文件下载接口拉取数据。


setMediaId

public void setMediaId(String mediaId)

getPicUrl

public String getPicUrl()
图片消息特有:图片链接


setPicUrl

public void setPicUrl(String picUrl)

getVoiceType

public VoiceType getVoiceType()
语音消息特有:语音格式


setVoiceType

public void setVoiceType(VoiceType voiceType)

getRecognition

public String getRecognition()
语音消息特有: 语音识别结果,UTF8编码,只有在开启语音识别后才有此结果


setRecognition

public void setRecognition(String recognition)

getThumbMediaId

public String getThumbMediaId()
视频消息/音乐消息特有:视频消息缩略图的媒体id,可以调用多媒体文件下载接口拉取数据。


setThumbMediaId

public void setThumbMediaId(String thumbMediaId)

getLon

public Double getLon()
位置消息特有:地理位置经度


setLon

public void setLon(Double lon)

getLat

public Double getLat()
位置消息特有:地理位置纬度


setLat

public void setLat(Double lat)

getScale

public Integer getScale()
位置消息特有: 地图缩放大小


setScale

public void setScale(Integer scale)

getLabel

public String getLabel()
位置消息特有: 地理位置信息


setLabel

public void setLabel(String label)

getTitle

public String getTitle()
链接消息/音乐消息特有:消息标题


setTitle

public void setTitle(String title)

getDescription

public String getDescription()
链接消息/音乐消息特有:消息描述


setDescription

public void setDescription(String description)

getUrl

public String getUrl()
链接消息特有:消息链接


setUrl

public void setUrl(String url)

getMusicUrl

public String getMusicUrl()
音乐链接


setMusicUrl

public void setMusicUrl(String musicUrl)

getHqMusicUrl

public String getHqMusicUrl()
高质量音乐链接,WIFI环境优先使用该链接播放音乐


setHqMusicUrl

public void setHqMusicUrl(String hqMusicUrl)

getEventType

public EventType getEventType()
事件特有:事件类型


setEventType

public void setEventType(EventType eventType)

getEventKey

public String getEventKey()
事件KEY值,QR扫描/自定义菜单时特有


setEventKey

public void setEventKey(String eventKey)

getTicket

public String getTicket()
扫描二维码,用户已关注时的事件推送特有 二维码的ticket,可用来换取二维码图片


setTicket

public void setTicket(String ticket)

getPrecision

public Double getPrecision()
上报地理位置事件特有: 地理位置精度


setPrecision

public void setPrecision(Double precision)

getArticles

public List<Article> getArticles()
多条图文消息信息,默认第一个item为大图


setArticles

public void setArticles(List<Article> articles)

getTemplateId

public String getTemplateId()
模板消息id


setTemplateId

public void setTemplateId(String templateId)

getTopColor

public String getTopColor()
模板消息头部颜色


setTopColor

public void setTopColor(String topColor)

getVariables

public List<Variable> getVariables()
模板消息变量

Returns:

setVariables

public void setVariables(List<Variable> variables)

addVariable

public Message addVariable(Variable variable)

toXML

public String toXML()
将Message转换成XML格式,用于发送被动响应消息


toJSON

public String toJSON()
将Message转换成JSON格式,用于发送客服消息


parse

public static Message parse(String xml)

parse

public static Message parse(org.json.JSONObject jsonObject)


Copyright © 2014. All Rights Reserved.