| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.exception.integral.IntegralGetException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.user.TokenRecordException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.cache.IntegralGetCacheManager;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | |
| | |
|
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | |
|
| | | @Resource
|
| | | private IntegralGetCacheManager integralGetCacheManager;
|
| | |
|
| | | /**
|
| | | * 粘贴板信息推荐
|
| | |
| | | @RequestMapping(value = "searchGoods")
|
| | | public void searchGoods(AcceptData acceptData, Integer goodsType, String key, Integer page, String filter,
|
| | | Integer order, Long uid, HttpSession session, PrintWriter out) {
|
| | |
|
| | | if (goodsType == null || goodsType < 1 || goodsType > 3) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传递正确平台参数"));
|
| | | return;
|
| | |
| | |
|
| | | if (uid != null) {
|
| | | if (page == 1) {
|
| | | session.setAttribute("searchFirstTime", System.currentTimeMillis());
|
| | | } else if (page == 2) {
|
| | | Long lastTime = (Long) session.getAttribute("searchFirstTime");
|
| | | integralGetCacheManager.cacheSearchGoods(acceptData.getDevice(), System.currentTimeMillis());
|
| | | } else if (page > 1) {
|
| | | Long lastTime = integralGetCacheManager.getLastSearchTime(acceptData.getDevice());
|
| | | if (lastTime != null && System.currentTimeMillis() - lastTime >= 15 * 1000L) {// 超过15s浏览
|
| | | |
| | | integralGetCacheManager.clearSearchTime(acceptData.getDevice());
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | // 增加金币
|
| | | integralGetService.addSearchResultScan(uid,key);
|
| | | } catch (IntegralGetException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | // 增加金币
|
| | | integralGetService.addSearchResultScan(uid, key);
|
| | | }
|
| | | });
|
| | |
|
| | | }
|
| | | }
|
| | | }
|