1 package com.foxinmy.weixin4j.tuple;
2
3 import java.io.Serializable;
4
5 import com.alibaba.fastjson.annotation.JSONField;
6
7
8
9
10
11
12
13
14
15 public class MpArticle implements Serializable {
16
17 private static final long serialVersionUID = 5583479943661639234L;
18
19
20
21
22 @JSONField(name = "thumb_media_id")
23 private String thumbMediaId;
24
25
26
27 @JSONField(name = "thumb_url")
28 private String thumbUrl;
29
30
31
32 private String author;
33
34
35
36 private String title;
37
38
39
40 private String url;
41
42
43
44 @JSONField(name = "content_source_url")
45 private String sourceUrl;
46
47
48
49 private String content;
50
51
52
53 private String digest;
54
55
56
57 @JSONField(name = "show_cover_pic")
58 private String showCoverPic;
59
60
61
62 @JSONField(name = "need_open_comment")
63 private String openComment;
64
65
66
67 @JSONField(name = "only_fans_can_comment")
68 private String onlyFansCanComment;
69
70 protected MpArticle() {
71 }
72
73
74
75
76
77
78
79
80
81 public MpArticle(String thumbMediaId, String title, String content) {
82 this.thumbMediaId = thumbMediaId;
83 this.title = title;
84 this.content = content;
85 }
86
87 public String getThumbMediaId() {
88 return thumbMediaId;
89 }
90
91 public void setThumbMediaId(String thumbMediaId) {
92 this.thumbMediaId = thumbMediaId;
93 }
94
95 public String getThumbUrl() {
96 return thumbUrl;
97 }
98
99 public void setThumbUrl(String thumbUrl) {
100 this.thumbUrl = thumbUrl;
101 }
102
103 public String getAuthor() {
104 return author;
105 }
106
107 public void setAuthor(String author) {
108 this.author = author;
109 }
110
111 public String getTitle() {
112 return title;
113 }
114
115 public void setTitle(String title) {
116 this.title = title;
117 }
118
119 public String getUrl() {
120 return url;
121 }
122
123 public void setUrl(String url) {
124 this.url = url;
125 }
126
127 public String getSourceUrl() {
128 return sourceUrl;
129 }
130
131 public void setSourceUrl(String sourceUrl) {
132 this.sourceUrl = sourceUrl;
133 }
134
135 public String getContent() {
136 return content;
137 }
138
139 public void setContent(String content) {
140 this.content = content;
141 }
142
143 public String getDigest() {
144 return digest;
145 }
146
147 public void setDigest(String digest) {
148 this.digest = digest;
149 }
150
151 public String getShowCoverPic() {
152 return showCoverPic;
153 }
154
155 public void setShowCoverPic(String showCoverPic) {
156 this.showCoverPic = showCoverPic;
157 }
158
159 public void setShowCoverPic(boolean showCoverPic) {
160 this.showCoverPic = showCoverPic ? "1" : "0";
161 }
162
163 @JSONField(serialize = false)
164 public boolean getFormatShowCoverPic() {
165 return this.showCoverPic != null && this.showCoverPic.equals("1");
166 }
167
168 public void setOpenComment(boolean openComment) {
169 this.openComment = openComment ? "1" : "0";
170 }
171
172 public String getOpenComment() {
173 return openComment;
174 }
175
176 public void setOpenComment(String openComment) {
177 this.openComment = openComment;
178 }
179
180 public String getOnlyFansCanComment() {
181 return onlyFansCanComment;
182 }
183
184 public void setOnlyFansCanComment(String onlyFansCanComment) {
185 this.onlyFansCanComment = onlyFansCanComment;
186 }
187
188 @JSONField(serialize = false)
189 public boolean getFormatOpenComment() {
190 return this.openComment != null && this.openComment.equals("1");
191 }
192
193 public void setOnlyFansCanComment(boolean onlyFansCanComment) {
194 this.onlyFansCanComment = onlyFansCanComment ? "1" : "0";
195 }
196
197 @JSONField(serialize = false)
198 public boolean getFormatOnlyFansCanComment() {
199 return this.onlyFansCanComment != null && this.onlyFansCanComment.equals("1");
200 }
201
202 @Override
203 public String toString() {
204 return "MpArticle [thumbMediaId=" + thumbMediaId + ", thumbUrl=" + thumbUrl + ", author=" + author + ", title="
205 + title + ", url=" + url + ", sourceUrl=" + sourceUrl + ", content=" + content + ", digest=" + digest
206 + ", showCoverPic=" + showCoverPic + ", openComment=" + openComment + ", onlyFansCanComment="
207 + onlyFansCanComment + "]";
208 }
209 }