1 package com.foxinmy.weixin4j.model.card;
2
3 import com.alibaba.fastjson.JSONArray;
4 import com.alibaba.fastjson.JSONObject;
5 import com.alibaba.fastjson.annotation.JSONField;
6
7
8
9
10
11
12
13 public class GiftCardPage {
14 @JSONField(name = "page_id")
15 private String pageId;
16
17
18
19 @JSONField(name = "page_title")
20 private String title;
21
22
23
24 @JSONField(name = "support_multi")
25 private Boolean supportMulti;
26
27
28
29 @JSONField(name = "support_buy_for_self")
30 private Boolean supportBuyForSelf;
31
32
33
34 @JSONField(name = "banner_pic_url")
35 private String bannerPicUrl;
36
37
38
39 @JSONField(name = "theme_list")
40 private JSONArray themeList;
41
42
43
44 @JSONField(name = "category_list")
45 private JSONArray categoryList;
46
47
48
49 private String address;
50
51
52
53 @JSONField(name = "service_phone")
54 private String servicePhone;
55
56
57
58 @JSONField(name = "biz_description")
59 private String description;
60
61
62
63 @JSONField(name = "need_receipt")
64 private Boolean needReceipt;
65
66
67
68 @JSONField(name = "cell_1")
69 private JSONObject cell1;
70
71
72
73 @JSONField(name = "cell_2")
74 private JSONObject cell2;
75
76 public String getPageId() { return pageId; }
77
78 public String getTitle() {
79 return title;
80 }
81
82 public Boolean getSupportMulti() {
83 return supportMulti;
84 }
85
86 public Boolean getSupportBuyForSelf() {
87 return supportBuyForSelf;
88 }
89
90 public String getBannerPicUrl() {
91 return bannerPicUrl;
92 }
93
94 public JSONArray getThemeList() {
95 return themeList;
96 }
97
98 public JSONArray getCategoryList() {
99 return categoryList;
100 }
101
102 public String getAddress() {
103 return address;
104 }
105
106 public String getServicePhone() {
107 return servicePhone;
108 }
109
110 public String getDescription() {
111 return description;
112 }
113
114 public Boolean getNeedReceipt() {
115 return needReceipt;
116 }
117
118 public JSONObject getCell1() {
119 return cell1;
120 }
121
122 public JSONObject getCell2() {
123 return cell2;
124 }
125
126 public GiftCardPage(Builder builder){
127 this.pageId = builder.pageId;
128 this.address = builder.address;
129 this.bannerPicUrl = builder.bannerPicUrl;
130 this.categoryList = builder.categoryList;
131 this.cell1 = builder.cell1;
132 this.cell2 = builder.cell2;
133 this.description = builder.description;
134 this.needReceipt = builder.needReceipt;
135 this.servicePhone = builder.servicePhone;
136 this.supportBuyForSelf = builder.supportBuyForSelf;
137 this.supportMulti = builder.supportMulti;
138 this.themeList = builder.themeList;
139 this.title = builder.title;
140 }
141
142 public static class Builder{
143
144
145
146 private String pageId;
147
148
149
150 private String title;
151
152
153
154 private Boolean supportMulti;
155
156
157
158 private Boolean supportBuyForSelf;
159
160
161
162 private String bannerPicUrl;
163
164
165
166 private JSONArray themeList;
167
168
169
170 private JSONArray categoryList;
171
172
173
174 private String address;
175
176
177
178 private String servicePhone;
179
180
181
182 private String description;
183
184
185
186 private Boolean needReceipt;
187
188
189
190 private JSONObject cell1;
191
192
193
194 private JSONObject cell2;
195
196 public Builder(){
197 this.themeList = new JSONArray();
198 this.categoryList = null;
199 }
200
201 public Builder pageId(String pageId){
202 this.pageId = pageId;
203 return this;
204 }
205
206
207
208
209
210
211
212 public Builder title(String title){
213 this.title = title;
214 return this;
215 }
216
217
218
219
220
221
222
223 public Builder supportMulti(boolean supportMulti){
224 this.supportMulti = Boolean.valueOf(supportMulti);
225 return this;
226 }
227
228
229
230
231
232
233
234 public Builder supportBuyForSelf(boolean supportBuyForSelf){
235 this.supportBuyForSelf = Boolean.valueOf(supportBuyForSelf);
236 return this;
237 }
238
239
240
241
242
243
244
245 public Builder bannerPicUrl(String url){
246 this.bannerPicUrl = url;
247 return this;
248 }
249
250
251
252
253
254
255
256 public Builder themeList(PageTheme theme){
257 this.themeList.add(theme);
258 return this;
259 }
260
261
262
263
264
265
266
267 public Builder categoryList(String title){
268 if(this.categoryList==null){
269 this.categoryList = new JSONArray();
270 }
271 JSONObject category = new JSONObject();
272 category.put("title", title);
273 this.categoryList.add(category);
274 return this;
275 }
276
277
278
279
280
281
282
283 public Builder address(String address){
284 this.address = address;
285 return this;
286 }
287
288
289
290
291
292
293
294 public Builder servicePhone(String phoneNo){
295 this.servicePhone = phoneNo;
296 return this;
297 }
298
299
300
301
302
303
304
305 public Builder description(String description){
306 this.description = description;
307 return this;
308 }
309
310
311
312
313
314
315
316 public Builder needReceipt(boolean needReceipt){
317 this.needReceipt = Boolean.valueOf(needReceipt);
318 return this;
319 }
320
321
322
323
324
325
326
327
328 public Builder cell1(String title, String url){
329 JSONObject cell = new JSONObject();
330 cell.put("title", title);
331 cell.put("url", url);
332 this.cell1 = cell;
333 return this;
334 }
335
336
337
338
339
340
341
342
343 public Builder cell2(String title, String url){
344 JSONObject cell = new JSONObject();
345 cell.put("title", title);
346 cell.put("url", url);
347 this.cell2 = cell;
348 return this;
349 }
350 }
351 }