View Javadoc
1   package org.oxerr.youzan.dto.item;
2   
3   import java.io.Serializable;
4   import java.math.BigDecimal;
5   import java.time.Instant;
6   
7   import org.oxerr.youzan.dto.deserializer.InstantDeserializer;
8   
9   import com.fasterxml.jackson.annotation.JsonProperty;
10  import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
11  
12  /**
13   * <a href="http://open.youzan.com/structparam?struct=GoodsQrcode">商品二维码数据结构</a>.
14   */
15  public class GoodsQrcode implements Serializable {
16  
17  	private static final long serialVersionUID = 2016061901L;
18  
19  	/**
20  	 * 商品二维码创建时间,时间格式:yyyy-MM-dd HH:mm:ss
21  	 */
22  	private Instant created;
23  
24  	/**
25  	 * 二维码的名称
26  	 */
27  	private String name;
28  
29  	/**
30  	 * 折扣,格式:9.0;单位:折,精确到小数点后 1 位。如果没有折扣,则为 0
31  	 */
32  	private String discount;
33  
34  	/**
35  	 * 扫码直接购买的二维码基于这个url生成。如果不是扫码直接购买的类型,则为空
36  	 */
37  	private String linkUrl;
38  
39  	/**
40  	 * 商品二维码的ID
41  	 */
42  	private Long id;
43  
44  	/**
45  	 * 商品二维码类型。
46  	 * 可选值:
47  	 * <ul>
48  	 * <li>GOODS_SCAN_FOLLOW(扫码关注后购买商品)</li>
49  	 * <li>GOODS_SCAN_FOLLOW_DECREASE(扫码关注后减优惠额)</li>
50  	 * <li>GOODS_SCAN_FOLLOW_DISCOUNT(扫码关注后折扣)</li>
51  	 * <li>GOODS_SCAN_DECREASE(扫码直接减优惠额)</li>
52  	 * <li>GOODS_SCAN_DISCOUNT(扫码直接折扣)</li>
53  	 * </ul>
54  	 */
55  	private String type;
56  
57  	/**
58  	 * 扫码关注购买的二维码图片地址。
59  	 * 如果不是扫码关注购买的类型,则为空。
60  	 */
61  	private String weixinQrcodeUrl;
62  
63  	/**
64  	 * 减金额优惠,格式:5.00;单位:元;精确到:分。如果没有减额优惠,则为 0。
65  	 */
66  	private BigDecimal decrease;
67  
68  	/**
69  	 * 二维码的描述
70  	 */
71  	private String desc;
72  
73  	public GoodsQrcode() {
74  	}
75  
76  	public GoodsQrcode(
77  		@JsonProperty("created")
78  		@JsonDeserialize(using = InstantDeserializer.class)
79  		Instant created,
80  		@JsonProperty("name") String name,
81  		@JsonProperty("discount") String discount,
82  		@JsonProperty("link_url") String linkUrl,
83  		@JsonProperty("id") Long id,
84  		@JsonProperty("type") String type,
85  		@JsonProperty("weixin_qrcode_url") String weixinQrcodeUrl,
86  		@JsonProperty("decrease") BigDecimal decrease,
87  		@JsonProperty("desc") String desc
88  	) {
89  		this.created = created;
90  		this.name = name;
91  		this.discount = discount;
92  		this.linkUrl = linkUrl;
93  		this.id = id;
94  		this.type = type;
95  		this.weixinQrcodeUrl = weixinQrcodeUrl;
96  		this.decrease = decrease;
97  		this.desc = desc;
98  	}
99  
100 	public Instant getCreated() {
101 		return created;
102 	}
103 
104 	public void setCreated(Instant created) {
105 		this.created = created;
106 	}
107 
108 	public String getName() {
109 		return name;
110 	}
111 
112 	public void setName(String name) {
113 		this.name = name;
114 	}
115 
116 	public String getDiscount() {
117 		return discount;
118 	}
119 
120 	public void setDiscount(String discount) {
121 		this.discount = discount;
122 	}
123 
124 	public String getLinkUrl() {
125 		return linkUrl;
126 	}
127 
128 	public void setLinkUrl(String linkUrl) {
129 		this.linkUrl = linkUrl;
130 	}
131 
132 	public Long getId() {
133 		return id;
134 	}
135 
136 	public void setId(Long id) {
137 		this.id = id;
138 	}
139 
140 	public String getType() {
141 		return type;
142 	}
143 
144 	public void setType(String type) {
145 		this.type = type;
146 	}
147 
148 	public String getWeixinQrcodeUrl() {
149 		return weixinQrcodeUrl;
150 	}
151 
152 	public void setWeixinQrcodeUrl(String weixinQrcodeUrl) {
153 		this.weixinQrcodeUrl = weixinQrcodeUrl;
154 	}
155 
156 	public BigDecimal getDecrease() {
157 		return decrease;
158 	}
159 
160 	public void setDecrease(BigDecimal decrease) {
161 		this.decrease = decrease;
162 	}
163 
164 	public String getDesc() {
165 		return desc;
166 	}
167 
168 	public void setDesc(String desc) {
169 		this.desc = desc;
170 	}
171 
172 }