| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemPIDInfo; |
| | | import com.yeshi.fanli.exception.pdd.PDDApiException; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | @Resource |
| | | private PDDGoodsService pddGoodsService; |
| | | |
| | | |
| | | @Resource |
| | | private PIDManager pidManager; |
| | | |
| | | /** |
| | | * 获取拼多多的图文详情 |
| | | * |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getImageList", method = RequestMethod.GET) |
| | | public void getCouponList(AcceptData acceptData, String callback, Long id, PrintWriter out) { |
| | | if (id == null || id == 0) { |
| | | public void getCouponList(AcceptData acceptData, String callback, String id, PrintWriter out) { |
| | | if (id == null ) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("请上传商品ID"))); |
| | | return; |
| | | } |
| | | |
| | | PDDGoodsDetail pddGoods = PinDuoDuoApiUtil.getGoodsDetail(id, PinDuoDuoApiUtil.PID_FANLI, Constant.PDD_SEARCH_CUSTOMER_PARAMS); |
| | | PDDGoodsDetail pddGoods = null; |
| | | try { |
| | | pddGoods = PinDuoDuoApiUtil.getGoodsDetail(id, pidManager.getPidCache(SystemEnum.blks, Constant.SOURCE_TYPE_PDD, SystemPIDInfo.PidType.fanli), Constant.PDD_SEARCH_CUSTOMER_PARAMS); |
| | | } catch (PDDApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (pddGoods != null) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(Arrays.asList(pddGoods.getGoodsGalleryUrls())))); |
| | | } |