| | |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.HotStar; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | |
| | | @Controller |
| | | public class WebFindParser { |
| | | |
| | | @Resource |
| | | private SystemService systemService; |
| | | @Resource |
| | | private SystemService systemService; |
| | | |
| | | @Resource |
| | | private SpecialService specialService; |
| | | @Resource |
| | | private SpecialService specialService; |
| | | |
| | | @Resource |
| | | private StarService starService; |
| | | @Resource |
| | | private StarService starService; |
| | | |
| | | @Resource |
| | | private VideoResourceUtil videoResouceUtil; |
| | | @Resource |
| | | private VideoResourceUtil videoResouceUtil; |
| | | |
| | | // 获取专辑详情 |
| | | public void getSpecialDetail(String uid, HttpServletRequest request, PrintWriter out) { |
| | | String method = request.getParameter("Method"); |
| | | String system = request.getParameter("System"); |
| | | String sign = request.getParameter("Sign"); |
| | | String platform = request.getParameter("Platform"); |
| | | String packageName = request.getParameter("Package"); |
| | | String specialId = request.getParameter("Id"); |
| | | // 获取专辑详情 |
| | | public void getSpecialDetail(String uid, HttpServletRequest request, PrintWriter out) { |
| | | String method = request.getParameter("Method"); |
| | | String system = request.getParameter("System"); |
| | | String sign = request.getParameter("Sign"); |
| | | String platform = request.getParameter("Platform"); |
| | | String packageName = request.getParameter("Package"); |
| | | String specialId = request.getParameter("Id"); |
| | | |
| | | if (StringUtil.isNullOrEmpty(method)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Method")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(uid)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Uid")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(system)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传System")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(sign)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Sign")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(platform)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Platform")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(method)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Method")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(uid)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Uid")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(system)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传System")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(sign)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Sign")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(platform)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Platform")); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(packageName)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Package")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(packageName)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Package")); |
| | | return; |
| | | } |
| | | |
| | | Special special = specialService.getSpecial(specialId); |
| | | List<VideoInfo> list = specialService.getSpecialVideoList(specialId); |
| | | Special special = specialService.getSpecial(specialId); |
| | | List<VideoInfo> list = specialService.getSpecialVideoList(specialId); |
| | | |
| | | JSONObject object = new JSONObject(); |
| | | object.put("count", list.size()); |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).setPicture(VideoPictureUtil.getShowPicture(list.get(i), platform, "0")); |
| | | array.add(StringUtil.outPutResultJson(list.get(i))); |
| | | } |
| | | object.put("data", array); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("count", list.size()); |
| | | JSONArray array = new JSONArray(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).setPicture(VideoPictureUtil.getShowPicture(list.get(i), platform, "0")); |
| | | array.add(StringUtil.outPutResultJson(list.get(i))); |
| | | } |
| | | object.put("data", array); |
| | | |
| | | object.put("special", StringUtil.outPutResultJson(special)); |
| | | out.print(JsonUtil.loadTrueJsonNoencript(object.toString())); |
| | | object.put("special", StringUtil.outPutResultJson(special)); |
| | | out.print(JsonUtil.loadTrueJsonNoencript(object.toString())); |
| | | |
| | | } |
| | | } |
| | | |
| | | // 获取专辑详情 |
| | | public void getStarDetail(String uid, HttpServletRequest request, PrintWriter out) { |
| | | String method = request.getParameter("Method"); |
| | | String system = request.getParameter("System"); |
| | | String sign = request.getParameter("Sign"); |
| | | String platform = request.getParameter("Platform"); |
| | | String packageName = request.getParameter("Package"); |
| | | String starId = request.getParameter("Id"); |
| | | String page = request.getParameter("Page"); |
| | | // 获取专辑详情 |
| | | public void getStarDetail(String uid, HttpServletRequest request, PrintWriter out) { |
| | | String method = request.getParameter("Method"); |
| | | String system = request.getParameter("System"); |
| | | String sign = request.getParameter("Sign"); |
| | | String platform = request.getParameter("Platform"); |
| | | String packageName = request.getParameter("Package"); |
| | | String starId = request.getParameter("Id"); |
| | | String page = request.getParameter("Page"); |
| | | |
| | | if (StringUtil.isNullOrEmpty(method)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Method")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(uid)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Uid")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(system)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传System")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(sign)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Sign")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(platform)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Platform")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(method)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Method")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(uid)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Uid")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(system)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传System")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(sign)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Sign")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(platform)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Platform")); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(packageName)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Package")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(packageName)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Package")); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(page)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Page")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(page)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Page")); |
| | | return; |
| | | } |
| | | |
| | | int pageIndex = Integer.parseInt(page); |
| | | int pageIndex = Integer.parseInt(page); |
| | | |
| | | HotStar hot = starService.getHotStarDetail(starId); |
| | | HotStar hot = starService.getHotStarDetail(starId); |
| | | |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(platform, Integer.parseInt("0")); |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName); |
| | | List<VideoInfo> list1 = starService.getStarVideo(detailSystem.getId(), starId, pageIndex, resourceList, |
| | | CacheUtil.getMD5Long(resourceList)); |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName); |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, Integer.parseInt("1")); |
| | | List<VideoInfo> list1 = starService.getStarVideo(detailSystem.getId(), starId, pageIndex, resourceList, |
| | | CacheUtil.getMD5Long(resourceList)); |
| | | |
| | | for (VideoInfo info : list1) { |
| | | info.setIntroduction(""); |
| | | info.setPicture(VideoPictureUtil.getShowPicture(info, platform, "0")); |
| | | } |
| | | List<VideoInfo> list = new ArrayList<VideoInfo>(); |
| | | list.addAll(list1); |
| | | JSONArray array = new JSONArray(); |
| | | for (VideoInfo v : list) |
| | | array.add(StringUtil.outPutResultJson(v)); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("star", StringUtil.outPutResultJson(hot)); |
| | | object.put("videos", array); |
| | | out.print(JsonUtil.loadTrueJsonNoencript(object.toString())); |
| | | } |
| | | for (VideoInfo info : list1) { |
| | | info.setIntroduction(""); |
| | | info.setPicture(VideoPictureUtil.getShowPicture(info, platform, "0")); |
| | | } |
| | | List<VideoInfo> list = new ArrayList<VideoInfo>(); |
| | | list.addAll(list1); |
| | | JSONArray array = new JSONArray(); |
| | | for (VideoInfo v : list) |
| | | array.add(StringUtil.outPutResultJson(v)); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("star", StringUtil.outPutResultJson(hot)); |
| | | object.put("videos", array); |
| | | out.print(JsonUtil.loadTrueJsonNoencript(object.toString())); |
| | | } |
| | | |
| | | } |