| | |
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 是否在参与推广
|
| | | */
|
| | |
|
| | | /**
|
| | | * 是否在参与推广
|
| | | * |
| | | * @param goodsId
|
| | | * -商品ID
|
| | | * @param goodsType
|
| | | * -TB/JD
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "isGoodsExtend")
|
| | | public void isGoodsExtend(String goodsId, String goodsType, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(goodsId)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "未参与推广"));
|
| | | return;
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(goodsType)) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "缺少goodsType"));
|
| | | return;
|
| | | }
|
| | | if ("TB".equalsIgnoreCase(goodsType)) {
|
| | | TaoBaoGoodsBrief goods = null;
|
| | | try {
|
| | | goods = TaoKeApiUtil.getSimpleGoodsInfo(Long.parseLong(goodsId));
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | if (goods == null) {
|
| | | data.put("extend", false);
|
| | | data.put("url", "https://h5.m.taobao.com/awp/core/detail.htm?id=" + goodsId);
|
| | | } else {
|
| | | data.put("extend", true);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } else {
|
| | | out.print(JsonUtil.loadFalseResult(3, "暂不支持其他商品类型"));
|
| | | }
|
| | | }
|
| | |
|
| | | }
|