mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-30 20:57:47 +08:00
#1035 小程序发送模板接口去掉所有颜色相关的color参数
This commit is contained in:
parent
0287fb565b
commit
03a88aab8e
@ -5,7 +5,7 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
*
|
||||
* 参考文档 https://developers.weixin.qq.com/miniprogram/dev/api-backend/templateMessage.send.html
|
||||
* Created by Binary Wang on 2018/9/23.
|
||||
* </pre>
|
||||
*
|
||||
@ -29,4 +29,5 @@ public class WxMaTemplateData {
|
||||
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>
|
||||
*/
|
||||
@ -75,16 +75,6 @@ public class WxMaTemplateMessage implements Serializable {
|
||||
*/
|
||||
private List<WxMaTemplateData> data;
|
||||
|
||||
/**
|
||||
* 模板内容字体的颜色,不填默认黑色.
|
||||
* <pre>
|
||||
* 参数:color
|
||||
* 是否必填: 否
|
||||
* 描述: 模板内容字体的颜色,不填默认黑色
|
||||
* </pre>
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 模板需要放大的关键词,不填则默认无放大.
|
||||
* <pre>
|
||||
|
@ -27,10 +27,6 @@ public class WxMaTemplateMessageGsonAdapter implements JsonSerializer<WxMaTempla
|
||||
messageJson.addProperty("form_id", message.getFormId());
|
||||
}
|
||||
|
||||
if (message.getColor() != null) {
|
||||
messageJson.addProperty("color", message.getColor());
|
||||
}
|
||||
|
||||
if (message.getEmphasisKeyword() != null) {
|
||||
messageJson.addProperty("emphasis_keyword", message.getEmphasisKeyword());
|
||||
}
|
||||
@ -45,9 +41,6 @@ public class WxMaTemplateMessageGsonAdapter implements JsonSerializer<WxMaTempla
|
||||
for (WxMaTemplateData datum : message.getData()) {
|
||||
JsonObject dataJson = new JsonObject();
|
||||
dataJson.addProperty("value", datum.getValue());
|
||||
if (datum.getColor() != null) {
|
||||
dataJson.addProperty("color", datum.getColor());
|
||||
}
|
||||
data.add(datum.getName(), dataJson);
|
||||
}
|
||||
|
||||
|
@ -79,9 +79,6 @@ public class WxMaUniformMessageGsonAdapter implements JsonSerializer<WxMaUniform
|
||||
for (WxMaTemplateData templateData : message.getData()) {
|
||||
JsonObject dataJson = new JsonObject();
|
||||
dataJson.addProperty("value", templateData.getValue());
|
||||
if (templateData.getColor() != null) {
|
||||
dataJson.addProperty("color", templateData.getColor());
|
||||
}
|
||||
data.add(templateData.getName(), dataJson);
|
||||
}
|
||||
}
|
||||
|
@ -48,10 +48,10 @@ public class WxMaMsgServiceImplTest {
|
||||
.formId("FORMID")
|
||||
.page("index")
|
||||
.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())
|
||||
.emphasisKeyword("keyword1.DATA")
|
||||
.build();
|
||||
|
Loading…
Reference in New Issue
Block a user