| @@ -5,7 +5,7 @@ import lombok.NoArgsConstructor; | |||||
| /** | /** | ||||
| * <pre> | * <pre> | ||||
| * | |||||
| * 参考文档 https://developers.weixin.qq.com/miniprogram/dev/api-backend/templateMessage.send.html | |||||
| * Created by Binary Wang on 2018/9/23. | * Created by Binary Wang on 2018/9/23. | ||||
| * </pre> | * </pre> | ||||
| * | * | ||||
| @@ -29,4 +29,5 @@ public class WxMaTemplateData { | |||||
| this.color = color; | this.color = color; | ||||
| } | } | ||||
| } | } | ||||
| @@ -13,7 +13,7 @@ import lombok.Setter; | |||||
| /** | /** | ||||
| * 模板消息. | * 模板消息. | ||||
| * 参考 https://mp.weixin.qq.com/debug/wxadoc/dev/api/notice.html#接口说明 模板消息部分 | |||||
| * 参考 https://developers.weixin.qq.com/miniprogram/dev/api-backend/templateMessage.send.html | |||||
| * | * | ||||
| * @author <a href="https://github.com/binarywang">Binary Wang</a> | * @author <a href="https://github.com/binarywang">Binary Wang</a> | ||||
| */ | */ | ||||
| @@ -75,16 +75,6 @@ public class WxMaTemplateMessage implements Serializable { | |||||
| */ | */ | ||||
| private List<WxMaTemplateData> data; | private List<WxMaTemplateData> data; | ||||
| /** | |||||
| * 模板内容字体的颜色,不填默认黑色. | |||||
| * <pre> | |||||
| * 参数:color | |||||
| * 是否必填: 否 | |||||
| * 描述: 模板内容字体的颜色,不填默认黑色 | |||||
| * </pre> | |||||
| */ | |||||
| private String color; | |||||
| /** | /** | ||||
| * 模板需要放大的关键词,不填则默认无放大. | * 模板需要放大的关键词,不填则默认无放大. | ||||
| * <pre> | * <pre> | ||||
| @@ -27,10 +27,6 @@ public class WxMaTemplateMessageGsonAdapter implements JsonSerializer<WxMaTempla | |||||
| messageJson.addProperty("form_id", message.getFormId()); | messageJson.addProperty("form_id", message.getFormId()); | ||||
| } | } | ||||
| if (message.getColor() != null) { | |||||
| messageJson.addProperty("color", message.getColor()); | |||||
| } | |||||
| if (message.getEmphasisKeyword() != null) { | if (message.getEmphasisKeyword() != null) { | ||||
| messageJson.addProperty("emphasis_keyword", message.getEmphasisKeyword()); | messageJson.addProperty("emphasis_keyword", message.getEmphasisKeyword()); | ||||
| } | } | ||||
| @@ -45,9 +41,6 @@ public class WxMaTemplateMessageGsonAdapter implements JsonSerializer<WxMaTempla | |||||
| for (WxMaTemplateData datum : message.getData()) { | for (WxMaTemplateData datum : message.getData()) { | ||||
| JsonObject dataJson = new JsonObject(); | JsonObject dataJson = new JsonObject(); | ||||
| dataJson.addProperty("value", datum.getValue()); | dataJson.addProperty("value", datum.getValue()); | ||||
| if (datum.getColor() != null) { | |||||
| dataJson.addProperty("color", datum.getColor()); | |||||
| } | |||||
| data.add(datum.getName(), dataJson); | data.add(datum.getName(), dataJson); | ||||
| } | } | ||||
| @@ -79,9 +79,6 @@ public class WxMaUniformMessageGsonAdapter implements JsonSerializer<WxMaUniform | |||||
| for (WxMaTemplateData templateData : message.getData()) { | for (WxMaTemplateData templateData : message.getData()) { | ||||
| JsonObject dataJson = new JsonObject(); | JsonObject dataJson = new JsonObject(); | ||||
| dataJson.addProperty("value", templateData.getValue()); | dataJson.addProperty("value", templateData.getValue()); | ||||
| if (templateData.getColor() != null) { | |||||
| dataJson.addProperty("color", templateData.getColor()); | |||||
| } | |||||
| data.add(templateData.getName(), dataJson); | data.add(templateData.getName(), dataJson); | ||||
| } | } | ||||
| } | } | ||||
| @@ -48,10 +48,10 @@ public class WxMaMsgServiceImplTest { | |||||
| .formId("FORMID") | .formId("FORMID") | ||||
| .page("index") | .page("index") | ||||
| .data(Lists.newArrayList( | .data(Lists.newArrayList( | ||||
| new WxMaTemplateData("keyword1", "339208499", "#173177"), | |||||
| new WxMaTemplateData("keyword2", dateFormat.format(new Date()), "#173177"), | |||||
| new WxMaTemplateData("keyword3", "粤海喜来登酒店", "#173177"), | |||||
| new WxMaTemplateData("keyword4", "广州市天河区天河路208号", "#173177"))) | |||||
| new WxMaTemplateData("keyword1", "339208499"), | |||||
| new WxMaTemplateData("keyword2", dateFormat.format(new Date())), | |||||
| new WxMaTemplateData("keyword3", "粤海喜来登酒店"), | |||||
| new WxMaTemplateData("keyword4", "广州市天河区天河路208号"))) | |||||
| .templateId(config.getTemplateId()) | .templateId(config.getTemplateId()) | ||||
| .emphasisKeyword("keyword1.DATA") | .emphasisKeyword("keyword1.DATA") | ||||
| .build(); | .build(); | ||||