From 207ae7df18d601d839d945d32c5519f95b959a92 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 28 十二月 2019 11:28:49 +0800 Subject: [PATCH] 文章 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java index 26bd11e..f8e76c2 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java @@ -153,6 +153,7 @@ } // 鍘婚櫎鍓嶅悗绌烘牸 text = text.trim(); + String originalText=text; try { TokenVO tokenVO = tokenRecordService.discernToken(text, uid, acceptData); @@ -231,7 +232,7 @@ tb = TaoBaoUtil.isAlimama(id); if (tb == null) { type = 4; - tb = getTaoBaoGoodsBriefFromGoodsId(id); + tb = getTaoBaoGoodsBriefFromGoodsId(id,originalText); } } else if (text.contains("http://zmnxbc.com")) { // 鎵嬫満绔ぉ鐚獳PP鍒嗕韩 tb = TaoBaoUtil.parsePhoneShareUrlByTM(text); @@ -243,7 +244,7 @@ tb = TaoBaoUtil.isAlimama(id); if (tb == null) { type = 4; - tb = getTaoBaoGoodsBriefFromGoodsId(id); + tb = getTaoBaoGoodsBriefFromGoodsId(id,originalText); } } else if (text.contains("v.douyin.com")) { // 鎶栭煶 analysisDouYin(acceptData, text, out); @@ -254,7 +255,7 @@ if (tb == null) { String goodsId = TaoBaoUtil.getGoodsIdByPhoneShareUrl(text); if (!StringUtil.isNullOrEmpty(goodsId)) { - tb = getTaoBaoGoodsBriefFromGoodsId(goodsId); + tb = getTaoBaoGoodsBriefFromGoodsId(goodsId,originalText); if (tb != null) type = 4; } @@ -404,12 +405,22 @@ out.print(JsonUtil.loadTrueResult(root)); } - private TaoBaoGoodsBrief getTaoBaoGoodsBriefFromGoodsId(String goodsId) { + private TaoBaoGoodsBrief getTaoBaoGoodsBriefFromGoodsId(String goodsId, String text) { TaoBaoGoodsBrief tb = TaoBaoUtil.getTmallGoodsInfo(goodsId); if (tb == null && NumberUtil.isNumeric(goodsId)) {// 鏄暟瀛� - tb = TaoBaoUtil.getSimpleGoodsBrief(Long.parseLong(goodsId)); - if (tb != null) { - tb.setPictUrl(TbImgUtil.getTBSize220Img(tb.getPictUrl())); +// tb = TaoBaoUtil.getSimpleGoodsBrief(Long.parseLong(goodsId)); +// if (tb != null) { +// tb.setPictUrl(TbImgUtil.getTBSize220Img(tb.getPictUrl())); +// } + if (tb == null) { + tb = new TaoBaoGoodsBrief(); + if (text.trim().indexOf("銆�") == 0 && text.trim().indexOf("銆�") > 0) { + // 鎴彇鏍囬 + String title = text.trim().substring(1, text.trim().lastIndexOf("銆�")); + tb.setAuctionId(Long.parseLong(goodsId)); + tb.setTitle(title); + tb.setPictUrl("http://"); + } } } return tb; @@ -778,7 +789,7 @@ if (page == 1) { // 绗竴椤佃繑鍥炲簵閾轰俊鎭� String platform = acceptData.getPlatform(); String version = acceptData.getVersion(); - if (("ios".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_1(platform, version)) + if (("ios".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_5(platform, version)) || ("android".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_2(platform, version))) { BrandInfoVO brandInfoVO = null; try { -- Gitblit v1.8.0