接上一讲,微信公众号开发(1)——服务器配置
新建几个信息类:
package com.imooc.po;
/**
* 信息基类
* @author lyj
*
*/
public class BaseMessage {
private String ToUserName;
private String FromUserName;
private Long CreateTime;
private String MsgType;
public String getToUserName() {
return ToUserName;
}
public void setToUserName(String toUserName) {
ToUserName = toUserName;
}
public String getFromUserName() {
return FromUserName;
}
public void setFromUserName(String fromUserName) {
FromUserName = fromUserName;
}
public Long getCreateTime() {
return CreateTime;
}
public void setCreateTime(Long createTime) {
CreateTime = createTime;
}
public String getMsgType() {
return MsgType;
}
public void setMsgType(String msgType) {
MsgType = msgType;
}
}
package com.imooc.po;
/**
* 文本消息类封装
* @author lyj
*
*/
public class TextMessage extends BaseMessage{
private String Content;
private String MsgId;
public String getContent() {
return Content;
}
public void setContent(String content) {
Content = content;
}
public String getMsgId() {
return MsgId;
}
public void setMsgId(String msgId) {
MsgId = msgId;
}
}
package com.imooc.po;
/**
* 图文消息类
* @author lyj
*
*/
public class News {
private String Title;
private String Description;
private String PicUrl;
private String Url;
public String getTitle() {
return Title;
}
public void setTitle(String title)