| | |
| | | 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) { |
| | |
| | | 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) { |
| | | getVideoDetail(acceptData, request, 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"); |