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   import java.util.Map;
7   
8   import org.apache.commons.lang3.StringEscapeUtils;
9   import org.oxerr.youzan.dto.deserializer.EpochSecondStringDeserializer;
10  import org.oxerr.youzan.dto.deserializer.InstantDeserializer;
11  
12  import com.fasterxml.jackson.annotation.JsonProperty;
13  import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
14  
15  /**
16   * <a href="http://open.youzan.com/structparam?struct=GoodsDetail">商品数据结构</a>.
17   */
18  public class GoodsDetail implements Serializable {
19  
20  	private static final long serialVersionUID = 2016061901L;
21  
22  	/**
23  	 * 是否为虚拟商品
24  	 */
25  	private Boolean isVirtual;
26  
27  	/**
28  	 * 商品定时上架(定时开售)的时间。没设置则为空
29  	 */
30  	private Instant autoListingTime;
31  
32  	/**
33  	 * 适合wap应用的商品详情url
34  	 */
35  	private String detailUrl;
36  
37  	/**
38  	 * 运费(针对“统一运费”),格式:5.00;单位:元;精确到:分。
39  	 */
40  	private BigDecimal postFee;
41  
42  	/**
43  	 * Sku列表
44  	 */
45  	private GoodsSku[] skus;
46  
47  	/**
48  	 * 商品二维码列表。
49  	 * 注:仅 kdt.item.get 和 kdt.items.custom.get 接口会返回该字段。
50  	 */
51  	private GoodsQrcode[] itemQrcodes;
52  
53  	/**
54  	 * 可购买该商品的会员等级id列表
55  	 */
56  	private String[] umpLevel;
57  
58  	/**
59  	 * 商品推广栏目id,可参考API:kdt.itemcategories.promotions.get
60  	 */
61  	private Long promotionCid;
62  
63  	/**
64  	 * 每人限购多少件。0代表无限购,默认为0。
65  	 */
66  	private Long buyQuota;
67  
68  	/**
69  	 * 商品类型。
70  	 * <ul>
71  	 * <li>0:普通商品</li>
72  	 * <li>10:分销商品</li>
73  	 * </ul>
74  	 */
75  	private Integer itemType;
76  
77  	/**
78  	 * 商品数量
79  	 */
80  	private Long num;
81  
82  	/**
83  	 * 运费(针对“运费模版”),格式:5.00;单位:元;精确到:分。
84  	 * 若存在运费区间,中间用逗号隔开,如 “5.00,9.00”。
85  	 */
86  	private String deliveryTemplateFee;
87  
88  	/**
89  	 * 模板名称
90  	 */
91  	private String templateTitle;
92  
93  	/**
94  	 * 商品数字编号
95  	 */
96  	private Long numIid;
97  
98  	/**
99  	 * 商品标题
100 	 */
101 	private String title;
102 
103 	/**
104 	 * 商品货号(商家为商品设置的外部编号,可与商家外部系统对接)
105 	 */
106 	private String outerId;
107 
108 	/**
109 	 * 是否参加会员折扣
110 	 */
111 	private Boolean joinLevelDiscount;
112 
113 	/**
114 	 * 是否设置商品购买权限
115 	 */
116 	private Integer purchaseRight;
117 
118 	/**
119 	 * 可购买该商品的用户标签名称列表
120 	 */
121 	private String[] umpTagsText;
122 
123 	/**
124 	 * 商品价格,格式:5.00;单位:元;精确到:分。
125 	 */
126 	private BigDecimal price;
127 
128 	/**
129 	 * 商品别称
130 	 */
131 	private String alias;
132 
133 	/**
134 	 * 运费类型。
135 	 * <ul>
136 	 * <li>1:统一邮费;</li>
137 	 * <li>2:运费模版;</li>
138 	 * </ul>
139 	 */
140 	private Integer postType;
141 
142 	/**
143 	 * 可购买该商品的会员等级名称列表
144 	 */
145 	private String[] umpLevelText;
146 
147 	/**
148 	 * 运费模版名称
149 	 */
150 	private String deliveryTemplateName;
151 
152 	/**
153 	 * 商品序号
154 	 */
155 	private Long order;
156 
157 	/**
158 	 * 可购买该商品的用户标签id列表
159 	 */
160 	private String[] umpTags;
161 
162 	/**
163 	 * 商品标签id串,结构如:1234,1342,...,可参考API:kdt.itemcategories.tags.get
164 	 */
165 	private String tagIds;
166 
167 	/**
168 	 * 是否是供货商商品。
169 	 */
170 	private Boolean isSupplierItem;
171 
172 	/**
173 	 * 商品点赞数
174 	 */
175 	private Long likeCount;
176 
177 	/**
178 	 * 商品标签数据结构
179 	 */
180 	private GoodsTag[] itemTags;
181 
182 	/**
183 	 * 商品的发布时间
184 	 */
185 	private Instant created;
186 
187 	/**
188 	 * 商品图片列表
189 	 */
190 	private GoodsImage[] itemImgs;
191 
192 	/**
193 	 * 商品上架状态。true 为已上架,false 为已下架
194 	 */
195 	private Boolean isListing;
196 
197 	/**
198 	 * 是否为二手商品
199 	 */
200 	private Boolean isUsed;
201 
202 	/**
203 	 * 商品销量
204 	 */
205 	private Long soldNum;
206 
207 	/**
208 	 * 商品外部购买链接
209 	 */
210 	private String outerBuyUrl;
211 
212 	/**
213 	 * 是否为二手商品
214 	 */
215 	private String productType;
216 
217 	/**
218 	 * 分享出去的商品详情url
219 	 */
220 	private String shareUrl;
221 
222 	/**
223 	 * 商品主图片缩略图地址
224 	 */
225 	private String picThumbUrl;
226 
227 	/**
228 	 * 运费模版id
229 	 */
230 	private Long deliveryTemplateId;
231 
232 	/**
233 	 * 商品是否锁定。true 为已锁定,false 为未锁定
234 	 */
235 	private Boolean isLock;
236 
237 	/**
238 	 * 商品留言
239 	 */
240 	private Map<String, String>[] messages;
241 
242 	/**
243 	 * 模板id
244 	 */
245 	private Long templateId;
246 
247 	/**
248 	 * 显示在“原价”一栏中的信息
249 	 */
250 	private String originPrice;
251 
252 	/**
253 	 * 商品主图片地址
254 	 */
255 	private String picUrl;
256 
257 	/**
258 	 * 商品分类的叶子类目id,可参考API:kdt.itemcategories.get
259 	 */
260 	private Long cid;
261 
262 	/**
263 	 * 商品描述
264 	 */
265 	private String desc;
266 
267 	public GoodsDetail() {
268 	}
269 
270 	public GoodsDetail(
271 		@JsonProperty("is_virtual") Boolean isVirtual,
272 		@JsonProperty("auto_listing_time")
273 		@JsonDeserialize(using = EpochSecondStringDeserializer.class)
274 		Instant autoListingTime,
275 		@JsonProperty("detail_url") String detailUrl,
276 		@JsonProperty("post_fee") BigDecimal postFee,
277 		@JsonProperty("skus") GoodsSku[] skus,
278 		@JsonProperty("item_qrcodes") GoodsQrcode[] itemQrcodes,
279 		@JsonProperty("ump_level") String[] umpLevel,
280 		@JsonProperty("promotion_cid") Long promotionCid,
281 		@JsonProperty("buy_quota") Long buyQuota,
282 		@JsonProperty("item_type") Integer itemType,
283 		@JsonProperty("num") Long num,
284 		@JsonProperty("delivery_template_fee") String deliveryTemplateFee,
285 		@JsonProperty("template_title") String templateTitle,
286 		@JsonProperty("num_iid") Long numIid,
287 		@JsonProperty("title") String title,
288 		@JsonProperty("outer_id") String outerId,
289 		@JsonProperty("join_level_discount") String joinLevelDiscount,
290 		@JsonProperty("purchase_right") Integer purchaseRight,
291 		@JsonProperty("ump_tags_text") String[] umpTagsText,
292 		@JsonProperty("price") BigDecimal price,
293 		@JsonProperty("alias") String alias,
294 		@JsonProperty("post_type") Integer postType,
295 		@JsonProperty("ump_level_text") String[] umpLevelText,
296 		@JsonProperty("delivery_template_name") String deliveryTemplateName,
297 		@JsonProperty("order") Long order,
298 		@JsonProperty("ump_tags") String[] umpTags,
299 		@JsonProperty("tag_ids") String tagIds,
300 		@JsonProperty("is_supplier_item") Boolean isSupplierItem,
301 		@JsonProperty("like_count") Long likeCount,
302 		@JsonProperty("item_tags") GoodsTag[] itemTags,
303 		@JsonProperty("created")
304 		@JsonDeserialize(using = InstantDeserializer.class)
305 		Instant created,
306 		@JsonProperty("item_imgs") GoodsImage[] itemImgs,
307 		@JsonProperty("is_listing") Boolean isListing,
308 		@JsonProperty("is_used") Boolean isUsed,
309 		@JsonProperty("sold_num") Long soldNum,
310 		@JsonProperty("outer_buy_url") String outerBuyUrl,
311 		@JsonProperty("product_type") String productType,
312 		@JsonProperty("share_ur") String shareUrl,
313 		@JsonProperty("pic_thumb_url") String picThumbUrl,
314 		@JsonProperty("delivery_template_id") Long deliveryTemplateId,
315 		@JsonProperty("is_lock") Boolean isLock,
316 		@JsonProperty("messages") Map<String, String>[] messages,
317 		@JsonProperty("template_id") Long templateId,
318 		@JsonProperty("origin_price") String originPrice,
319 		@JsonProperty("pic_url") String picUrl,
320 		@JsonProperty("cid") Long cid,
321 		@JsonProperty("desc") String desc
322 	) {
323 		this.isVirtual = isVirtual;
324 		this.autoListingTime = autoListingTime;
325 		this.detailUrl = detailUrl;
326 		this.postFee = postFee;
327 		this.skus = skus;
328 		this.itemQrcodes = itemQrcodes;
329 		this.umpLevel = umpLevel;
330 		this.promotionCid = promotionCid;
331 		this.buyQuota = buyQuota;
332 		this.itemType = itemType;
333 		this.num = num;
334 		this.deliveryTemplateFee = deliveryTemplateFee;
335 		this.templateTitle = templateTitle;
336 		this.numIid = numIid;
337 		this.title = title;
338 		this.outerId = outerId;
339 		this.joinLevelDiscount = "1".equals(joinLevelDiscount);
340 		this.purchaseRight = purchaseRight;
341 		this.umpTagsText = umpTagsText;
342 		this.price = price;
343 		this.alias = alias;
344 		this.postType = postType;
345 		this.umpLevelText = umpLevelText;
346 		this.deliveryTemplateName = deliveryTemplateName;
347 		this.order = order;
348 		this.umpTags = umpTags;
349 		this.tagIds = tagIds;
350 		this.isSupplierItem = isSupplierItem;
351 		this.likeCount = likeCount;
352 		this.itemTags = itemTags;
353 		this.created = created;
354 		this.itemImgs = itemImgs;
355 		this.isListing = isListing;
356 		this.isUsed = isUsed;
357 		this.soldNum = soldNum;
358 		this.outerBuyUrl = outerBuyUrl;
359 		this.productType = productType;
360 		this.shareUrl = shareUrl;
361 		this.picThumbUrl = picThumbUrl;
362 		this.deliveryTemplateId = deliveryTemplateId;
363 		this.isLock = isLock;
364 		this.messages = messages;
365 		this.templateId = templateId;
366 		this.originPrice = originPrice;
367 		this.picUrl = picUrl;
368 		this.cid = cid;
369 		this.desc = desc;
370 	}
371 
372 	public Boolean getIsVirtual() {
373 		return isVirtual;
374 	}
375 
376 	public void setIsVirtual(Boolean isVirtual) {
377 		this.isVirtual = isVirtual;
378 	}
379 
380 	public Instant getAutoListingTime() {
381 		return autoListingTime;
382 	}
383 
384 	public void setAutoListingTime(Instant autoListingTime) {
385 		this.autoListingTime = autoListingTime;
386 	}
387 
388 	public String getDetailUrl() {
389 		return detailUrl;
390 	}
391 
392 	public void setDetailUrl(String detailUrl) {
393 		this.detailUrl = detailUrl;
394 	}
395 
396 	public BigDecimal getPostFee() {
397 		return postFee;
398 	}
399 
400 	public void setPostFee(BigDecimal postFee) {
401 		this.postFee = postFee;
402 	}
403 
404 	public GoodsSku[] getSkus() {
405 		return skus;
406 	}
407 
408 	public void setSkus(GoodsSku[] skus) {
409 		this.skus = skus;
410 	}
411 
412 	public GoodsQrcode[] getItemQrcodes() {
413 		return itemQrcodes;
414 	}
415 
416 	public void setItemQrcodes(GoodsQrcode[] itemQrcodes) {
417 		this.itemQrcodes = itemQrcodes;
418 	}
419 
420 	public String[] getUmpLevel() {
421 		return umpLevel;
422 	}
423 
424 	public void setUmpLevel(String[] umpLevel) {
425 		this.umpLevel = umpLevel;
426 	}
427 
428 	public Long getPromotionCid() {
429 		return promotionCid;
430 	}
431 
432 	public void setPromotionCid(Long promotionCid) {
433 		this.promotionCid = promotionCid;
434 	}
435 
436 	public Long getBuyQuota() {
437 		return buyQuota;
438 	}
439 
440 	public void setBuyQuota(Long buyQuota) {
441 		this.buyQuota = buyQuota;
442 	}
443 
444 	public Integer getItemType() {
445 		return itemType;
446 	}
447 
448 	public void setItemType(Integer itemType) {
449 		this.itemType = itemType;
450 	}
451 
452 	public Long getNum() {
453 		return num;
454 	}
455 
456 	public void setNum(Long num) {
457 		this.num = num;
458 	}
459 
460 	public String getDeliveryTemplateFee() {
461 		return deliveryTemplateFee;
462 	}
463 
464 	public void setDeliveryTemplateFee(String deliveryTemplateFee) {
465 		this.deliveryTemplateFee = deliveryTemplateFee;
466 	}
467 
468 	public String getTemplateTitle() {
469 		return templateTitle;
470 	}
471 
472 	public void setTemplateTitle(String templateTitle) {
473 		this.templateTitle = templateTitle;
474 	}
475 
476 	public Long getNumIid() {
477 		return numIid;
478 	}
479 
480 	public void setNumIid(Long numIid) {
481 		this.numIid = numIid;
482 	}
483 
484 	public String getTitle() {
485 		return title;
486 	}
487 
488 	public void setTitle(String title) {
489 		this.title = StringEscapeUtils.unescapeHtml4(title);
490 	}
491 
492 	public String getOuterId() {
493 		return outerId;
494 	}
495 
496 	public void setOuterId(String outerId) {
497 		this.outerId = outerId;
498 	}
499 
500 	public Boolean getJoinLevelDiscount() {
501 		return joinLevelDiscount;
502 	}
503 
504 	public void setJoinLevelDiscount(Boolean joinLevelDiscount) {
505 		this.joinLevelDiscount = joinLevelDiscount;
506 	}
507 
508 	public Integer getPurchaseRight() {
509 		return purchaseRight;
510 	}
511 
512 	public void setPurchaseRight(Integer purchaseRight) {
513 		this.purchaseRight = purchaseRight;
514 	}
515 
516 	public String[] getUmpTagsText() {
517 		return umpTagsText;
518 	}
519 
520 	public void setUmpTagsText(String[] umpTagsText) {
521 		this.umpTagsText = umpTagsText;
522 	}
523 
524 	public BigDecimal getPrice() {
525 		return price;
526 	}
527 
528 	public void setPrice(BigDecimal price) {
529 		this.price = price;
530 	}
531 
532 	public String getAlias() {
533 		return alias;
534 	}
535 
536 	public void setAlias(String alias) {
537 		this.alias = alias;
538 	}
539 
540 	public Integer getPostType() {
541 		return postType;
542 	}
543 
544 	public void setPostType(Integer postType) {
545 		this.postType = postType;
546 	}
547 
548 	public String[] getUmpLevelText() {
549 		return umpLevelText;
550 	}
551 
552 	public void setUmpLevelText(String[] umpLevelText) {
553 		this.umpLevelText = umpLevelText;
554 	}
555 
556 	public String getDeliveryTemplateName() {
557 		return deliveryTemplateName;
558 	}
559 
560 	public void setDeliveryTemplateName(String deliveryTemplateName) {
561 		this.deliveryTemplateName = deliveryTemplateName;
562 	}
563 
564 	public Long getOrder() {
565 		return order;
566 	}
567 
568 	public void setOrder(Long order) {
569 		this.order = order;
570 	}
571 
572 	public String[] getUmpTags() {
573 		return umpTags;
574 	}
575 
576 	public void setUmpTags(String[] umpTags) {
577 		this.umpTags = umpTags;
578 	}
579 
580 	public String getTagIds() {
581 		return tagIds;
582 	}
583 
584 	public void setTagIds(String tagIds) {
585 		this.tagIds = tagIds;
586 	}
587 
588 	public Boolean getIsSupplierItem() {
589 		return isSupplierItem;
590 	}
591 
592 	public void setIsSupplierItem(Boolean isSupplierItem) {
593 		this.isSupplierItem = isSupplierItem;
594 	}
595 
596 	public Long getLikeCount() {
597 		return likeCount;
598 	}
599 
600 	public void setLikeCount(Long likeCount) {
601 		this.likeCount = likeCount;
602 	}
603 
604 	public GoodsTag[] getItemTags() {
605 		return itemTags;
606 	}
607 
608 	public void setItemTags(GoodsTag[] itemTags) {
609 		this.itemTags = itemTags;
610 	}
611 
612 	public Instant getCreated() {
613 		return created;
614 	}
615 
616 	public void setCreated(Instant created) {
617 		this.created = created;
618 	}
619 
620 	public GoodsImage[] getItemImgs() {
621 		return itemImgs;
622 	}
623 
624 	public void setItemImgs(GoodsImage[] itemImgs) {
625 		this.itemImgs = itemImgs;
626 	}
627 
628 	public Boolean getIsListing() {
629 		return isListing;
630 	}
631 
632 	public void setIsListing(Boolean isListing) {
633 		this.isListing = isListing;
634 	}
635 
636 	public Boolean getIsUsed() {
637 		return isUsed;
638 	}
639 
640 	public void setIsUsed(Boolean isUsed) {
641 		this.isUsed = isUsed;
642 	}
643 
644 	public Long getSoldNum() {
645 		return soldNum;
646 	}
647 
648 	public void setSoldNum(Long soldNum) {
649 		this.soldNum = soldNum;
650 	}
651 
652 	public String getOuterBuyUrl() {
653 		return outerBuyUrl;
654 	}
655 
656 	public void setOuterBuyUrl(String outerBuyUrl) {
657 		this.outerBuyUrl = outerBuyUrl;
658 	}
659 
660 	public String getProductType() {
661 		return productType;
662 	}
663 
664 	public void setProductType(String productType) {
665 		this.productType = productType;
666 	}
667 
668 	public String getShareUrl() {
669 		return shareUrl;
670 	}
671 
672 	public void setShareUrl(String shareUrl) {
673 		this.shareUrl = shareUrl;
674 	}
675 
676 	public String getPicThumbUrl() {
677 		return picThumbUrl;
678 	}
679 
680 	public void setPicThumbUrl(String picThumbUrl) {
681 		this.picThumbUrl = picThumbUrl;
682 	}
683 
684 	public Long getDeliveryTemplateId() {
685 		return deliveryTemplateId;
686 	}
687 
688 	public void setDeliveryTemplateId(Long deliveryTemplateId) {
689 		this.deliveryTemplateId = deliveryTemplateId;
690 	}
691 
692 	public Boolean getIsLock() {
693 		return isLock;
694 	}
695 
696 	public void setIsLock(Boolean isLock) {
697 		this.isLock = isLock;
698 	}
699 
700 	public Map<String, String>[] getMessages() {
701 		return messages;
702 	}
703 
704 	public void setMessages(Map<String, String>[] messages) {
705 		this.messages = messages;
706 	}
707 
708 	public Long getTemplateId() {
709 		return templateId;
710 	}
711 
712 	public void setTemplateId(Long templateId) {
713 		this.templateId = templateId;
714 	}
715 
716 	public String getOriginPrice() {
717 		return originPrice;
718 	}
719 
720 	public void setOriginPrice(String originPrice) {
721 		this.originPrice = originPrice;
722 	}
723 
724 	public String getPicUrl() {
725 		return picUrl;
726 	}
727 
728 	public void setPicUrl(String picUrl) {
729 		this.picUrl = picUrl;
730 	}
731 
732 	public Long getCid() {
733 		return cid;
734 	}
735 
736 	public void setCid(Long cid) {
737 		this.cid = cid;
738 	}
739 
740 	public String getDesc() {
741 		return desc;
742 	}
743 
744 	public void setDesc(String desc) {
745 		this.desc = desc;
746 	}
747 
748 }