| | |
| | | package com.yeshi.fanli.controller;
|
| | |
|
| | | import java.io.File;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | | import org.jsoup.select.Elements;
|
| | | import org.quartz.JobExecutionContext;
|
| | | import org.quartz.Scheduler;
|
| | | import org.quartz.SchedulerException;
|
| | | import org.springframework.cache.ehcache.EhCacheCacheManager;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FileUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | | private HelpCenterMapper helpCenterMapper;
|
| | | @Resource
|
| | | private Scheduler scheduler;
|
| | |
|
| | | @Resource
|
| | | private EhCacheCacheManager ehCacheCacheManager;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @RequestMapping(value = "testimg")
|
| | | public void testImg(HttpServletRequest request, PrintWriter out) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @RequestMapping(value = "testhtml")
|
| | | public void testhtml(PrintWriter out) {
|
| | | out.print("<script>yestv.finishPage();</script>");
|
| | | out.close();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 清除缓存
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "removeCache")
|
| | | public void removeCache(PrintWriter out) {
|
| | | ehCacheCacheManager.getCacheManager().clearAll();
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "testConfig")
|
| | | public void getTestConfig(PrintWriter pw) {
|
| | | pw.print(configService.get("test"));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "testDaTaoKe")
|
| | | public void getTestDaTaoKe(PrintWriter pw) {
|
| | | try {
|
| | | Document doc = Jsoup.connect("http://www.dataoke.com/brandFeature").get();
|
| | | Elements els = doc.getElementsByTag("script");
|
| | | for (int i = 0; i < els.size(); i++) {
|
| | | if (els.get(i).html().contains("var brandData")) {
|
| | | pw.print(els.get(i).html().replace("var brandData =", "").trim().split("};")[0] + "}");
|
| | | }
|
| | | }
|
| | |
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | | }
|