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 SubscribeMessageParameter 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 Map<String, SubscribeMessageData> data;
17
18 public SubscribeMessageParameter() {
19
20 }
21
22 public SubscribeMessageParameter(
23 String toUser,
24 String templateId,
25 String page,
26 Map<String, String> data
27 ) {
28 this.toUser = toUser;
29 this.templateId = templateId;
30 this.page = page;
31 if (data != null) {
32 this.data = new HashMap<String, SubscribeMessageData>(data.size());
33 for (Map.Entry<String, String> entry : data.entrySet()) {
34 this.data.put(entry.getKey(), new SubscribeMessageData(entry.getValue()));
35 }
36 }
37 }
38
39 @JSONField(name = "touser")
40 public String getToUser() {
41 return toUser;
42 }
43
44 public void setToUser(String toUser) {
45 this.toUser = toUser;
46 }
47
48 @JSONField(name = "template_id")
49 public String getTemplateId() {
50 return templateId;
51 }
52
53 public void setTemplateId(String templateId) {
54 this.templateId = templateId;
55 }
56
57 public String getPage() {
58 return page;
59 }
60
61 public void setPage(String page) {
62 this.page = page;
63 }
64
65 public Map<String, SubscribeMessageData> getData() {
66 return data;
67 }
68
69 public void setData(Map<String, SubscribeMessageData> data) {
70 this.data = data;
71 }
72
73
74
75
76
77 public static class SubscribeMessageData implements Serializable {
78
79 private static final long serialVersionUID = 2018052601L;
80
81 private String value;
82
83 public SubscribeMessageData() {
84
85 }
86
87 public SubscribeMessageData(String value) {
88 this.value = value;
89 }
90
91 public String getValue() {
92 return value;
93 }
94
95 public void setValue(String value) {
96 this.value = value;
97 }
98
99 }
100
101 }