admin
2024-10-17 b30fb8afd3cd6228bda9b182dc412bb3c8daf69c
src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java
@@ -8,6 +8,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.yeshi.buwan.exception.video.VideoPlayException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
@@ -123,6 +124,7 @@
        String sign = request.getParameter("Sign");
        String platform = request.getParameter("Platform");
        String packageName = request.getParameter("Package");
        String channel = request.getParameter("Channel");
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
            return;
@@ -148,7 +150,7 @@
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<HomeAd> list = homeAdService.getHomeAdList(detailSystem);
        List<HomeAd> list = homeAdService.getHomeAdList(detailSystem, "recommend");
        for (HomeAd ad : list) {
            if (ad.getVideo() != null) {
@@ -164,7 +166,7 @@
            array.add(StringUtil.outPutResultJson(list.get(i)));
        object.put("homeAdList", array);
        object.put("homeTypeList", getHomeType(uid, platform, detailSystem.getId()));
        object.put("homeTypeList", getHomeType(uid, platform, detailSystem.getId(), channel));
        // 排行
        JSONObject rank = new JSONObject();
@@ -188,11 +190,11 @@
    }
    // 首页类型获取
    private JSONArray getHomeType(String uid, String platform, String detailsystemid) {
    private JSONArray getHomeType(String uid, String platform, String detailsystemid, String channel) {
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1);
        List<HomeType> list1 = homeTypeService.getHomeType(detailsystemid, resourceList,
                CacheUtil.getMD5Long(resourceList), 10, 309);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1, channel);
        List<HomeType> list1 = homeTypeService.getHomeType(detailsystemid, platform, 1, resourceList,
                CacheUtil.getMD5Long(resourceList), 10, "recommend");
        List<HomeType> list = new ArrayList<>();
        for (HomeType ht : list1)
            list.add(ht);
@@ -389,7 +391,7 @@
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1);
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1, null);
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        List<VideoType> typeList = getFirstType(pid);
@@ -770,7 +772,7 @@
            return;
        }
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt(version));
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt(version), null);
        VideoInfo info = (videoDeailUtil.getVideoInfo(null, videoId, resourceId, resourceList,
                CacheUtil.getMD5Long(resourceList)));
@@ -933,7 +935,12 @@
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        PlayUrl pu = videoDeailUtil.getPlayUrl(null, detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
        PlayUrl pu = null;
        try {
            pu = videoDeailUtil.getPlayUrl(null, detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
        } catch (VideoPlayException e) {
            e.printStackTrace();
        }
        if (pu != null) {
            if (!StringUtil.isNullOrEmpty(pu.getUrl()))