update md

This commit is contained in:
jinyu 2015-05-11 17:21:11 +08:00
parent 29cbb6221c
commit 165f4b3bb8
3 changed files with 1 additions and 59 deletions

View File

@ -6,7 +6,7 @@ weixin4j
项目说明
-------
`weixin4j`是一个用java编写针对微信开发的工具包,包含[weixin4j-mp](./weixin4j-mp)(微信公众平台API)、[weixin4j-qy](./weixin4j-qy)(微信企业号API)以及[weixin4j-server](./weixin4j-server)(微信被动消息服务器)三个工程.
> `weixin4j`是一个用java编写针对微信开发的工具包,包含[weixin4j-mp](./weixin4j-mp)(微信公众平台API)、[weixin4j-qy](./weixin4j-qy)(微信企业号API)以及[weixin4j-server](./weixin4j-server)(微信被动消息服务器)三个工程.
功能列表
-------

View File

@ -6,7 +6,6 @@ weixin4j-server
功能列表
-------
* `netty服务器`
* `消息分发`

View File

@ -1,57 +0,0 @@
package com.foxinmy.weixin4j.request;
import java.io.Serializable;
import com.foxinmy.weixin4j.response.BlankResponse;
import com.foxinmy.weixin4j.response.WeixinResponse;
public class ResponseMessage implements Serializable {
private static final long serialVersionUID = -2822272237544040042L;
private WeixinMessage message;
private WeixinResponse response;
public ResponseMessage(WeixinMessage message, WeixinResponse response) {
this.message = message;
this.response = response;
}
public WeixinMessage getMessage() {
return message;
}
public WeixinResponse getResponse() {
return response;
}
public String toXml() {
if (response instanceof BlankResponse) {
return response.toContent();
} else {
StringBuilder xmlContent = new StringBuilder();
xmlContent.append("<xml>");
xmlContent.append(String.format(
"<ToUserName><![CDATA[%s]]></ToUserName>",
message.getFromUserName()));
xmlContent.append(String.format(
"<FromUserName><![CDATA[%s]]></FromUserName>",
message.getToUserName()));
xmlContent.append(String.format(
"<CreateTime><![CDATA[%d]]></CreateTime>",
System.currentTimeMillis() / 1000l));
xmlContent
.append(String.format("<MsgType><![CDATA[%s]]></MsgType>",
response.getMsgType()));
xmlContent.append(response.toContent());
xmlContent.append("</xml>");
return xmlContent.toString();
}
}
@Override
public String toString() {
return "ResponseMessage [message=" + message + ", response=" + response
+ "]";
}
}