| | |
| | | import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.goods.JDCommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.goods.PDDCommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | @RequestMapping("api/v2/commoncontent")
|
| | | public class CommonContentControllerV2 {
|
| | |
|
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | | |
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (type == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传入类型"));
|
| | | return;
|
| | | }
|
| | | |
| | | List<CommonContentNav> list = null;
|
| | | if (type == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | if (type == null || type == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | list = commonTemplateContentService.getNavList(CommonContentTypeEnum.valueOf(key));
|
| | | } else if (type == Constant.SOURCE_TYPE_JD) {
|
| | | // 暂无分类
|
| | | } else if (type == Constant.SOURCE_TYPE_PDD) {
|
| | | // 暂无分类
|
| | | list = pddCommonTemplateContentService.getNavList(PDDCommonContentTypeEnum.valueOf(key));
|
| | | }
|
| | |
|
| | | if (list == null) {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (type == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传入类型"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (type == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | if (type == null || type == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | getListTB(acceptData, key, page, cid, out);
|
| | | return;
|
| | | }
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | for (JDGoods goods : goodsList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, null, fanLiRate, shareRate)));
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate)));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public void getListPDD(AcceptData acceptData, String key, Integer page, String cid, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1) {
|
| | | List<SwiperPicture> bannerList = new ArrayList<>();
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> bannerList = null;
|
| | | if (Constant.IS_TEST) {
|
| | | bannerList = swiperPictureService.getByBannerCard("index_top");
|
| | | } |
| | | |
| | | if (bannerList == null) {
|
| | | bannerList = new ArrayList<SwiperPicture>();
|
| | | }
|
| | |
|
| | | data.put("bannerList", new Gson().toJson(bannerList));
|
| | | }
|
| | |
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, null, fanLiRate, shareRate)));
|
| | | array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate)));
|
| | | }
|
| | | }
|
| | | }
|