admin
2024-09-05 8631bb49abe5dfed233bc579a228c578232f8079
src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java
@@ -8,13 +8,14 @@
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;
import org.springframework.stereotype.Controller;
import com.yeshi.buwan.domain.CategoryContry;
import com.yeshi.buwan.domain.DetailSystem;
import com.yeshi.buwan.domain.system.DetailSystem;
import com.yeshi.buwan.domain.HomeAd;
import com.yeshi.buwan.domain.HomeType;
import com.yeshi.buwan.domain.HomeVideo;
@@ -35,7 +36,7 @@
import com.yeshi.buwan.service.imp.ClassService;
import com.yeshi.buwan.service.imp.CollectionService;
import com.yeshi.buwan.service.imp.CommentService;
import com.yeshi.buwan.service.imp.ConfigService;
import com.yeshi.buwan.service.imp.DetailSystemConfigService;
import com.yeshi.buwan.service.imp.HomeAdService;
import com.yeshi.buwan.service.imp.HomeTypeService;
import com.yeshi.buwan.service.imp.RecommendService;
@@ -71,7 +72,7 @@
    @Resource
    private HomeTypeService homeTypeService;
    @Resource
    private ConfigService configService;
    private DetailSystemConfigService configService;
    @Resource
    private AdService adService;
    @Resource
@@ -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()))