admin
2021-02-19 58577bae968f2a10232bc8b3c04910b93ea3c69a
系统资源配置由原有的代码形式改为数据库形式
16个文件已修改
6个文件已添加
2401 ■■■■■ 已修改文件
src/main/java/com/yeshi/buwan/aspect/CrossOriginAspect.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/aspect/SignAspect.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/UserParser.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/web/WebFindParser.java 220 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java 1590 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/web/WebUserParser.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/web/WebVideosParser.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/dao/video/VideoResourceVersionMapDao.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/domain/video/VideoResourceVersionMap.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/pptv/PPTVApiUtil.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/CategoryRecommendCacheVideoService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/video/VideoResourceVersionMapServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/inter/video/VideoResourceVersionMapService.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/vo/AcceptData.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/hxh/spring/test/FunTV.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/hxh/spring/test/GeneralTest.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/hxh/spring/test/PPTVTest.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/hxh/spring/test/Test.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/hxh/spring/test/video/VideoResourceVersionTest.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/aspect/CrossOriginAspect.java
@@ -1,11 +1,8 @@
package com.yeshi.buwan.aspect;
import com.yeshi.buwan.log.LogHelper;
import net.sf.ehcache.CacheManager;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -14,7 +11,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
/**
 * 跨域
src/main/java/com/yeshi/buwan/aspect/SignAspect.java
@@ -1,5 +1,9 @@
package com.yeshi.buwan.aspect;
import com.yeshi.buwan.domain.DetailSystem;
import com.yeshi.buwan.service.imp.SystemService;
import com.yeshi.buwan.util.JsonUtil;
import com.yeshi.buwan.util.Utils;
import com.yeshi.buwan.vo.AcceptData;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
@@ -8,12 +12,18 @@
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@Component
@Aspect
public class SignAspect {
    @Resource
    private SystemService systemService;
    //签名验证
@@ -21,16 +31,34 @@
    public Object verifySign(ProceedingJoinPoint joinPoint) throws IOException {
        ServletRequestAttributes servletContainer = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        HttpServletRequest request = servletContainer.getRequest();
        HttpServletResponse response = servletContainer.getResponse();
        PrintWriter out = null;
        Object[] args = joinPoint.getArgs();
        for (Object obj : args) {
            if (obj instanceof AcceptData) {
                AcceptData acceptData = (AcceptData) obj;
                if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
                    acceptData.setChannel("appstore");
                if (acceptData != null) {
                    if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
                        acceptData.setChannel("appstore");
                    }
                    //注入detailSystem
                    DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
                    acceptData.setDetailSystem(detailSystem);
                }
            } else if (obj instanceof PrintWriter) {
                out = (PrintWriter) obj;
            }
        }
        if (!Utils.signIsRight(request)) {
            if (out == null)
                out = response.getWriter();
            out.print(JsonUtil.loadFalseJson("签名错误"));
            return null;
        }
        Object obj = null;
        try {
            obj = joinPoint.proceed(args);
src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java
@@ -345,9 +345,9 @@
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion());
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, acceptData.getVersion());
        List<VideoInfo> list = starService.getStarVideo(detailSystem.getId(), starId, pageIndex,
                CacheUtil.getMD5Long(resourceList));
@@ -404,12 +404,13 @@
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion());
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        DetailSystem detailSystem = acceptData.getDetailSystem();
        UserInfo user = userService.getUserInfo(acceptData.getUid());
        if (Utils.isTest(request, user, detailSystem.getId()))
            detailSystem = systemService.getDetailSystemById(40 + "");
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
        String resourceMD5 = CacheUtil.getMD5Long(resourceList);
        String key = "videolist-" + StringUtil.Md5(String.format("%s#%s#%s#%s#%s#%s#%s#%s", starId + "", homeType + "",
src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java
@@ -156,7 +156,7 @@
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        JSONObject object = new JSONObject();
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
        List<HomeType> list1 = homeTypeService.getHomeType(detailSystem.getId(), resourceList,
                CacheUtil.getMD5Long(resourceList), -1, Long.parseLong(vtid));
        List<HomeType> list = new ArrayList<>();
@@ -335,7 +335,7 @@
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
        //获取优先展示的渠道
        if (StringUtil.isNullOrEmpty(resourceId)) {
src/main/java/com/yeshi/buwan/controller/parser/UserParser.java
@@ -260,7 +260,7 @@
            object.put("data", array);
            out.print(JsonUtil.loadTrueJson(object.toString()));
        } else {
            List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion());
            List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, acceptData.getVersion());
            String cacheMD5 = "0";
            if (resourceList != null && resourceList.size() > 0)
                for (Long l : resourceList)
@@ -360,7 +360,7 @@
            object.put("data", array);
            out.print(JsonUtil.loadTrueJson(object.toString()));
        } else {
            List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion());
            List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, acceptData.getVersion());
            String cacheMD5 = "0";
            if (resourceList != null && resourceList.size() > 0)
                for (Long l : resourceList)
@@ -458,7 +458,7 @@
        DetailSystem ds = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
        List<VideoInfo> list1 = StringUtil.isNullOrEmpty(videoId)
                ? recommendService.guessLikeList(ds.getId(), 4, resourceList, CacheUtil.getMD5Long(resourceList))
                : recommendService.guessLikeList(ds.getId(), 4, videoId, resourceList,
@@ -640,7 +640,7 @@
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
        DetailSystem ds = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        List<VideoInfo> list = recommendService.getRelativeVideoList(ds.getId(), 4, videoId, resourceList,
@@ -679,7 +679,7 @@
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
        DetailSystem ds = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        List<VideoInfo> list1 = recommendService.peopleSee(ds.getId(), 4, videoId, resourceList,
src/main/java/com/yeshi/buwan/controller/parser/web/WebFindParser.java
@@ -28,133 +28,133 @@
@Controller
public class WebFindParser {
    @Resource
    private SystemService systemService;
    @Resource
    private SystemService systemService;
    @Resource
    private SpecialService specialService;
    @Resource
    private SpecialService specialService;
    @Resource
    private StarService starService;
    @Resource
    private StarService starService;
    @Resource
    private VideoResourceUtil videoResouceUtil;
    @Resource
    private VideoResourceUtil videoResouceUtil;
    // 获取专辑详情
    public void getSpecialDetail(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        String specialId = request.getParameter("Id");
    // 获取专辑详情
    public void getSpecialDetail(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        String specialId = request.getParameter("Id");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(packageName)) {
            out.print(JsonUtil.loadFalseJson("请上传Package"));
            return;
        }
        if (StringUtil.isNullOrEmpty(packageName)) {
            out.print(JsonUtil.loadFalseJson("请上传Package"));
            return;
        }
        Special special = specialService.getSpecial(specialId);
        List<VideoInfo> list = specialService.getSpecialVideoList(specialId);
        Special special = specialService.getSpecial(specialId);
        List<VideoInfo> list = specialService.getSpecialVideoList(specialId);
        JSONObject object = new JSONObject();
        object.put("count", list.size());
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++) {
            list.get(i).setPicture(VideoPictureUtil.getShowPicture(list.get(i), platform, "0"));
            array.add(StringUtil.outPutResultJson(list.get(i)));
        }
        object.put("data", array);
        JSONObject object = new JSONObject();
        object.put("count", list.size());
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++) {
            list.get(i).setPicture(VideoPictureUtil.getShowPicture(list.get(i), platform, "0"));
            array.add(StringUtil.outPutResultJson(list.get(i)));
        }
        object.put("data", array);
        object.put("special", StringUtil.outPutResultJson(special));
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
        object.put("special", StringUtil.outPutResultJson(special));
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
    }
    // 获取专辑详情
    public void getStarDetail(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        String starId = request.getParameter("Id");
        String page = request.getParameter("Page");
    // 获取专辑详情
    public void getStarDetail(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        String starId = request.getParameter("Id");
        String page = request.getParameter("Page");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(packageName)) {
            out.print(JsonUtil.loadFalseJson("请上传Package"));
            return;
        }
        if (StringUtil.isNullOrEmpty(packageName)) {
            out.print(JsonUtil.loadFalseJson("请上传Package"));
            return;
        }
        if (StringUtil.isNullOrEmpty(page)) {
            out.print(JsonUtil.loadFalseJson("请上传Page"));
            return;
        }
        if (StringUtil.isNullOrEmpty(page)) {
            out.print(JsonUtil.loadFalseJson("请上传Page"));
            return;
        }
        int pageIndex = Integer.parseInt(page);
        int pageIndex = Integer.parseInt(page);
        HotStar hot = starService.getHotStarDetail(starId);
        HotStar hot = starService.getHotStarDetail(starId);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(platform, Integer.parseInt("0"));
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<VideoInfo> list1 = starService.getStarVideo(detailSystem.getId(), starId, pageIndex, resourceList,
                CacheUtil.getMD5Long(resourceList));
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, Integer.parseInt("1"));
        List<VideoInfo> list1 = starService.getStarVideo(detailSystem.getId(), starId, pageIndex, resourceList,
                CacheUtil.getMD5Long(resourceList));
        for (VideoInfo info : list1) {
            info.setIntroduction("");
            info.setPicture(VideoPictureUtil.getShowPicture(info, platform, "0"));
        }
        List<VideoInfo> list = new ArrayList<VideoInfo>();
        list.addAll(list1);
        JSONArray array = new JSONArray();
        for (VideoInfo v : list)
            array.add(StringUtil.outPutResultJson(v));
        JSONObject object = new JSONObject();
        object.put("star", StringUtil.outPutResultJson(hot));
        object.put("videos", array);
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
        for (VideoInfo info : list1) {
            info.setIntroduction("");
            info.setPicture(VideoPictureUtil.getShowPicture(info, platform, "0"));
        }
        List<VideoInfo> list = new ArrayList<VideoInfo>();
        list.addAll(list1);
        JSONArray array = new JSONArray();
        for (VideoInfo v : list)
            array.add(StringUtil.outPutResultJson(v));
        JSONObject object = new JSONObject();
        object.put("star", StringUtil.outPutResultJson(hot));
        object.put("videos", array);
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
}
src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java
@@ -64,924 +64,924 @@
@Controller
public class WebHomeParser {
    @Resource
    private SystemService systemService;
    @Resource
    private HomeAdService homeAdService;
    @Resource
    private HomeTypeService homeTypeService;
    @Resource
    private ConfigService configService;
    @Resource
    private AdService adService;
    @Resource
    private VideoDetailUtil videoDeailUtil;
    @Resource
    private StatisticsService statisticsService;
    @Resource
    private CommentService commentService;
    @Resource
    private CollectionService collectionService;
    @Resource
    private UserService userService;
    @Resource
    private VideoResourceUtil videoResouceUtil;
    @Resource
    private MeiNvZhiBoUtil meiNvZhiBoUtil;
    @Resource
    private AttentionService attentionService;
    @Resource
    private ClassService classService;
    @Resource
    private VideoManager videoManager;
    @Resource
    private SystemService systemService;
    @Resource
    private HomeAdService homeAdService;
    @Resource
    private HomeTypeService homeTypeService;
    @Resource
    private ConfigService configService;
    @Resource
    private AdService adService;
    @Resource
    private VideoDetailUtil videoDeailUtil;
    @Resource
    private StatisticsService statisticsService;
    @Resource
    private CommentService commentService;
    @Resource
    private CollectionService collectionService;
    @Resource
    private UserService userService;
    @Resource
    private VideoResourceUtil videoResouceUtil;
    @Resource
    private MeiNvZhiBoUtil meiNvZhiBoUtil;
    @Resource
    private AttentionService attentionService;
    @Resource
    private ClassService classService;
    @Resource
    private VideoManager videoManager;
    @Resource
    private CategoryRecommendVideoService categoryRecommendVideoService;
    @Resource
    private CategoryRecommendVideoService categoryRecommendVideoService;
    @Resource
    private RecommendService recommendService;
    @Resource
    private RecommendService recommendService;
    @Resource
    private BanQuanService banQuanService;
    @Resource
    private BanQuanService banQuanService;
    @Resource
    private SearchService searchService;
    @Resource
    private SearchService searchService;
    @Resource
    private CategoryAreaService categoryAreaService;
    @Resource
    private CategoryAreaService categoryAreaService;
    @Resource
    private StarService starService;
    @Resource
    private StarService starService;
    @Resource
    private SpecialService specialService;
    @Resource
    private SpecialService specialService;
    // 首页
    public void getHomePage(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
    // 首页
    public void getHomePage(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        JSONObject object = new JSONObject();
        JSONObject object = new JSONObject();
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<HomeAd> list = homeAdService.getHomeAdList(detailSystem);
        List<HomeAd> list = homeAdService.getHomeAdList(detailSystem);
        for (HomeAd ad : list) {
            if (ad.getVideo() != null) {
                ad.getVideo().setIntroduction("");
                ad.getVideo().setMainActor("");
            }
            if (!StringUtil.isNullOrEmpty(ad.getParams())) {
                ad.setParams(ad.getParams().replace("\"", "\\" + "\""));
            }
        }
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        for (HomeAd ad : list) {
            if (ad.getVideo() != null) {
                ad.getVideo().setIntroduction("");
                ad.getVideo().setMainActor("");
            }
            if (!StringUtil.isNullOrEmpty(ad.getParams())) {
                ad.setParams(ad.getParams().replace("\"", "\\" + "\""));
            }
        }
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        object.put("homeAdList", array);
        object.put("homeTypeList", getHomeType(uid, platform, detailSystem.getId()));
        object.put("homeAdList", array);
        object.put("homeTypeList", getHomeType(uid, platform, detailSystem.getId()));
        // 排行
        JSONObject rank = new JSONObject();
        rank.put("tv", getRank(detailSystem.getId(), platform, "150"));
        rank.put("movie", getRank(detailSystem.getId(), platform, "151"));
        rank.put("show", getRank(detailSystem.getId(), platform, "152"));
        rank.put("cartoon", getRank(detailSystem.getId(), platform, "153"));
        // 排行
        JSONObject rank = new JSONObject();
        rank.put("tv", getRank(detailSystem.getId(), platform, "150"));
        rank.put("movie", getRank(detailSystem.getId(), platform, "151"));
        rank.put("show", getRank(detailSystem.getId(), platform, "152"));
        rank.put("cartoon", getRank(detailSystem.getId(), platform, "153"));
        rank.put("entertainment", getRank(detailSystem.getId(), platform, "155"));
        rank.put("live", getRank(detailSystem.getId(), platform, "157"));
        rank.put("game", getRank(detailSystem.getId(), platform, "154"));
        rank.put("science", getRank(detailSystem.getId(), platform, "156"));
        rank.put("dance", getRank(detailSystem.getId(), platform, "274"));
        rank.put("sports", getRank(detailSystem.getId(), platform, "158"));
        rank.put("entertainment", getRank(detailSystem.getId(), platform, "155"));
        rank.put("live", getRank(detailSystem.getId(), platform, "157"));
        rank.put("game", getRank(detailSystem.getId(), platform, "154"));
        rank.put("science", getRank(detailSystem.getId(), platform, "156"));
        rank.put("dance", getRank(detailSystem.getId(), platform, "274"));
        rank.put("sports", getRank(detailSystem.getId(), platform, "158"));
        object.put("rank", rank);
        object.put("rank", rank);
        // 获取homeType
        // 获取homeType
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
    // 首页类型获取
    private JSONArray getHomeType(String uid, String platform, String detailsystemid) {
    // 首页类型获取
    private JSONArray getHomeType(String uid, String platform, String detailsystemid) {
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(platform, 0);
        List<HomeType> list1 = homeTypeService.getHomeType(detailsystemid, resourceList,
                CacheUtil.getMD5Long(resourceList),10,309);
        List<HomeType> list = new ArrayList<>();
        for (HomeType ht : list1)
            list.add(ht);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1);
        List<HomeType> list1 = homeTypeService.getHomeType(detailsystemid, resourceList,
                CacheUtil.getMD5Long(resourceList), 10, 309);
        List<HomeType> list = new ArrayList<>();
        for (HomeType ht : list1)
            list.add(ht);
        JSONArray array = new JSONArray();
        JSONArray array = new JSONArray();
        for (HomeType ht : list) {
            for (int i = 0; i < ht.getHomeVideoList().size(); i++) {
                if (JuheVideoUtil.isNeedDelete(ht.getHomeVideoList().get(i).getVideo(), detailsystemid)) {
                    ht.getHomeVideoList().remove(i);
                    i--;
                }
            }
        }
        for (HomeType ht : list) {
            for (int i = 0; i < ht.getHomeVideoList().size(); i++) {
                if (JuheVideoUtil.isNeedDelete(ht.getHomeVideoList().get(i).getVideo(), detailsystemid)) {
                    ht.getHomeVideoList().remove(i);
                    i--;
                }
            }
        }
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        return array;
    }
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        return array;
    }
    private JSONArray getRank(String detailsystemid, String platform, String typeid) {
        int count = categoryRecommendVideoService.getRankVideoNumber(Integer.parseInt(typeid));
        List<VideoInfo> list = recommendService.getCategoryRecommendVideoList(Integer.parseInt(typeid), count);
    private JSONArray getRank(String detailsystemid, String platform, String typeid) {
        int count = categoryRecommendVideoService.getRankVideoNumber(Integer.parseInt(typeid));
        List<VideoInfo> list = recommendService.getCategoryRecommendVideoList(Integer.parseInt(typeid), count);
        list = banQuanService.getBanQuanVideo(list, detailsystemid, CacheUtil.getMD5VideoInfo(list));
        for (VideoInfo vi : list) {// 清除无用数据,防止浪费带宽
            vi.setIntroduction("");
            vi.setMainActor("");
            vi.setPicture(VideoPictureUtil.getShowPicture(vi, platform, "0"));
        }
        JSONObject object = new JSONObject();
        object.put("count", list.size());
        if (list.size() > 10)
            list = list.subList(0, 10);
        list = banQuanService.getBanQuanVideo(list, detailsystemid, CacheUtil.getMD5VideoInfo(list));
        for (VideoInfo vi : list) {// 清除无用数据,防止浪费带宽
            vi.setIntroduction("");
            vi.setMainActor("");
            vi.setPicture(VideoPictureUtil.getShowPicture(vi, platform, "0"));
        }
        JSONObject object = new JSONObject();
        object.put("count", list.size());
        if (list.size() > 10)
            list = list.subList(0, 10);
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        return array;
    }
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        return array;
    }
    public void getClass(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String packageName = request.getParameter("Package");
    public void getClass(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<SuperVideoType> clist = classService.getSuperVideoTypeList(detailSystem.getId());
        List<SuperVideoType> list = new ArrayList<>();
        list.addAll(clist);
        List<SuperVideoType> clist = classService.getSuperVideoTypeList(detailSystem.getId());
        List<SuperVideoType> list = new ArrayList<>();
        list.addAll(clist);
        List<VideoType> typelist = new ArrayList<>();
        for (SuperVideoType sv : list) {
            if (!StringUtil.isNullOrEmpty(sv.getPicture())) {
                sv.getType().setIcon(sv.getPicture());
            }
            List<VideoType> childList = getFirstType(sv.getType().getId() + "");
            sv.getType().setChildTypeList(childList);
            typelist.add(sv.getType());
        }
        List<VideoType> typelist = new ArrayList<>();
        for (SuperVideoType sv : list) {
            if (!StringUtil.isNullOrEmpty(sv.getPicture())) {
                sv.getType().setIcon(sv.getPicture());
            }
            List<VideoType> childList = getFirstType(sv.getType().getId() + "");
            sv.getType().setChildTypeList(childList);
            typelist.add(sv.getType());
        }
        JSONObject object = new JSONObject();
        object.put("count", (new StringBuilder(String.valueOf(typelist.size()))).toString());
        JSONArray array = new JSONArray();
        for (int j = 0; j < typelist.size(); j++) {
            JSONObject obj = JSONObject.fromObject(StringUtil.outPutResultJson(typelist.get(j)));
            if (typelist.get(j).getChildTypeList() != null) {
                JSONArray ca = new JSONArray();
                for (VideoType child : typelist.get(j).getChildTypeList()) {
                    ca.add(StringUtil.outPutResultJson(child));
                }
                obj.put("ChildList", ca);
            }
            array.add(obj);
        }
        object.put("data", array);
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
        JSONObject object = new JSONObject();
        object.put("count", (new StringBuilder(String.valueOf(typelist.size()))).toString());
        JSONArray array = new JSONArray();
        for (int j = 0; j < typelist.size(); j++) {
            JSONObject obj = JSONObject.fromObject(StringUtil.outPutResultJson(typelist.get(j)));
            if (typelist.get(j).getChildTypeList() != null) {
                JSONArray ca = new JSONArray();
                for (VideoType child : typelist.get(j).getChildTypeList()) {
                    ca.add(StringUtil.outPutResultJson(child));
                }
                obj.put("ChildList", ca);
            }
            array.add(obj);
        }
        object.put("data", array);
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
    public void getCategoryRecommend(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String packageName = request.getParameter("Package");
        String pid = request.getParameter("Pid");
    public void getCategoryRecommend(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String packageName = request.getParameter("Package");
        String pid = request.getParameter("Pid");
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(pid)) {
            out.print(JsonUtil.loadFalseJson("Pid"));
            return;
        }
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        if (StringUtil.isNullOrEmpty(pid)) {
            out.print(JsonUtil.loadFalseJson("Pid"));
            return;
        }
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        JSONObject object = new JSONObject();
        object.put("banner", getCategoryRecommendBanner(detailSystem.getId(), pid));
        object.put("videos", getCategoryRecommendVideos(detailSystem.getId(), pid, platform));
        JSONObject object = new JSONObject();
        object.put("banner", getCategoryRecommendBanner(detailSystem.getId(), pid));
        object.put("videos", getCategoryRecommendVideos(detailSystem.getId(), pid, platform));
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
    public void getTopHotStars(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
    public void getTopHotStars(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        List<HotStar> list = starService.getHotStarList(1, 20);
        JSONArray array = new JSONArray();
        for (HotStar hs : list)
            array.add(StringUtil.outPutResultJson(hs));
        List<HotStar> list = starService.getHotStarList(1, 20);
        JSONArray array = new JSONArray();
        for (HotStar hs : list)
            array.add(StringUtil.outPutResultJson(hs));
        out.print(JsonUtil.loadTrueJsonNoencript(array.toString()));
    }
        out.print(JsonUtil.loadTrueJsonNoencript(array.toString()));
    }
    public void getTopTypePlayVideos(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String pid = request.getParameter("Pid");
        String packageName = request.getParameter("Package");
    public void getTopTypePlayVideos(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String pid = request.getParameter("Pid");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(pid)) {
            out.print(JsonUtil.loadFalseJson("Pid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(pid)) {
            out.print(JsonUtil.loadFalseJson("Pid"));
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(platform, 0);
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1);
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<VideoType> typeList = getFirstType(pid);
        JSONArray data = new JSONArray();
        for (VideoType vt : typeList) {
            List<VideoInfo> list = new ArrayList<>();
            if (StringUtil.isNullOrEmpty(vt.getCategoryType()) || "genre".equalsIgnoreCase(vt.getCategoryType())) {// 按分类检索数据
                Long startTime = System.currentTimeMillis();
                List<VideoInfo> list1 = classService.getTypeVideoList(vt.getId() + "", detailSystem, 1, 20, 2,
                        resourceList, CacheUtil.getMD5Long(resourceList));
                list = new ArrayList<>();
                if (list1 != null)
                    for (VideoInfo info : list1)
                        list.add(info);
                System.out.println("列表获取时间:" + (System.currentTimeMillis() - startTime));
            } else {// 按地区检索数据
                String areaId = vt.getId() + "";// 国籍ID
                CategoryContry cc = categoryAreaService.getCategoryArea(areaId);
                String country = cc.getName();
                long typeid = cc.getParent().getCid();
        List<VideoType> typeList = getFirstType(pid);
        JSONArray data = new JSONArray();
        for (VideoType vt : typeList) {
            List<VideoInfo> list = new ArrayList<>();
            if (StringUtil.isNullOrEmpty(vt.getCategoryType()) || "genre".equalsIgnoreCase(vt.getCategoryType())) {// 按分类检索数据
                Long startTime = System.currentTimeMillis();
                List<VideoInfo> list1 = classService.getTypeVideoList(vt.getId() + "", detailSystem, 1, 20, 2,
                        resourceList, CacheUtil.getMD5Long(resourceList));
                list = new ArrayList<>();
                if (list1 != null)
                    for (VideoInfo info : list1)
                        list.add(info);
                System.out.println("列表获取时间:" + (System.currentTimeMillis() - startTime));
            } else {// 按地区检索数据
                String areaId = vt.getId() + "";// 国籍ID
                CategoryContry cc = categoryAreaService.getCategoryArea(areaId);
                String country = cc.getName();
                long typeid = cc.getParent().getCid();
                list = categoryAreaService.getVideoInfoByArea(typeid + "", detailSystem, 1, 20, 2, resourceList,
                        country, StringUtil.Md5(typeid + "-" + detailSystem + "-" + 1 + "-" + 2 + "-" + country + "-"
                                + CacheUtil.getMD5Long(resourceList)));
            }
            JSONArray array = new JSONArray();
            for (int i = 0; i < list.size(); i++) {
                list.get(i).setPicture(VideoPictureUtil.getShowPicture(list.get(i), platform, 33 + ""));
                array.add(StringUtil.outPutResultJson(list.get(i)));
            }
            data.add(array);
        }
        out.print(JsonUtil.loadTrueJsonNoencript(data.toString()));
    }
                list = categoryAreaService.getVideoInfoByArea(typeid + "", detailSystem, 1, 20, 2, resourceList,
                        country, StringUtil.Md5(typeid + "-" + detailSystem + "-" + 1 + "-" + 2 + "-" + country + "-"
                                + CacheUtil.getMD5Long(resourceList)));
            }
            JSONArray array = new JSONArray();
            for (int i = 0; i < list.size(); i++) {
                list.get(i).setPicture(VideoPictureUtil.getShowPicture(list.get(i), platform, 33 + ""));
                array.add(StringUtil.outPutResultJson(list.get(i)));
            }
            data.add(array);
        }
        out.print(JsonUtil.loadTrueJsonNoencript(data.toString()));
    }
    public void getHotStarList(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
    public void getHotStarList(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        List<HotStar> list = starService.getHotStarList(1, 100);
        JSONArray array = new JSONArray();
        for (HotStar hs : list)
            array.add(StringUtil.outPutResultJson(hs));
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        List<HotStar> list = starService.getHotStarList(1, 100);
        JSONArray array = new JSONArray();
        for (HotStar hs : list)
            array.add(StringUtil.outPutResultJson(hs));
        out.print(JsonUtil.loadTrueJsonNoencript(array.toString()));
    }
        out.print(JsonUtil.loadTrueJsonNoencript(array.toString()));
    }
    public void getSpecialList(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
    public void getSpecialList(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("Platform"));
            return;
        }
        DetailSystem ds = systemService.getDetailSystemByPackage(packageName);
        DetailSystem ds = systemService.getDetailSystemByPackage(packageName);
        List<Special> list = specialService.getSpecialList(ds.getId());
        JSONArray array = new JSONArray();
        for (Special s : list)
            array.add(StringUtil.outPutResultJson(s));
        List<Special> list = specialService.getSpecialList(ds.getId());
        JSONArray array = new JSONArray();
        for (Special s : list)
            array.add(StringUtil.outPutResultJson(s));
        out.print(JsonUtil.loadTrueJsonNoencript(array.toString()));
    }
        out.print(JsonUtil.loadTrueJsonNoencript(array.toString()));
    }
    private JSONArray getCategoryRecommendBanner(String detailsystemid, String typeid) {
        List<CategoryRecommendVideo> crvList = categoryRecommendVideoService
                .getCategoryRecommendVideoBannerList(detailsystemid, Integer.parseInt(typeid));
        JSONArray array = new JSONArray();
        for (int i = 0; i < crvList.size(); i++)
            array.add(StringUtil.outPutResultJson(crvList.get(i)));
        return array;
    }
    private JSONArray getCategoryRecommendBanner(String detailsystemid, String typeid) {
        List<CategoryRecommendVideo> crvList = categoryRecommendVideoService
                .getCategoryRecommendVideoBannerList(detailsystemid, Integer.parseInt(typeid));
        JSONArray array = new JSONArray();
        for (int i = 0; i < crvList.size(); i++)
            array.add(StringUtil.outPutResultJson(crvList.get(i)));
        return array;
    }
    private JSONArray getCategoryRecommendVideos(String detailsystemid, String typeid, String platform) {
        List<VideoInfo> list = recommendService.getCategoryRecommendVideoList(Integer.parseInt(typeid), 10);
    private JSONArray getCategoryRecommendVideos(String detailsystemid, String typeid, String platform) {
        List<VideoInfo> list = recommendService.getCategoryRecommendVideoList(Integer.parseInt(typeid), 10);
        list = banQuanService.getBanQuanVideo(list, detailsystemid, CacheUtil.getMD5VideoInfo(list));
        for (VideoInfo vi : list) {// 清除无用数据,防止浪费带宽
            vi.setIntroduction("");
            vi.setMainActor("");
            vi.setPicture(VideoPictureUtil.getShowPicture(vi, platform, 0 + ""));
        }
        list = banQuanService.getBanQuanVideo(list, detailsystemid, CacheUtil.getMD5VideoInfo(list));
        for (VideoInfo vi : list) {// 清除无用数据,防止浪费带宽
            vi.setIntroduction("");
            vi.setMainActor("");
            vi.setPicture(VideoPictureUtil.getShowPicture(vi, platform, 0 + ""));
        }
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        return array;
    }
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        return array;
    }
    private List<VideoType> getFirstType(String parentId) {
        List<VideoType> list = new ArrayList<>();
    private List<VideoType> getFirstType(String parentId) {
        List<VideoType> list = new ArrayList<>();
        if ("150".equalsIgnoreCase(parentId) || "151".equalsIgnoreCase(parentId) || "152".equalsIgnoreCase(parentId)
                || "153".equalsIgnoreCase(parentId)) {
        if ("150".equalsIgnoreCase(parentId) || "151".equalsIgnoreCase(parentId) || "152".equalsIgnoreCase(parentId)
                || "153".equalsIgnoreCase(parentId)) {
            List<CategoryContry> clist = categoryAreaService.getCategoryContryListByCid(parentId);
            List<CategoryContry> clist = categoryAreaService.getCategoryContryListByCid(parentId);
            List<CategoryContry> areaList = categoryAreaService.categoryContryList(clist.get(0).getId() + "");
            List<CategoryContry> areaList = categoryAreaService.categoryContryList(clist.get(0).getId() + "");
            if ("150".equalsIgnoreCase(parentId)) {
                VideoType vt = classService.getType(282);
                vt.setParent(null);
                vt.setCategoryType("genre");
                list.add(vt);
            } else if ("151".equalsIgnoreCase(parentId)) {
                VideoType vt = classService.getType(281);
                vt.setParent(null);
                vt.setCategoryType("genre");
                list.add(vt);
            } else if ("153".equalsIgnoreCase(parentId)) {
                VideoType vt = classService.getType(283);
                vt.setParent(null);
                vt.setCategoryType("genre");
                list.add(vt);
            }
            if ("150".equalsIgnoreCase(parentId)) {
                VideoType vt = classService.getType(282);
                vt.setParent(null);
                vt.setCategoryType("genre");
                list.add(vt);
            } else if ("151".equalsIgnoreCase(parentId)) {
                VideoType vt = classService.getType(281);
                vt.setParent(null);
                vt.setCategoryType("genre");
                list.add(vt);
            } else if ("153".equalsIgnoreCase(parentId)) {
                VideoType vt = classService.getType(283);
                vt.setParent(null);
                vt.setCategoryType("genre");
                list.add(vt);
            }
            for (CategoryContry cc : areaList) {
                VideoType type = new VideoType(cc.getId());
                type.setName(cc.getName());
                type.setShow("1");
                type.setCategoryType("area");
                list.add(type);
            }
            for (CategoryContry cc : areaList) {
                VideoType type = new VideoType(cc.getId());
                type.setName(cc.getName());
                type.setShow("1");
                type.setCategoryType("area");
                list.add(type);
            }
        } else {
            List<VideoType> clist = classService.getFirstTypeList(parentId);
            list = new ArrayList<>();
            if (clist != null)
                for (VideoType vt : clist) {
                    vt.setCategoryType("genre");
                    list.add(vt);
                }
        }
        return list;
    }
        } else {
            List<VideoType> clist = classService.getFirstTypeList(parentId);
            list = new ArrayList<>();
            if (clist != null)
                for (VideoType vt : clist) {
                    vt.setCategoryType("genre");
                    list.add(vt);
                }
        }
        return list;
    }
    public void getHotSearch(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
    public void getHotSearch(String uid, HttpServletRequest request, PrintWriter out) {
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<String> list = searchService.getHotSearchList(detailSystem.getId());
        JSONObject object = new JSONObject();
        object.put("count", list.size() + "");
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++) {
            array.add(StringUtil.outPutResultJson(list.get(i)));
        }
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<String> list = searchService.getHotSearchList(detailSystem.getId());
        JSONObject object = new JSONObject();
        object.put("count", list.size() + "");
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++) {
            array.add(StringUtil.outPutResultJson(list.get(i)));
        }
        object.put("data", array);
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
        object.put("data", array);
        out.print(JsonUtil.loadTrueJsonNoencript(object.toString()));
    }
    public HomeType convertHomeVideoList(HomeType type) {
        List<VideoInfo> vlist = new ArrayList<>();
        List<HomeVideo> list = type.getHomeVideoList();
        if (list != null)
            for (HomeVideo hv : list) {
                vlist.add(hv.getVideo());
            }
        type.setVideoList(vlist);
        return type;
    }
    public HomeType convertHomeVideoList(HomeType type) {
        List<VideoInfo> vlist = new ArrayList<>();
        List<HomeVideo> list = type.getHomeVideoList();
        if (list != null)
            for (HomeVideo hv : list) {
                vlist.add(hv.getVideo());
            }
        type.setVideoList(vlist);
        return type;
    }
    public void getMoreVideo(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
    public void getMoreVideo(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String type = request.getParameter("Type");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String page = request.getParameter("Page");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(page)) {
            out.print(JsonUtil.loadFalseJson("请上传Page"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        String type = request.getParameter("Type");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String page = request.getParameter("Page");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(page)) {
            out.print(JsonUtil.loadFalseJson("请上传Page"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        int pageIndex = 0;
        try {
            pageIndex = Integer.parseInt(page);
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseJson("Page\u683C\u5F0F\u6709\u8BEF"));
            return;
        }
        int pageIndex = 0;
        try {
            pageIndex = Integer.parseInt(page);
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseJson("Page\u683C\u5F0F\u6709\u8BEF"));
            return;
        }
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        UserInfo user = userService.getUserInfo(uid);
        if (Utils.isTest(request, user, detailSystem.getId()))
            detailSystem = systemService.getDetailSystemById(40 + "");
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        UserInfo user = userService.getUserInfo(uid);
        if (Utils.isTest(request, user, detailSystem.getId()))
            detailSystem = systemService.getDetailSystemById(40 + "");
        List<HomeVideo> homeVideoList = homeTypeService.getVideoByTypes(type, pageIndex, detailSystem);
        List<HomeVideo> homeVideoList = homeTypeService.getVideoByTypes(type, pageIndex, detailSystem);
        List<VideoInfo> list = new ArrayList<>();
        for (int i = 0; i < homeVideoList.size(); i++) {
            HomeVideo hv = (HomeVideo) homeVideoList.get(i);
            if (detailSystem.getPackageName().contains("doudou")) {
                if (!StringUtil.isNullOrEmpty(hv.getPicture()))
                    hv.getVideo().setPicture(hv.getPicture());
            }
            list.add(hv.getVideo());
        }
        List<VideoInfo> list = new ArrayList<>();
        for (int i = 0; i < homeVideoList.size(); i++) {
            HomeVideo hv = (HomeVideo) homeVideoList.get(i);
            if (detailSystem.getPackageName().contains("doudou")) {
                if (!StringUtil.isNullOrEmpty(hv.getPicture()))
                    hv.getVideo().setPicture(hv.getPicture());
            }
            list.add(hv.getVideo());
        }
        JSONObject object = new JSONObject();
        object.put("count", (new StringBuilder(String.valueOf(list.size()))).toString());
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        JSONObject object = new JSONObject();
        object.put("count", (new StringBuilder(String.valueOf(list.size()))).toString());
        JSONArray array = new JSONArray();
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        object.put("data", array);
        object.put("Column", 2);
        out.print(JsonUtil.loadTrueJson(object.toString()));
        object.put("data", array);
        object.put("Column", 2);
        out.print(JsonUtil.loadTrueJson(object.toString()));
    }
    }
    public void getAdList(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
    public void getAdList(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<RecommendAd> list = adService.getRecommendAdList(detailSystem.getId());
        if (list == null)
            list = new ArrayList<>();
        JSONObject object = new JSONObject();
        List<RecommendAd> list = adService.getRecommendAdList(detailSystem.getId());
        if (list == null)
            list = new ArrayList<>();
        JSONObject object = new JSONObject();
        JSONArray array = new JSONArray();
        JSONArray array = new JSONArray();
        object.put("count", (new StringBuilder(String.valueOf(list.size()))).toString());
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        object.put("count", (new StringBuilder(String.valueOf(list.size()))).toString());
        for (int i = 0; i < list.size(); i++)
            array.add(StringUtil.outPutResultJson(list.get(i)));
        object.put("data", array);
        out.print(JsonUtil.loadTrueJson(object.toString()));
    }
        object.put("data", array);
        out.print(JsonUtil.loadTrueJson(object.toString()));
    }
    public void getVideoDetail(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
    public void getVideoDetail(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String videoId = request.getParameter("VideoId");
        String resourceId = request.getParameter("ResourceId");
        String thirdType = request.getParameter("Type");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String packageName = request.getParameter("Package");
        String loginUid = request.getParameter("LoginUid");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(videoId)) {
            out.print(JsonUtil.loadFalseJson("请上传VideoId"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(thirdType)) {
            out.print(JsonUtil.loadFalseJson("请上传Type"));
            return;
        }
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String videoId = request.getParameter("VideoId");
        String resourceId = request.getParameter("ResourceId");
        String thirdType = request.getParameter("Type");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String packageName = request.getParameter("Package");
        String loginUid = request.getParameter("LoginUid");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(videoId)) {
            out.print(JsonUtil.loadFalseJson("请上传VideoId"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(thirdType)) {
            out.print(JsonUtil.loadFalseJson("请上传Type"));
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(platform, Integer.parseInt(version));
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt(version));
        VideoInfo info = (videoDeailUtil.getVideoInfo(null,videoId, resourceId, resourceList,
                CacheUtil.getMD5Long(resourceList)));
        VideoInfo info = (videoDeailUtil.getVideoInfo(null, videoId, resourceId, resourceList,
                CacheUtil.getMD5Long(resourceList)));
        List<VideoType> typeList = classService.getVideoTypeList(info.getId());
        if (typeList != null && typeList.size() > 0) {
            VideoType type = typeList.get(0);
            while (type.getParent() != null)
                type = type.getParent();
            info.setVideoType(type);
        }
        List<VideoType> typeList = classService.getVideoTypeList(info.getId());
        if (typeList != null && typeList.size() > 0) {
            VideoType type = typeList.get(0);
            while (type.getParent() != null)
                type = type.getParent();
            info.setVideoType(type);
        }
        info.setPlayPicture(VideoPictureUtil.getShowPicture(info, platform, version));
        info.setPlayPicture(VideoPictureUtil.getShowPicture(info, platform, version));
        for (VideoDetailInfo vd : info.getVideoDetailList()) {
            if (StringUtil.isNullOrEmpty(vd.getExtraId()))
                vd.setExtraId(vd.getId() + "");
        }
        System.out.println(info.getPlayPicture());
        // info.setPicture(VideoPictureUtil.getShowPicture(info, platform,
        // version));
        for (VideoDetailInfo vd : info.getVideoDetailList()) {
            if (StringUtil.isNullOrEmpty(vd.getExtraId()))
                vd.setExtraId(vd.getId() + "");
        }
        System.out.println(info.getPlayPicture());
        // info.setPicture(VideoPictureUtil.getShowPicture(info, platform,
        // version));
        // 过滤版权视频关键字
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        // 统计添加
        // statisticsService.addStatistics(detailSystem.getId(), videoId);
        // 过滤版权视频关键字
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        // 统计添加
        // statisticsService.addStatistics(detailSystem.getId(), videoId);
        JSONArray array = new JSONArray();
        array.add("http://cloud.letv.com");
        if ((platform.equalsIgnoreCase("android") && !StringUtil.isNullOrEmpty(version)
                && Integer.parseInt(version) > 12) || platform.equalsIgnoreCase("ios")) {
            for (String st : Constant.POJIE_LIST)
                array.add(st);
        }
        JSONArray array = new JSONArray();
        array.add("http://cloud.letv.com");
        if ((platform.equalsIgnoreCase("android") && !StringUtil.isNullOrEmpty(version)
                && Integer.parseInt(version) > 12) || platform.equalsIgnoreCase("ios")) {
            for (String st : Constant.POJIE_LIST)
                array.add(st);
        }
        long count = commentService.getComment2ListCount(videoId, thirdType);
        if (info != null)
            info.setCommentCount((int) count);
        long count = commentService.getComment2ListCount(videoId, thirdType);
        if (info != null)
            info.setCommentCount((int) count);
        JSONObject obj = new JSONObject();
        if (info.getVideoDetailList().size() > 1) {// 多集,可关注
            boolean isAttention = false;
            if (!StringUtil.isNullOrEmpty(loginUid)) {
                isAttention = attentionService.isAddAttention(loginUid, info.getId());
            }
            JSONObject attentionInfo = new JSONObject();
            attentionInfo.put("Name", info.getName());
            attentionInfo.put("Picture", info.getPicture());
            attentionInfo.put("UpdateInfo", "更新:" + TimeUtil.getCommentTime(Long.parseLong(info.getUpdatetime())));
            attentionInfo.put("IsAttention", isAttention);
            obj.put("Attention", attentionInfo);
        }
        UserInfo user = userService.getUserInfo(uid);
        if (Utils.isTest(request, user, detailSystem.getId()))
            out.print(JsonUtil.loadTrueJson(""));
        else
            out.print(JsonUtil.loadTrueJson(StringUtil.outPutResultJson(Utils.convertVideo(info)), array.toString(),
                    obj.toString()));
    }
        JSONObject obj = new JSONObject();
        if (info.getVideoDetailList().size() > 1) {// 多集,可关注
            boolean isAttention = false;
            if (!StringUtil.isNullOrEmpty(loginUid)) {
                isAttention = attentionService.isAddAttention(loginUid, info.getId());
            }
            JSONObject attentionInfo = new JSONObject();
            attentionInfo.put("Name", info.getName());
            attentionInfo.put("Picture", info.getPicture());
            attentionInfo.put("UpdateInfo", "更新:" + TimeUtil.getCommentTime(Long.parseLong(info.getUpdatetime())));
            attentionInfo.put("IsAttention", isAttention);
            obj.put("Attention", attentionInfo);
        }
        UserInfo user = userService.getUserInfo(uid);
        if (Utils.isTest(request, user, detailSystem.getId()))
            out.print(JsonUtil.loadTrueJson(""));
        else
            out.print(JsonUtil.loadTrueJson(StringUtil.outPutResultJson(Utils.convertVideo(info)), array.toString(),
                    obj.toString()));
    }
    public void getNewVideoDetail(String uid, HttpServletRequest request, PrintWriter out) {
        getVideoDetail(uid, request, out);
    }
    public void getNewVideoDetail(String uid, HttpServletRequest request, PrintWriter out) {
        getVideoDetail(uid, request, out);
    }
    public void isCollected(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
    public void isCollected(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String detailId = request.getParameter("Id");
        String platform = request.getParameter("Platform");
        String thirdType = request.getParameter("ThirdType");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(detailId)) {
            out.print(JsonUtil.loadFalseJson("请上传Id"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String detailId = request.getParameter("Id");
        String platform = request.getParameter("Platform");
        String thirdType = request.getParameter("ThirdType");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(detailId)) {
            out.print(JsonUtil.loadFalseJson("请上传Id"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        boolean collect = collectionService.isCollect(uid, detailId, thirdType);
        if (collect)
            out.print(JsonUtil.loadTrueJson(""));
        else
            out.print(JsonUtil.loadFalseJson(""));
        boolean collect = collectionService.isCollect(uid, detailId, thirdType);
        if (collect)
            out.print(JsonUtil.loadTrueJson(""));
        else
            out.print(JsonUtil.loadFalseJson(""));
    }
    }
    public void getPlayUrl(String uid, HttpServletRequest request, PrintWriter out) {
    public void getPlayUrl(String uid, HttpServletRequest request, PrintWriter out) {
        String method = request.getParameter("Method");
        String method = request.getParameter("Method");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String resourceId = request.getParameter("ResourceId");
        String id = request.getParameter("Id");
        String eid = request.getParameter("EId");
        String type = request.getParameter("Type");
        String packageName = request.getParameter("Package");
        String videoId = request.getParameter("VideoId");
        String system = request.getParameter("System");
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String version = request.getParameter("Version");
        String resourceId = request.getParameter("ResourceId");
        String id = request.getParameter("Id");
        String eid = request.getParameter("EId");
        String type = request.getParameter("Type");
        String packageName = request.getParameter("Package");
        String videoId = request.getParameter("VideoId");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
        }
        if (StringUtil.isNullOrEmpty(uid)) {
            out.print(JsonUtil.loadFalseJson("请上传Uid"));
            return;
        }
        if (StringUtil.isNullOrEmpty(system)) {
            out.print(JsonUtil.loadFalseJson("请上传System"));
            return;
        }
        if (StringUtil.isNullOrEmpty(sign)) {
            out.print(JsonUtil.loadFalseJson("请上传Sign"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(platform)) {
            out.print(JsonUtil.loadFalseJson("请上传Platform"));
            return;
        }
        if (StringUtil.isNullOrEmpty(resourceId)) {
            out.print(JsonUtil.loadFalseJson("请上传ResourceId"));
            return;
        }
        if (StringUtil.isNullOrEmpty(resourceId)) {
            out.print(JsonUtil.loadFalseJson("请上传ResourceId"));
            return;
        }
        if (StringUtil.isNullOrEmpty(id) && StringUtil.isNullOrEmpty(eid)) {
            out.print(JsonUtil.loadFalseJson("请上传id"));
            return;
        }
        if (StringUtil.isNullOrEmpty(id) && StringUtil.isNullOrEmpty(eid)) {
            out.print(JsonUtil.loadFalseJson("请上传id"));
            return;
        }
        if (StringUtil.isNullOrEmpty(type)) {
            out.print(JsonUtil.loadFalseJson("请上传type"));
            return;
        }
        if (StringUtil.isNullOrEmpty(type)) {
            out.print(JsonUtil.loadFalseJson("请上传type"));
            return;
        }
        if (StringUtil.isNullOrEmpty(id))
            id = eid;
        if (StringUtil.isNullOrEmpty(id))
            id = eid;
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        PlayUrl pu = videoDeailUtil.getPlayUrl(null, detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
        PlayUrl pu = videoDeailUtil.getPlayUrl(null, detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
        if (pu != null) {
            if (!StringUtil.isNullOrEmpty(pu.getUrl()))
                pu.setUrl(pu.getUrl());
            JSONObject object = JSONObject.fromObject(StringUtil.outPutResultJson(pu));
            out.print(JsonUtil.loadTrueJson(object.toString()));
        } else {
            out.print(JsonUtil.loadFalseJson("找不到该视频"));
        }
        if (pu != null) {
            if (!StringUtil.isNullOrEmpty(pu.getUrl()))
                pu.setUrl(pu.getUrl());
            JSONObject object = JSONObject.fromObject(StringUtil.outPutResultJson(pu));
            out.print(JsonUtil.loadTrueJson(object.toString()));
        } else {
            out.print(JsonUtil.loadFalseJson("找不到该视频"));
        }
    }
    }
    public List<HomeVideo> getZhiBoVideoList() throws Exception {
        List<HomeVideo> list = new ArrayList<>();
        String result = get("http://www.kktv1.com/CDN/output/M/3/I/10002002/P/start-0_offset-6_platform-2/json.js");
        JSONObject object = JSONObject.fromObject(result);
        JSONArray array = object.optJSONArray("roomList");
        for (int i = 0; i < array.size(); i++) {
            VideoInfo info = new VideoInfo();
            JSONObject obj = array.optJSONObject(i);
            info.setId(obj.optString("roomId"));
            info.setName(obj.optString("nickname"));
            info.setTag("在线:" + obj.optString("onlineCount"));
            info.setPicture(obj.optString("poster_path_272"));
            HomeVideo hv = new HomeVideo();
            hv.setPicture(info.getPicture());
            hv.setVideo(info);
            list.add(hv);
        }
        return list;
    }
    public List<HomeVideo> getZhiBoVideoList() throws Exception {
        List<HomeVideo> list = new ArrayList<>();
        String result = get("http://www.kktv1.com/CDN/output/M/3/I/10002002/P/start-0_offset-6_platform-2/json.js");
        JSONObject object = JSONObject.fromObject(result);
        JSONArray array = object.optJSONArray("roomList");
        for (int i = 0; i < array.size(); i++) {
            VideoInfo info = new VideoInfo();
            JSONObject obj = array.optJSONObject(i);
            info.setId(obj.optString("roomId"));
            info.setName(obj.optString("nickname"));
            info.setTag("在线:" + obj.optString("onlineCount"));
            info.setPicture(obj.optString("poster_path_272"));
            HomeVideo hv = new HomeVideo();
            hv.setPicture(info.getPicture());
            hv.setVideo(info);
            list.add(hv);
        }
        return list;
    }
    public String get(String url) {
    public String get(String url) {
        HttpClient client = new HttpClient();
        GetMethod method = new GetMethod(url);
        method.getParams().setContentCharset("UTF-8");
        try {
            client.executeMethod(method);
            String responseBodyAsString = method.getResponseBodyAsString();
            // LogUtil.i(responseBodyAsString);
            return responseBodyAsString;
        } catch (HttpException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "";
    }
        HttpClient client = new HttpClient();
        GetMethod method = new GetMethod(url);
        method.getParams().setContentCharset("UTF-8");
        try {
            client.executeMethod(method);
            String responseBodyAsString = method.getResponseBodyAsString();
            // LogUtil.i(responseBodyAsString);
            return responseBodyAsString;
        } catch (HttpException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "";
    }
}
src/main/java/com/yeshi/buwan/controller/parser/web/WebUserParser.java
@@ -142,7 +142,7 @@
            key = StringUtil.getUTF8String(key, "ISO-8859-1");
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(platform, Integer.parseInt("0"));
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, Integer.parseInt("1"));
        String cacheMD5 = "0";
        if (resourceList != null && resourceList.size() > 0)
            for (Long l : resourceList)
src/main/java/com/yeshi/buwan/controller/parser/web/WebVideosParser.java
@@ -127,8 +127,8 @@
        JSONObject object = new JSONObject();
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(platform, 0);
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, 1);
        // 获取视频列表
        List<VideoInfo> list1;
        if (type.equalsIgnoreCase("area")) {
@@ -198,9 +198,9 @@
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(platform, 0);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1);
        VideoInfo info = (videoDeailUtil.getVideoInfo(null,videoId, resourceId, resourceList,
        VideoInfo info = (videoDeailUtil.getVideoInfo(null, videoId, resourceId, resourceList,
                CacheUtil.getMD5Long(resourceList)));
        if (info == null)
            return;
@@ -285,7 +285,7 @@
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(platform, 0);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1);
        DetailSystem ds = systemService.getDetailSystemByPackage(packageName);
        // 猜你喜欢
src/main/java/com/yeshi/buwan/dao/video/VideoResourceVersionMapDao.java
New file
@@ -0,0 +1,52 @@
package com.yeshi.buwan.dao.video;
import com.yeshi.buwan.domain.video.VideoResourceVersionMap;
import com.yeshi.buwan.dao.base.MongodbBaseDao;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Repository
public class VideoResourceVersionMapDao extends MongodbBaseDao<VideoResourceVersionMap> {
    public void updateSelective(VideoResourceVersionMap bean) {
        Query query = new Query();
        Update update = new Update();
        query.addCriteria(Criteria.where("id").is(bean.getId()));
        if (bean.getDetailSystemId() != null) {
            update.set("detailSystemId", bean.getDetailSystemId());
        }
        if (bean.getVersion() != null) {
            update.set("version", bean.getVersion());
        }
        if (bean.getResourceId() != null) {
            update.set("resourceId", bean.getResourceId());
        }
        if (bean.getRemarks() != null) {
            update.set("remarks", bean.getRemarks());
        }
        if (bean.getCreateTime() != null) {
            update.set("createTime", bean.getCreateTime());
        }
        update.set("updateTime", new Date());
        update(query, update);
    }
    /**
     * 获取有效的来源
     *
     * @param detailSystemId
     * @param version
     * @return
     */
    public List<VideoResourceVersionMap> listValid(String detailSystemId, Integer version) {
        Query query = new Query();
        query.addCriteria(new Criteria().andOperator(Criteria.where("detailSystemId").is(detailSystemId), Criteria.where("version").lte(version)));
        return findList(query);
    }
}
src/main/java/com/yeshi/buwan/domain/video/VideoResourceVersionMap.java
New file
@@ -0,0 +1,95 @@
package com.yeshi.buwan.domain.video;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
/**
 * 视频来源的版本映射
 */
@Document(collection = "videoResourceVersionMap")
public class VideoResourceVersionMap {
    @Id
    private String id;
    @Indexed
    private String detailSystemId;
    @Indexed
    private Integer version;
    private String resourceId;
    private String remarks;
    private Date createTime;
    private Date updateTime;
    public VideoResourceVersionMap() {
    }
    public VideoResourceVersionMap(String detailSystemId, Integer version, String resourceId) {
        this.detailSystemId = detailSystemId;
        this.version = version;
        this.resourceId = resourceId;
    }
    public static String createId(String detailSystemId, Integer version, String resourceId) {
        return detailSystemId + "-" + version + "-" + resourceId;
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getDetailSystemId() {
        return detailSystemId;
    }
    public void setDetailSystemId(String detailSystemId) {
        this.detailSystemId = detailSystemId;
    }
    public Integer getVersion() {
        return version;
    }
    public void setVersion(Integer version) {
        this.version = version;
    }
    public String getResourceId() {
        return resourceId;
    }
    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }
    public String getRemarks() {
        return remarks;
    }
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
src/main/java/com/yeshi/buwan/pptv/PPTVApiUtil.java
@@ -160,7 +160,8 @@
    public static String getOpenId(String uid) {
        Map<String, String> params = new HashMap<>();
        params.put("uid", uid);
        String result = baseRequest("https://coapi.pptv.com/coapi-web/api/http/sopRequest", params, "pptv.channel.openid.get");
//        String result = baseRequest("https://coapi.pptv.com/coapi-web/api/http/sopRequest", params, "pptv.channel.openid.get");
        String result = baseRequest("http://coapiwebsit.cnsuning.com/coapi-web/api/http/sopRequest", params, "pptv.channel.openid.get");
        System.out.println(result);
        JSONObject resultJSON = JSONObject.fromObject(result);
        JSONObject response = resultJSON.optJSONObject("response");
@@ -203,7 +204,7 @@
    public static boolean buyGoods(String openId, String orderNo, String goodsNo, Date orderTime) {
        Map<String, String> params = new HashMap<>();
        params.put("openId", openId);
        params.put("canal", CANAL);
        params.put("canal", "253350");
        params.put("channel", "yeshi");
        params.put("goodsNo", goodsNo);
        params.put("outOrderId", orderNo);
@@ -230,7 +231,8 @@
    }
    public static void main(String[] args) {
        buyGoods("257dfd950c20ad25dee9f99ef926c0f8", "buwan_27", "DA7559531560894", new Date());
        //
        buyGoods("257dfd950c20ad25dee9f99ef926c0f8", "buwan_29", "DA7559531560894", new Date());
    }
src/main/java/com/yeshi/buwan/service/imp/CategoryRecommendCacheVideoService.java
@@ -6,6 +6,7 @@
import java.util.Comparator;
import java.util.List;
import com.yeshi.buwan.domain.DetailSystem;
import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService;
import com.yeshi.buwan.util.JuHe.VideoResourceUtil;
import org.hibernate.HibernateException;
@@ -164,7 +165,7 @@
    @Cacheable(value = "topCache", key = "'getVideoListByRank'+'-'+#videotype+'-'+#detailSystem+'-'+#platform+'-'+#version")
    public List<VideoInfo> getVideoListByRank(final int videotype, final String detailSystem, String platform, Integer version) {
        List<Long> resourceList = videoResourceUtil.getAvailableResourceIds(platform, version);
        List<Long> resourceList = videoResourceUtil.getAvailableResourceIds(new DetailSystem(detailSystem), version);
        final int count = categoryRecommendVideoService.getRankVideoNumber(videotype);
        List<VideoInfo> videoInfoList = (List<VideoInfo>) dao.excute(new HibernateCallback<List<VideoInfo>>() {
src/main/java/com/yeshi/buwan/service/imp/video/VideoResourceVersionMapServiceImpl.java
New file
@@ -0,0 +1,50 @@
package com.yeshi.buwan.service.imp.video;
import com.yeshi.buwan.domain.video.VideoResourceVersionMap;
import com.yeshi.buwan.dao.video.VideoResourceVersionMapDao;
import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
public class VideoResourceVersionMapServiceImpl implements VideoResourceVersionMapService {
    @Resource
    private VideoResourceVersionMapDao videoResourceVersionMapDao;
    @Override
    public void add(VideoResourceVersionMap map) throws Exception {
        if (map == null || map.getDetailSystemId() == null || map.getResourceId() == null || map.getVersion() == null) {
            throw new Exception("参数不完整");
        }
        map.setId(VideoResourceVersionMap.createId(map.getDetailSystemId(), map.getVersion(), map.getResourceId()));
        if (map.getCreateTime() == null) {
            map.setCreateTime(new Date());
        }
        videoResourceVersionMapDao.save(map);
    }
    @Override
    public List<VideoResourceVersionMap> list(String detailSystemId, Integer version) {
        return videoResourceVersionMapDao.listValid(detailSystemId, version);
    }
    @Override
    public List<String> listResourceId(String detailSystemId, Integer version) {
        List<VideoResourceVersionMap> mapList = list(detailSystemId, version);
        List<String> ids = new ArrayList<>();
        if (mapList != null) {
            for (VideoResourceVersionMap map : mapList) {
                ids.add(map.getResourceId());
            }
        }
        return ids;
    }
}
src/main/java/com/yeshi/buwan/service/inter/video/VideoResourceVersionMapService.java
New file
@@ -0,0 +1,35 @@
package com.yeshi.buwan.service.inter.video;
import com.yeshi.buwan.domain.video.VideoResourceVersionMap;
import java.util.List;
public interface VideoResourceVersionMapService {
    /**
     * 添加
     *
     * @param map
     * @throws Exception
     */
    public void add(VideoResourceVersionMap map) throws Exception;
    /**
     * 根据系统和版本查询
     *
     * @param detailSystemId
     * @param version
     * @return
     */
    public List<VideoResourceVersionMap> list(String detailSystemId, Integer version);
    /**
     * 根据系统和版本查询ResourceId
     *
     * @param detailSystemId
     * @param version
     * @return
     */
    public List<String> listResourceId(String detailSystemId, Integer version);
}
src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java
@@ -1,108 +1,29 @@
package com.yeshi.buwan.util.JuHe;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import com.yeshi.buwan.domain.DetailSystem;
import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;
import com.yeshi.buwan.dao.VideoResourceDao;
import com.yeshi.buwan.domain.VideoResource;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Component
public class VideoResourceUtil {
    @Resource
    private VideoResourceDao videoResourceDao;
    private VideoResourceVersionMapService videoResourceVersionMapService;
    public VideoResourceDao getVideoResourceDao() {
        return videoResourceDao;
    }
    public void setVideoResourceDao(VideoResourceDao videoResourceDao) {
        this.videoResourceDao = videoResourceDao;
    }
    @Cacheable(value = "homeCache", key = "'getAvailableResourceIds-'+'-'+#platform+'-'+#versionCode")
    public List<Long> getAvailableResourceIds(String platform, int versionCode) {
        List<VideoResource> resourceList = videoResourceDao.list("from VideoResource");
        List<Long> list = new ArrayList<>();
        if ("android".equalsIgnoreCase(platform)) {// Android
            for (VideoResource vr : resourceList) {
                String resourceName = vr.getName();
                if (resourceName.indexOf("爱奇艺") > -1) {
                    list.add(Long.parseLong(vr.getId()));
                } else if (resourceName.indexOf("腾讯") > -1)
                    list.add(Long.parseLong(vr.getId()));
                else if (resourceName.indexOf("搜狐") > -1)
                    list.add(Long.parseLong(vr.getId()));
                else if (resourceName.indexOf("AcFun") > -1)
                    list.add(Long.parseLong(vr.getId()));
                else if (resourceName.indexOf("风行") > -1)
                    list.add(Long.parseLong(vr.getId()));
                else if (resourceName.indexOf("PPTV") > -1) {
                    //3.8.7以后的Android支持
                    if (versionCode >= 105) {
                        list.add(Long.parseLong(vr.getId()));
                    }
                }
            }
        } else if ("ios".equalsIgnoreCase(platform)) {
            if (versionCode < 14) {
                for (VideoResource vr : resourceList) {
                    if (vr.getName().contains("爱奇艺") || vr.getName().contains("搜狐") || vr.getName().contains("风行")) {
                        list.add(Long.parseLong(vr.getId()));
                    }
                }
            } else if (versionCode < 16) {
                for (VideoResource vr : resourceList) {
                    if (vr.getName().contains("爱奇艺") || vr.getName().contains("搜狐") || vr.getName().contains("风行")) {
                        list.add(Long.parseLong(vr.getId()));
                    }
                }
            } else if (versionCode < 18) {
                for (VideoResource vr : resourceList) {
                    if (vr.getName().contains("爱奇艺")
                            || vr.getName().contains(
                            "搜狐")/* || vr.getName().contains("PPTV") */
                            || vr.getName().contains("腾讯") || vr.getName().contains("风行")) {
                        list.add(Long.parseLong(vr.getId()));
                    }
                }
            } else if (versionCode < 50) {
                for (VideoResource vr : resourceList) {
                    if (vr.getName().contains("爱奇艺")
                            || vr.getName().contains(
                            "搜狐") /* || vr.getName().contains("PPTV") */
                            || vr.getName().contains("腾讯") || vr.getName().contains("乐视")
                    ) {//|| vr.getName().contains("风行")
                        list.add(Long.parseLong(vr.getId()));
                    }
                }
            } else {
                for (VideoResource vr : resourceList) {
                    if (vr.getName().contains("爱奇艺")
                            || vr.getName().contains(
                            "搜狐") /* || vr.getName().contains("PPTV") */
                            || vr.getName().contains("腾讯") || vr.getName().contains("乐视")
                            || vr.getName().contains("AcFun") || vr.getName().contains("风行"))//|| vr.getName().contains("风行")
                        list.add(Long.parseLong(vr.getId()));
                }
            }
        } else {
            for (VideoResource vr : resourceList) {
                if (vr.getName().contains("爱奇艺") || vr.getName().contains("搜狐") || vr.getName().contains("腾讯")
                        || vr.getName().contains("乐视")
                        || vr.getName().contains("AcFun") || vr.getName().contains("风行")) {//
                    // || vr.getName().contains("风行")
                    list.add(Long.parseLong(vr.getId()));
                }
    @Cacheable(value = "homeCache", key = "'getAvailableResourceIds-'+'-'+#detailSystem.id+'-'+#versionCode")
    public List<Long> getAvailableResourceIds(DetailSystem detailSystem, int versionCode) {
        List<String> ridList = videoResourceVersionMapService.listResourceId(detailSystem.getId(), versionCode);
        List<Long> ids = new ArrayList<>();
        if (ridList != null) {
            for (String id : ridList) {
                ids.add(Long.parseLong(id));
            }
        }
        return list;
        return ids;
    }
src/main/java/com/yeshi/buwan/vo/AcceptData.java
@@ -1,5 +1,7 @@
package com.yeshi.buwan.vo;
import com.yeshi.buwan.domain.DetailSystem;
public class AcceptData {
    private String method;
    private String device;
@@ -13,10 +15,22 @@
    private String lng;
    private Integer version;
    private String Package;
    private String uid;
    //注入detailSystem
    private DetailSystem detailSystem;
    public DetailSystem getDetailSystem() {
        return detailSystem;
    }
    public void setDetailSystem(DetailSystem detailSystem) {
        this.detailSystem = detailSystem;
    }
    public String getUid() {
        return uid;
    }
src/test/java/com/hxh/spring/test/FunTV.java
@@ -4,6 +4,7 @@
import com.yeshi.buwan.dao.juhe.funtv.VideoFunTVDao;
import com.yeshi.buwan.dao.juhe.funtv.VideoFunTVNewDao;
import com.yeshi.buwan.domain.DetailSystem;
import com.yeshi.buwan.domain.VideoInfo;
import com.yeshi.buwan.funtv.FunTVApi;
import com.yeshi.buwan.funtv.FunTVDataParseUtil;
@@ -89,8 +90,8 @@
    public void test7() {
        VideoDetailUtil videoDeailUtil = BeanUtil.getBean(VideoDetailUtil.class);
        VideoResourceUtil videoResouceUtil = BeanUtil.getBean(VideoResourceUtil.class);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds("android", Integer.parseInt("48"));
        VideoInfo info = (videoDeailUtil.getVideoInfo(null,227562 + "", "19", resourceList,
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt("48"));
        VideoInfo info = (videoDeailUtil.getVideoInfo(null, 227562 + "", "19", resourceList,
                CacheUtil.getMD5Long(resourceList)));
        System.out.println(info);
    }
@@ -122,6 +123,6 @@
    @Test
    public void getVideoList(){
    public void getVideoList() {
    }
}
src/test/java/com/hxh/spring/test/GeneralTest.java
New file
@@ -0,0 +1,52 @@
package com.hxh.spring.test;
import com.yeshi.buwan.dao.base.MongodbBaseDao;
import com.yeshi.buwan.dao.video.VideoResourceVersionMapDao;
import com.yeshi.buwan.domain.video.VideoResourceVersionMap;
import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService;
import org.yeshi.utils.generater.SpringComponentGenerater;
import org.yeshi.utils.generater.entity.ExceptionData;
import org.yeshi.utils.generater.entity.MongoDBDaoData;
import org.yeshi.utils.generater.entity.ServiceData;
public class GeneralTest {
    @org.junit.Test
    public void createDao() {
        try {
            SpringComponentGenerater.createMongoDao(new MongoDBDaoData.Builder().setBaseDaoClass(MongodbBaseDao.class).setDaoPackageName("com.yeshi.buwan.dao.video").setEntityClass(VideoResourceVersionMap.class).create(), "D:\\workspace\\BuWan\\src\\main\\java\\com\\yeshi\\buwan\\dao\\video\\");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
//
    @org.junit.Test
    public void createService() {
        try {
            SpringComponentGenerater.createService(new ServiceData.Builder().setPackageName("com.yeshi.buwan.service.inter.video").setDaoClass(VideoResourceVersionMapDao.class).setEntityClass(VideoResourceVersionMap.class).build(), "D:\\workspace\\BuWan\\src\\main\\java\\com\\yeshi\\buwan\\service\\inter\\video\\");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
//
//
    @org.junit.Test
    public void createServiceImpl() {
        try {
            SpringComponentGenerater.createServiceImpl(new ServiceData.Builder().setPackageName("com.yeshi.buwan.service.impl.video").setServiceClass(VideoResourceVersionMapService.class).setDaoClass(VideoResourceVersionMapDao.class).setEntityClass(VideoResourceVersionMap.class).build(), "D:\\workspace\\BuWan\\src\\main\\java\\com\\yeshi\\buwan\\service\\imp\\video\\");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
//
//    @org.junit.Test
//    public void createException() {
//        try {
//            SpringComponentGenerater.createException(new ExceptionData.Builder().setPackageName("com.yeshi.buwan.exception.video").setBaseClass(BaseException.class).setEntityClass(LuckySponsorMoneyRecord.class).build(), "D:\\workspace\\DayLucky\\facade-lucky\\src\\main\\java\\com\\ks\\lucky\\exception\\");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
}
src/test/java/com/hxh/spring/test/PPTVTest.java
@@ -16,9 +16,9 @@
import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试
@ContextConfiguration(locations = {"classpath:spring.xml"})
@WebAppConfiguration
//@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试
//@ContextConfiguration(locations = {"classpath:spring.xml"})
//@WebAppConfiguration
public class PPTVTest {
    @Resource
@@ -61,14 +61,14 @@
        //CODE:XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg=
//        PPTVApiUtil.login("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg=");
        String pptvUid = PPTVUtil.decryptPPTVCode("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg=").pptvUid;
//        String openId = PPTVApiUtil.getOpenId(pptvUid);
//        System.out.println(openId);
        String openId = PPTVApiUtil.getOpenId(pptvUid);
        System.out.println(openId);
        try {
            loginUserService.updatePPTVOpenId("766693");
        } catch (PPTVException e) {
            e.printStackTrace();
        }
//        try {
//            loginUserService.updatePPTVOpenId("766693");
//        } catch (PPTVException e) {
//            e.printStackTrace();
//        }
    }
src/test/java/com/hxh/spring/test/Test.java
@@ -2,6 +2,7 @@
import java.util.List;
import com.yeshi.buwan.domain.DetailSystem;
import com.yeshi.buwan.domain.VideoDetailInfo;
import com.yeshi.buwan.domain.VideoInfo;
import com.yeshi.buwan.domain.VideoType;
@@ -23,7 +24,7 @@
        VideoDetailUtil videoDeailUtil = com.yeshi.buwan.util.BeanUtil.getBean(VideoDetailUtil.class);
        ClassService classService = com.yeshi.buwan.util.BeanUtil.getBean(ClassService.class);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds("android", Integer.parseInt(70 + ""));
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt(70 + ""));
        VideoInfo info = (videoDeailUtil.getVideoInfo(null,3400048 + "", 13 + "", resourceList,
                CacheUtil.getMD5Long(resourceList)));
src/test/java/com/hxh/spring/test/video/VideoResourceVersionTest.java
New file
@@ -0,0 +1,72 @@
package com.hxh.spring.test.video;
import com.yeshi.buwan.domain.video.VideoResourceVersionMap;
import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import javax.annotation.Resource;
import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试
@ContextConfiguration(locations = {"classpath:spring.xml"})
@WebAppConfiguration
public class VideoResourceVersionTest {
    @Resource
    private VideoResourceVersionMapService videoResourceVersionMapService;
    @Test
    public void addBuWanAndroid() {
        String[] resourceIds = new String[]{"13", "19", "21", "22", "24"};
        for (String rid : resourceIds) {
            try {
                videoResourceVersionMapService.add(new VideoResourceVersionMap("44", 1, rid));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        resourceIds = new String[]{"25"};
        for (String rid : resourceIds) {
            try {
                videoResourceVersionMapService.add(new VideoResourceVersionMap("44", 105, rid));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    @Test
    public void addBuWanIOS() {
        String[] resourceIds = new String[]{"13", "19", "21", "22", "24"};
        for (String rid : resourceIds) {
            try {
                videoResourceVersionMapService.add(new VideoResourceVersionMap("43", 1, rid));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    @Test
    public void listValid() {
        List<String> resourceIds = videoResourceVersionMapService.listResourceId("43", 105);
        System.out.println(resourceIds);
        resourceIds = videoResourceVersionMapService.listResourceId("44", 1);
        System.out.println(resourceIds);
        resourceIds = videoResourceVersionMapService.listResourceId("44", 2);
        System.out.println(resourceIds);
        resourceIds = videoResourceVersionMapService.listResourceId("44", 106);
        System.out.println(resourceIds);
    }
}