| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.util.annotation.RequireUid; |
| | | import com.yeshi.buwan.vo.AcceptData; |
| | | import org.apache.commons.httpclient.HttpClient; |
| | |
| | | import org.apache.commons.httpclient.methods.GetMethod; |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import com.yeshi.buwan.domain.Config; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.RecommendAd; |
| | | import com.yeshi.buwan.domain.UserInfo; |
| | | import com.yeshi.buwan.domain.VideoDetailInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | | import com.yeshi.buwan.domain.entity.PlayUrl; |
| | | import com.yeshi.buwan.service.imp.AdService; |
| | | import com.yeshi.buwan.service.imp.AttentionService; |
| | |
| | | |
| | | @Resource |
| | | private ClassParser classParser; |
| | | |
| | | @Resource |
| | | private VideoDetailUtil videoDetailUtil; |
| | | |
| | | @RequireUid |
| | | public void getHomeAd(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getPlatform(), acceptData.getVersion()); |
| | | List<HomeType> list1 = homeTypeService.getHomeType(detailSystem.getId(), resourceList, |
| | | CacheUtil.getMD5Long(resourceList), -1, Long.parseLong(vtid)); |
| | | List<HomeType> list = new ArrayList<HomeType>(); |
| | | List<HomeType> list = new ArrayList<>(); |
| | | for (HomeType ht : list1) |
| | | list.add(ht); |
| | | if ("309".equals(vtid)) { |
| | |
| | | zhibo.setName("美女"); |
| | | zhibo.setHasMore(true); |
| | | zhibo.setColumns(2); |
| | | zhibo.setHomeVideoList(meiNvZhiBoUtil.getMeiNvZhiBo(MeiNvZhiBoUtil.MEINV_KK,detailSystem,acceptData.getVersion())); |
| | | zhibo.setHomeVideoList(meiNvZhiBoUtil.getMeiNvZhiBo(MeiNvZhiBoUtil.MEINV_KK, detailSystem, acceptData.getVersion())); |
| | | List<VideoInfo> zhiboVideo = new ArrayList<VideoInfo>(); |
| | | for (HomeVideo v : zhibo.getHomeVideoList()) |
| | | zhiboVideo.add(v.getVideo()); |
| | |
| | | |
| | | for (HomeType ht : list) { |
| | | for (int i = 0; i < ht.getHomeVideoList().size(); i++) { |
| | | //改变图片 |
| | | if (JuheVideoUtil.isNeedDelete(ht.getHomeVideoList().get(i).getVideo(), detailSystem.getId())) { |
| | | ht.getHomeVideoList().remove(i); |
| | | i--; |
| | |
| | | JSONObject attentionInfo = new JSONObject(); |
| | | attentionInfo.put("Name", info.getName()); |
| | | attentionInfo.put("Picture", info.getPicture()); |
| | | attentionInfo.put("UpdateInfo", "更新:" + TimeUtil.getCommentTime(Long.parseLong(info.getUpdatetime()))); |
| | | if (StringUtil.isNullOrEmpty(info.getUpdatetime())) |
| | | attentionInfo.put("UpdateInfo", "更新:" + TimeUtil.getCommentTime(info.getCreatetime())); |
| | | else |
| | | attentionInfo.put("UpdateInfo", "更新:" + TimeUtil.getCommentTime(Long.parseLong(info.getUpdatetime()))); |
| | | attentionInfo.put("IsAttention", isAttention); |
| | | obj.put("Attention", attentionInfo); |
| | | } |
| | |
| | | out.print(JsonUtil.loadTrueJson(StringUtil.outPutResultJson(Utils.convertVideo(info)), array.toString(), |
| | | obj.toString())); |
| | | } |
| | | |
| | | /** |
| | | * 获取视频的剧集列表 |
| | | * |
| | | * @param acceptData |
| | | * @param request |
| | | * @param out |
| | | */ |
| | | @RequireUid |
| | | public void getVideoEpisodeList(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | | String videoId = request.getParameter("VideoId"); |
| | | String resourceId = request.getParameter("ResourceId"); |
| | | String page = request.getParameter("Page");//页码 |
| | | |
| | | if (StringUtil.isNullOrEmpty(videoId)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传VideoId")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(resourceId)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传ResourceId")); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(page)) { |
| | | out.print(JsonUtil.loadFalseJson("请上传Page")); |
| | | return; |
| | | } |
| | | |
| | | |
| | | List<VideoDetailInfo> list = videoDetailUtil.getVideoDetailList(videoId, new VideoResource(resourceId), Integer.parseInt(page), 100); |
| | | if (list == null) |
| | | list = new ArrayList<>(); |
| | | JSONObject data = new JSONObject(); |
| | | String listStr = StringUtil.outPutResultJson(list); |
| | | boolean hasMore = list != null && list.size() > 0; |
| | | data.put("list", listStr); |
| | | data.put("hasMore", hasMore); |
| | | out.print(JsonUtil.loadTrueJson(data.toString())); |
| | | } |
| | | |
| | | |
| | | @RequireUid |
| | | public void getNewVideoDetail(AcceptData acceptData, HttpServletRequest request, PrintWriter out) { |
| | |
| | | |
| | | DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName()); |
| | | |
| | | PlayUrl pu = videoDeailUtil.getPlayUrl(detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId); |
| | | PlayUrl pu = videoDeailUtil.getPlayUrl(acceptData,detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId); |
| | | |
| | | if (pu != null) { |
| | | if (!StringUtil.isNullOrEmpty(pu.getUrl())) |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | public List<HomeVideo> getZhiBoVideoList() throws Exception { |
| | | List<HomeVideo> list = new ArrayList<HomeVideo>(); |
| | | String result = get("http://www.kktv1.com/CDN/output/M/3/I/10002002/P/start-0_offset-6_platform-2/json.js"); |