From 81db7b3b070c003e6f5f0d1c757ab30b6f42c944 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 10 十月 2020 18:49:41 +0800 Subject: [PATCH] 百度内容联盟 --- src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java | 101 ++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 77 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java b/src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java index 20cde2c..562d8aa 100644 --- a/src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java +++ b/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++) { @@ -148,15 +149,15 @@ // } // } - 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) { @@ -237,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(3, 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"); -- Gitblit v1.8.0