优化代码

This commit is contained in:
jinyu
2016-04-09 00:56:36 +08:00
parent 00f2a28203
commit 0a35cf9d9b
13 changed files with 26 additions and 28 deletions
@@ -57,7 +57,6 @@ public class WeixinTicketCreator implements TokenCreator {
JSONObject result = response.getAsJson();
Token token = new Token(result.getString("ticket"));
token.setExpiresIn(result.getIntValue("expires_in"));
token.setCreateTime(System.currentTimeMillis());
token.setOriginalResult(response.getAsString());
return token;
}
@@ -50,7 +50,6 @@ public class WeixinTokenCreator implements TokenCreator {
WeixinResponse response = weixinExecutor.get(tokenUrl);
Token token = response.getAsObject(new TypeReference<Token>() {
});
token.setCreateTime(System.currentTimeMillis());
token.setOriginalResult(response.getAsString());
return token;
}
@@ -14,8 +14,7 @@ import com.foxinmy.weixin4j.xml.XmlStream;
public class XmlstreamTest {
public static void object2xmlWithRootElement() {
Token token = new Token();
token.setAccessToken("accessToken");
Token token = new Token("accessToken");
token.setExpiresIn(12);
token.setCreateTime(13l);
String content = XmlStream.toXML(token);