View Javadoc
1   package com.foxinmy.weixin4j.model.card;
2   
3   import com.alibaba.fastjson.annotation.JSONField;
4   import com.foxinmy.weixin4j.type.card.CardType;
5   
6   /**
7    * 折扣券
8    * 
9    * @className DiscountCoupon
10   * @author jinyu(foxinmy@gmail.com)
11   * @date 2016年8月4日
12   * @since JDK 1.6
13   */
14  public class DiscountCoupon extends CardCoupon {
15  	/**
16  	 * 打折额度百分比
17  	 */
18  	private final int discount;
19  
20  	/**
21  	 * 构造折扣券
22  	 * 
23  	 * @param couponBaseInfo
24  	 *            基础信息
25  	 * @param discount
26  	 *            打折额度百分百,如:传入30就是七折。
27  	 */
28  	public DiscountCoupon(CouponBaseInfo couponBaseInfo, int discount) {
29  		super(couponBaseInfo);
30  		this.discount = discount;
31  	}
32  
33  	public int getDiscount() {
34  		return discount;
35  	}
36  
37  	@JSONField(serialize = false)
38  	@Override
39  	public CardType getCardType() {
40  		return CardType.DISCOUNT;
41  	}
42  
43  	@Override
44  	public String toString() {
45  		return "DiscountCoupon [discount=" + discount + ", " + super.toString()
46  				+ "]";
47  	}
48  }