1 package com.foxinmy.weixin4j.wxa.api;
2
3 import java.io.Serializable;
4 import java.util.HashMap;
5 import java.util.Map;
6
7 import com.alibaba.fastjson.annotation.JSONField;
8
9 class TemplateMessageParameter implements Serializable {
10
11 private static final long serialVersionUID = 2018052601L;
12
13 private String toUser;
14 private String templateId;
15 private String page;
16 private String formId;
17 private Map<String, TemplateMessageData> data;
18 private String emphasisKeyword;
19
20 public TemplateMessageParameter() {
21 }
22
23 public TemplateMessageParameter(
24 String toUser,
25 String templateId,
26 String page,
27 String formId,
28 Map<String, String> data,
29 String emphasisKeyword
30 ) {
31 this.toUser = toUser;
32 this.templateId = templateId;
33 this.page = page;
34 this.formId = formId;
35 if (data != null) {
36 this.data = new HashMap<String, TemplateMessageData>(data.size());
37 for (Map.Entry<String, String> entry : data.entrySet()) {
38 this.data.put(entry.getKey(), new TemplateMessageData(entry.getValue()));
39 }
40 }
41 this.emphasisKeyword = emphasisKeyword;
42 }
43
44 @JSONField(name = "touser")
45 public String getToUser() {
46 return toUser;
47 }
48
49 public void setToUser(String toUser) {
50 this.toUser = toUser;
51 }
52
53 @JSONField(name = "template_id")
54 public String getTemplateId() {
55 return templateId;
56 }
57
58 public void setTemplateId(String templateId) {
59 this.templateId = templateId;
60 }
61
62 public String getPage() {
63 return page;
64 }
65
66 public void setPage(String page) {
67 this.page = page;
68 }
69
70 @JSONField(name = "form_id")
71 public String getFormId() {
72 return formId;
73 }
74
75 public void setFormId(String formId) {
76 this.formId = formId;
77 }
78
79 public Map<String, TemplateMessageData> getData() {
80 return data;
81 }
82
83 public void setData(Map<String, TemplateMessageData> data) {
84 this.data = data;
85 }
86
87 @JSONField(name = "emphasis_keyword")
88 public String getEmphasisKeyword() {
89 return emphasisKeyword;
90 }
91
92 public void setEmphasisKeyword(String emphasisKeyword) {
93 this.emphasisKeyword = emphasisKeyword;
94 }
95
96 public static class TemplateMessageData implements Serializable {
97
98 private static final long serialVersionUID = 2018052601L;
99
100 private String value;
101
102 public TemplateMessageData(String value) {
103 this.value = value;
104 }
105
106 public String getValue() {
107 return value;
108 }
109
110 public void setValue(String value) {
111 this.value = value;
112 }
113
114 }
115
116 }