From 42fa17d6209d10cbe4774388d0ff3fcf3329eb5a Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 16 六月 2021 13:53:17 +0800 Subject: [PATCH] zookeeper地址修改 --- src/main/java/com/yeshi/buwan/controller/admin/api/VideoAdminController.java | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/controller/admin/api/VideoAdminController.java b/src/main/java/com/yeshi/buwan/controller/admin/api/VideoAdminController.java index 830a467..442f366 100644 --- a/src/main/java/com/yeshi/buwan/controller/admin/api/VideoAdminController.java +++ b/src/main/java/com/yeshi/buwan/controller/admin/api/VideoAdminController.java @@ -2,6 +2,7 @@ import java.io.PrintWriter; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -10,11 +11,13 @@ import com.google.common.base.Function; import com.google.common.collect.Maps; import com.google.gson.Gson; +import com.yeshi.buwan.domain.VideoResource; import com.yeshi.buwan.domain.solr.SolrAlbumVideo; import com.yeshi.buwan.domain.video.VideoInfoExtra; import com.yeshi.buwan.dto.search.SolrResultDTO; import com.yeshi.buwan.dto.search.SolrVideoSearchFilter; import com.yeshi.buwan.iqiyi.IqiYiNewAPI; +import com.yeshi.buwan.service.imp.VideoResourceService; import com.yeshi.buwan.service.inter.video.VideoInfoExtraService; import com.yeshi.buwan.service.manager.SolrAlbumVideoDataManager; import com.yeshi.buwan.util.Constant; @@ -50,6 +53,9 @@ @Resource private ResourceVideoService resourceVideoService; + + @Resource + private VideoResourceService videoResourceService; @Resource private IqiyiUtil iqiyiUtil; @@ -92,7 +98,7 @@ } @RequestMapping(value = "/videolist", method = RequestMethod.POST) - public void videoList(int videotype, int page, String key, String type, String resourceIds, int contenttype, String freeType, PrintWriter out) { + public void videoList(int videotype, int page, String key, String type, String resourceIds, int contenttype, String freeType, String area, PrintWriter out) { if (StringUtil.isNullOrEmpty(type)) { type = "name"; @@ -139,10 +145,18 @@ filter.setFreeType(freeTypeInt); + filter.setArea(StringUtil.isNullOrEmpty(area) ? null : area.trim()); + + List<VideoResource> resourceList = videoResourceService.getResourceList(); + Map<Long, String> resourceMap = new HashMap<>(); + for (VideoResource vr : resourceList) { + resourceMap.put(Long.parseLong(vr.getId()), vr.getName()); + } + SolrResultDTO dto = solrAlbumDataManager.find(filter, page, Constant.pageCount); if (dto.getVideoList() != null) for (SolrAlbumVideo videoInfo : (List<SolrAlbumVideo>) dto.getVideoList()) - voList.add(VideoAdminInfoVO.create(videoInfo)); + voList.add(VideoAdminInfoVO.create(videoInfo,resourceMap)); count = dto.getTotalCount(); } else { list = classService.getTypeVideoListAdmin(videotype == 0 ? "" : videotype + "", page, key, @@ -170,8 +184,16 @@ for (VideoAdminInfoVO a : voList) { VideoInfoExtra extra = maps.get(a.getId()); if (extra != null) { - if (!StringUtil.isNullOrEmpty(extra.gethPosterPicture())) - a.setPicture(extra.gethPosterPicture()); + + if (a.getHpicture() != null) { + if (!StringUtil.isNullOrEmpty(extra.gethPosterPicture())) + a.setHpicture(extra.gethPosterPicture()); + } + + if (a.getVpicture() != null) { + if (!StringUtil.isNullOrEmpty(extra.getvPosterPicture())) + a.setVpicture(extra.getvPosterPicture()); + } } } -- Gitblit v1.8.0