| | |
| | | package com.yeshi.fanli.service.impl.pdd;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | | import org.jsoup.select.Elements;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | cidMap.put(18L, "3279");// 医药
|
| | | }
|
| | |
|
| | | |
| | | @Cacheable(value = "pddCache", key = "'getDetailImageList'+#id")
|
| | | @Override
|
| | | public List<String> getDetailImageList(Long id) {
|
| | |
| | | list = PinDuoDuoUtil.getDetailImages(id);
|
| | | count++;
|
| | | }
|
| | | return list;
|
| | | if (list == null || list.size() == 0) {
|
| | | try {
|
| | | Document doc = Jsoup
|
| | | .connect("https://dk.gaoyong666.com/gylm/h5details/v1/details?classtype=1&goodsId=" + id)
|
| | | .userAgent(
|
| | | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36")
|
| | | .get();
|
| | | Elements els = doc.getElementsByTag("img");
|
| | | for (int i = 0; i < els.size(); i++) {
|
| | | String src = els.get(i).attr("src");
|
| | | if (src.contains("yangkeduo")) {
|
| | | list.add(src);
|
| | | }
|
| | | }
|
| | |
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | return list;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<GoodsClass> getSpecialClass() {
|
| | |
| | | list.add(new GoodsClass(18L, "医药"));
|
| | | return list;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | |
| | | }
|
| | | return list;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "pddSpecialCache", key = "'getTopGoodsList-' + #page + '-' + #sortType")
|