admin
2024-09-05 8631bb49abe5dfed233bc579a228c578232f8079
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;
@@ -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,9 +190,9 @@
    }
    // 首页类型获取
    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<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<>();
@@ -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()))