修复命名错误。data是datum的复数,datas是错误写法

This commit is contained in:
YuJian
2016-04-24 13:16:10 +08:00
parent e57eb3f244
commit 52e9b67c0f
2 changed files with 16 additions and 12 deletions

View File

@@ -30,16 +30,16 @@ public class WxMpTemplateMessageGsonAdapter implements JsonSerializer<WxMpTempla
messageJson.addProperty("topcolor", message.getTopColor());
}
JsonObject datas = new JsonObject();
messageJson.add("data", datas);
JsonObject data = new JsonObject();
messageJson.add("data", data);
for (WxMpTemplateData data : message.getDatas()) {
for (WxMpTemplateData datum : message.getData()) {
JsonObject dataJson = new JsonObject();
dataJson.addProperty("value", data.getValue());
if (data.getColor() != null) {
dataJson.addProperty("color", data.getColor());
dataJson.addProperty("value", datum.getValue());
if (datum.getColor() != null) {
dataJson.addProperty("color", datum.getColor());
}
datas.add(data.getName(), dataJson);
data.add(datum.getName(), dataJson);
}
return messageJson;