1414 */
1515public class WxMpCustomMessage implements Serializable {
1616 private static final long serialVersionUID = -9196732086954365246L ;
17-
17+
1818 private String toUser ;
1919 private String msgType ;
2020 private String content ;
@@ -25,8 +25,9 @@ public class WxMpCustomMessage implements Serializable {
2525 private String musicUrl ;
2626 private String hqMusicUrl ;
2727 private String kfAccount ;
28+ private String cardId ;
2829 private List <WxArticle > articles = new ArrayList <>();
29-
30+
3031 public String getToUser () {
3132 return this .toUser ;
3233 }
@@ -36,7 +37,7 @@ public void setToUser(String toUser) {
3637 public String getMsgType () {
3738 return this .msgType ;
3839 }
39-
40+
4041 /**
4142 * <pre>
4243 * 请使用
@@ -46,6 +47,7 @@ public String getMsgType() {
4647 * {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_MUSIC}
4748 * {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_VIDEO}
4849 * {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_NEWS}
50+ * {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_WXCARD}
4951 * </pre>
5052 * @param msgType
5153 */
@@ -94,24 +96,33 @@ public String getHqMusicUrl() {
9496 public void setHqMusicUrl (String hqMusicUrl ) {
9597 this .hqMusicUrl = hqMusicUrl ;
9698 }
99+
100+ public String getCardId () {
101+ return cardId ;
102+ }
103+
104+ public void setCardId (String cardId ) {
105+ this .cardId = cardId ;
106+ }
107+
97108 public List <WxArticle > getArticles () {
98109 return this .articles ;
99110 }
100111 public void setArticles (List <WxArticle > articles ) {
101112 this .articles = articles ;
102113 }
103-
114+
104115 public String toJson () {
105116 return WxMpGsonBuilder .INSTANCE .create ().toJson (this );
106117 }
107-
118+
108119 public static class WxArticle {
109-
120+
110121 private String title ;
111122 private String description ;
112123 private String url ;
113124 private String picUrl ;
114-
125+
115126 public String getTitle () {
116127 return this .title ;
117128 }
@@ -136,9 +147,9 @@ public String getPicUrl() {
136147 public void setPicUrl (String picUrl ) {
137148 this .picUrl = picUrl ;
138149 }
139-
150+
140151 }
141-
152+
142153 /**
143154 * 获得文本消息builder
144155 */
@@ -159,34 +170,42 @@ public static ImageBuilder IMAGE() {
159170 public static VoiceBuilder VOICE () {
160171 return new VoiceBuilder ();
161172 }
162-
173+
163174 /**
164175 * 获得视频消息builder
165176 */
166177 public static VideoBuilder VIDEO () {
167178 return new VideoBuilder ();
168179 }
169-
180+
170181 /**
171182 * 获得音乐消息builder
172183 */
173184 public static MusicBuilder MUSIC () {
174185 return new MusicBuilder ();
175186 }
176-
187+
177188 /**
178189 * 获得图文消息builder
179190 */
180191 public static NewsBuilder NEWS () {
181192 return new NewsBuilder ();
182193 }
183-
194+
195+
196+ /**
197+ * 获得卡券消息builder
198+ * @return
199+ */
200+ public static WxCardBuilder WXCARD () {
201+ return new WxCardBuilder ();
202+ }
203+
184204 public String getKfAccount () {
185205 return this .kfAccount ;
186206 }
187-
207+
188208 public void setKfAccount (String kfAccount ) {
189209 this .kfAccount = kfAccount ;
190210 }
191-
192211}
0 commit comments