mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
修复命名错误。data是datum的复数,datas是错误写法
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user