admin
2020-10-13 fc7a6634496066fe45dca8ea9832bdd2f7341db4
src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java
@@ -12,6 +12,7 @@
import com.yeshi.buwan.util.ad.CommonAdUtil;
import com.yeshi.buwan.util.annotation.RequireUid;
import com.yeshi.buwan.vo.AcceptData;
import com.yeshi.buwan.vo.HomeClassVO;
import com.yeshi.buwan.vo.video.VideoListResultVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -75,26 +76,26 @@
            }
        }
        if ("android".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() > 53) {
            SuperVideoType sty = new SuperVideoType();
            sty.setCreatetime(0 + "");
            sty.setPicture("");
            VideoType vt = new VideoType(22222);
            vt.setName("头条");
            vt.setCategoryType("http://wap.baizhan.net/09");
            vt.setIcon("http://img.zcool.cn/community/01e299592fd75ba8012193a365723f.png@1280w_1l_2o_100sh.png");
            sty.setType(vt);
            boolean isC = false;
            for (SuperVideoType svt : list) {
                if (svt.getType().getId() == vt.getId()) {
                    isC = true;
                    break;
                }
            }
            if (!isC)
                list.add(sty);
        }
//        if ("android".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() > 53) {
//            SuperVideoType sty = new SuperVideoType();
//            sty.setCreatetime(0 + "");
//            sty.setPicture("");
//            VideoType vt = new VideoType(22222);
//            vt.setName("头条");
//            vt.setCategoryType("http://wap.baizhan.net/09");
//            vt.setIcon("http://img.zcool.cn/community/01e299592fd75ba8012193a365723f.png@1280w_1l_2o_100sh.png");
//            sty.setType(vt);
//            boolean isC = false;
//            for (SuperVideoType svt : list) {
//                if (svt.getType().getId() == vt.getId()) {
//                    isC = true;
//                    break;
//                }
//            }
//
//            if (!isC)
//                list.add(sty);
//        }
        List<VideoType> typeList = new ArrayList<VideoType>();
        for (int i = 0; i < list.size(); i++) {
@@ -130,35 +131,33 @@
        List<SuperVideoType> list = new ArrayList<>();
        list.addAll(list1);
        if ("huawei".equalsIgnoreCase(acceptData.getChannel())) {
            for (int i = 0; i < list.size(); i++) {
                if (list.get(i).getType().getName().contains("资讯")) {
                    list.remove(i);
                    break;
                }
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).getType().getName().contains("资讯")) {
                list.remove(i);
                break;
            }
        }
        if (acceptData.getPlatform().equalsIgnoreCase("android")) {
            for (SuperVideoType type : list) {
                if (type.getType().getName().contains("资讯")) {
                    type.getType().setName("主播");
                    type.getType().setId(1111);
                    type.getType().setIcon("http://img.zcool.cn/community/017fdb57610d8a0000012e7e74b496.png");
                    break;
                }
            }
        }
//        if (acceptData.getPlatform().equalsIgnoreCase("android")) {
//            for (SuperVideoType type : list) {
//                if (type.getType().getName().contains("资讯")) {
//                    type.getType().setName("主播");
//                    type.getType().setId(1111);
//                    type.getType().setIcon("http://img.zcool.cn/community/017fdb57610d8a0000012e7e74b496.png");
//                    break;
//                }
//            }
//        }
        if ("android".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() > 53) {
        if ("android".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() > 53 && !"qq".equalsIgnoreCase(acceptData.getChannel())) {
            SuperVideoType sty = new SuperVideoType();
            sty.setCreatetime(0 + "");
            sty.setPicture("");
            VideoType vt = new VideoType(22222);
            vt.setName("头条");
            vt.setName("美女直播");
            vt.setShow("1");
            vt.setCategoryType("http://wap.baizhan.net/09");
            vt.setIcon("http://img.zcool.cn/community/01e299592fd75ba8012193a365723f.png@1280w_1l_2o_100sh.png");
            vt.setCategoryType("http://m.v.6.cn/event/porkvideo?src=9n8wc5medm&nologo=1&t=2");
            vt.setIcon("https://hbimg.huabanimg.com/12834704bb4aa39342c2fb51e0c644181b13997b70eb-CqlE1I_fw658/format/webp");
            sty.setType(vt);
            boolean isC = false;
            for (SuperVideoType svt : list) {
@@ -239,6 +238,58 @@
    }
    /**
     * 获取首页导航分类
     *
     * @param acceptData
     * @param request
     * @param out
     */
    public void getHomeClass(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        UserInfo user = userService.getUserInfo(acceptData.getUid());
        if (Utils.isTest(request, user, detailSystem.getId()))
            detailSystem = systemService.getDetailSystemById(40 + "");
        List<SuperVideoType> list = classService.getSuperVideoTypeTitleList(detailSystem.getId());
        List<HomeClassVO> typelist = new ArrayList<>();
        for (SuperVideoType sv : list) {
            VideoType type = sv.getType();
            HomeClassVO vo = new HomeClassVO();
            if ("0".equalsIgnoreCase(type.getShow()))
                vo.setDataType(HomeClassVO.DATA_TYPE_RECOMMEND);
            else
                vo.setDataType(HomeClassVO.DATA_TYPE_CLASS);
            vo.setId(type.getId());
            vo.setName(type.getName());
            vo.setShowTitle(type.getShowTitle());
            vo.setType(type.getType());
            vo.setCategoryType(type.getCategoryType());
            typelist.add(vo);
        }
        HomeClassVO vo = new HomeClassVO();
        vo.setDataType(HomeClassVO.DATA_TYPE_NOVEL);
        vo.setName("小说");
        typelist.add(1, vo);
        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++)
            array.add(StringUtil.outPutResultJson(typelist.get(j)));
        object.put("data", array);
        out.print(JsonUtil.loadTrueJson(object.toString()));
    }
    public void getHotStars(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
        String page = request.getParameter("Page");