| | |
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | |
| | | private Map<String, Long> countMap = new HashMap<String, Long>();
|
| | | private static final Map<Long, String> cidMap = new HashMap<Long, String>();
|
| | |
|
| | |
| | | cidMap.put(18L, "6728");// 汽车:汽车用品
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<GoodsClass> getSpecialClass() {
|
| | | List<GoodsClass> list = new ArrayList<GoodsClass>();
|
| | |
| | | list.add(new GoodsClass(18L, "汽车"));
|
| | | return list;
|
| | | }
|
| | | |
| | |
|
| | | @Cacheable(value = "jdSpecialCache", key = "'specialSearch-'+#page+'-'+#cid")
|
| | | @Override
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | if (!jdcid.contains(",")) {
|
| | | return search(page, Constant.PAGE_SIZE, jdcid);
|
| | | }
|
| | |
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | |
|
| | | private List<JDGoods> search(int page, int pageSize, String jdcid) {
|
| | | JDSearchResult result = null;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Cacheable(value = "jdCache", key = "'getIndexJDGoods-'+#page")
|
| | | @Override
|
| | | public JDSearchResult getIndexJDGoods(int page) {
|
| | | JDSearchResult result = null;
|
| | | String way = configService.get("jd_api_search_key");
|
| | | if ("1".equals(way)) {
|
| | | JDFilter filterAPI = new JDFilter();
|
| | | filterAPI.setPageIndex(page);
|
| | | filterAPI.setPageSize(20);
|
| | | result = JDApiUtil.queryByKey(filterAPI);
|
| | | } else {
|
| | | // 网页爬取
|
| | | JDSearchFilter jdfilter = new JDSearchFilter();
|
| | | jdfilter.setPageNo(page);
|
| | | jdfilter.setPageSize(Constant.PAGE_SIZE);
|
| | | result = JDUtil.searchByKey(jdfilter);
|
| | | }
|
| | | return result;
|
| | | }
|
| | |
|
| | | }
|