New file |
| | |
| | | package com.yeshi.fanli.util.factory;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.CollectionGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.goods.CommonGoods;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | public class CollectionGoodsV2Factory {
|
| | |
|
| | | public static CollectionGoodsV2 create(CollectionGoods collectionGoods) {
|
| | | if (collectionGoods == null)
|
| | | return null;
|
| | | CollectionGoodsV2 cg = new CollectionGoodsV2();
|
| | | cg.setId(collectionGoods.getId());
|
| | | TaoBaoGoodsBrief taoBaoGoods = TaoBaoUtil.getTaoBaoGoodsBrief(collectionGoods);
|
| | | CommonGoods commonGoods = CommonGoodsFactory.create(taoBaoGoods);
|
| | | cg.setCommonGoods(commonGoods);
|
| | | cg.setCreateTime(new Date(collectionGoods.getCreateTime()));
|
| | | cg.setUpdateTime(new Date(collectionGoods.getCreateTime()));
|
| | | cg.setUserInfo(collectionGoods.getUserInfo());
|
| | | return cg;
|
| | | }
|
| | |
|
| | | }
|