admin
2021-04-25 36aafca8d6c1964bb755fe2ae030b163b6d0f92b
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());
                }
            }
        }