View Javadoc
1   package com.foxinmy.weixin4j.tuple;
2   
3   import javax.xml.bind.annotation.XmlElement;
4   
5   import com.alibaba.fastjson.annotation.JSONCreator;
6   import com.alibaba.fastjson.annotation.JSONField;
7   
8   /**
9    * 卡券对象
10   * <p>
11   * <font color="red">可用于「群发消息」和「客服消息」</font>
12   * </p>
13   *
14   * @className Card
15   * @author jinyu(foxinmy@gmail.com)
16   * @date 2015年6月8日
17   * @since JDK 1.6
18   * @see
19   */
20  public class Card implements MassTuple, NotifyTuple {
21  
22      private static final long serialVersionUID = 6119453633595102147L;
23  
24      @Override
25      public String getMessageType() {
26          return "wxcard";
27      }
28  
29      /**
30       * 上传后的微信返回的媒体ID
31       */
32      @JSONField(name = "card_id")
33      @XmlElement(name = "CardId")
34      private String cardId;
35  
36      @JSONCreator
37      public Card(@JSONField(name = "cardId") String cardId) {
38          this.cardId = cardId;
39      }
40  
41      public String getCardId() {
42          return cardId;
43      }
44  
45      @Override
46      public String toString() {
47          return "Card [cardId=" + cardId + "]";
48      }
49  }