admin
2021-04-25 36aafca8d6c1964bb755fe2ae030b163b6d0f92b
后台分区网页优化,HomeVideo初步支持来自全网搜的数据
17个文件已修改
2个文件已添加
814 ■■■■■ 已修改文件
src/main/java/com/yeshi/buwan/controller/admin/api/ClassController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/admin/api/HomeTypeController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/admin/api/VideoAdminController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/domain/HomeVideo.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/funtv/FunTVDataParseUtil.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/funtv/FunTVUtil2.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/job/OrderJob.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/HomeTypeService.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/juhe/InternetSearchVideoServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/juhe/IqiyiService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/imp/recommend/HomeVideoServiceImpl.java 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/inter/juhe/InternetSearchVideoService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/service/inter/recommend/HomeVideoService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/vo/video/VideoAdminInfoVO.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/domain/HomeVideo.hbm.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/ehcache.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/admin/new/fenqu.html 448 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/hxh/spring/test/HomeTypeTest.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yeshi/buwan/controller/admin/api/ClassController.java
@@ -127,7 +127,7 @@
            hv.setTag(tagStr[i]);
            hv.setPicture(pictureStr[i]);
            hv.setType(new HomeType(hometypeid + ""));
            hv.setVideo(new VideoInfo(videoStr[i]));
            hv.setVideoId(videoStr[i]);
            hv.setBigPicture(false);
        }
src/main/java/com/yeshi/buwan/controller/admin/api/HomeTypeController.java
@@ -13,6 +13,7 @@
import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial;
import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService;
import com.yeshi.buwan.service.inter.recommend.HomeVideoService;
import com.yeshi.buwan.util.SystemUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -42,6 +43,9 @@
    @Resource
    private HomeTypeService homeTypeService;
    @Resource
    private HomeVideoService homeVideoService;
    @Resource
    private HomeRecommendSpecialService homeRecommendSpecialService;
@@ -138,7 +142,7 @@
                    hv.setTag(tag);
                }
                hv.setType(new HomeType(ht));
                hv.setVideo(new VideoInfo(vid));
                hv.setVideoId(vid);
                hv.setBigPicture(false);
                list.add(hv);
            }
@@ -278,12 +282,12 @@
    @RequestMapping(value = "/gethomevideolist", method = RequestMethod.POST)
    public void getHomeVideoList(long id, int page, String key, PrintWriter out) {
        key = StringUtil.isNullOrEmpty(key) ? "" : key;
        List<HomeVideo> list = homeTypeService.getHomeVideoList(id + "", key, page);
        List<HomeVideo> list = homeVideoService.getHomeVideoList(id + "", key, page);
        for (HomeVideo homeVideo : list) {
            homeVideo.setType(null);
            homeVideo.setAdmin(null);
        }
        long count = homeTypeService.getHomeVideoListCount(id + "", key);
        long count = homeVideoService.getHomeVideoListCount(id + "", key);
        PageEntity pe = new PageEntity();
        pe.setPageIndex(page);
        pe.setPageSize(Constant.pageCount);
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;
@@ -141,10 +147,16 @@
            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,
src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java
@@ -31,6 +31,7 @@
import com.yeshi.buwan.service.inter.juhe.PPTVService;
import com.yeshi.buwan.service.inter.juhe.YouKuService;
import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService;
import com.yeshi.buwan.service.inter.recommend.HomeVideoService;
import com.yeshi.buwan.service.inter.video.VideoWatchHistoryService;
import com.yeshi.buwan.service.manager.VideoPlayStatisticManager;
import com.yeshi.buwan.tencent.TencentVideoUtil;
@@ -71,6 +72,10 @@
    private HomeAdService homeAdService;
    @Resource
    private HomeTypeService homeTypeService;
    @Resource
    private HomeVideoService homeVideoService;
    @Resource
    private DetailSystemConfigService configService;
    @Resource
@@ -310,11 +315,11 @@
                long bigPictureCount = homeType.isBigPicture() ? 1 : 0;// homeTypeService.getHomeVideoListCount(homeType.getId(), resourceKey, resourceList, true);
                List<HomeVideo> homeVideoList = homeTypeService.getHomeVideoList(homeType.getId(), resourceKey, resourceList, null, 1, homeType.getNumber() + (int) bigPictureCount);
                List<HomeVideo> homeVideoList = homeVideoService.getHomeVideoList(homeType.getId(), resourceKey, resourceList, null, 1, homeType.getNumber() + (int) bigPictureCount);
                if (bigPictureCount > 0 && homeVideoList.size() > 0) {
                    homeVideoList.get(0).setBigPicture(true);
                }
                long videoCount = homeTypeService.getHomeVideoListCount(homeType.getId(), resourceKey, resourceList, null);
                long videoCount = homeVideoService.getHomeVideoListCount(homeType.getId(), resourceKey, resourceList, null);
                if (videoCount - bigPictureCount > homeType.getNumber()) {
                    while ((videoCount - bigPictureCount) % homeType.getNumber() != 0) {
@@ -397,7 +402,7 @@
        List<HomeVideo> bigPictureVideos = new ArrayList<>();
        if (homeType.isBigPicture()) {
            bigPictureVideos = homeTypeService.getHomeVideoList(homeTypeId, org.yeshi.utils.StringUtil.concat(resourceList, ","), resourceList, null, 1, 1);
            bigPictureVideos = homeVideoService.getHomeVideoList(homeTypeId, org.yeshi.utils.StringUtil.concat(resourceList, ","), resourceList, null, 1, 1);
            if (bigPictureVideos != null && bigPictureVideos.size() > 0)
                bigPictureVideos.get(0).setBigPicture(true);
        }
@@ -407,7 +412,7 @@
        JSONObject object = new JSONObject();
        String resourceKey = StringUtil.Md5(org.yeshi.utils.StringUtil.concat(resourceList, ","));
        Long count = homeTypeService.getHomeVideoListCount(homeTypeId, resourceKey, resourceList, null);
        Long count = homeVideoService.getHomeVideoListCount(homeTypeId, resourceKey, resourceList, null);
        if (count - bigPictureVideos.size() > homeType.getNumber()) {
            while ((count - bigPictureVideos.size()) % homeType.getNumber() != 0) {
@@ -416,7 +421,7 @@
        }
        List<HomeVideo> list1 = homeTypeService.getHomeVideoList(homeTypeId, resourceKey, resourceList, homeType.isBigPicture(), page, homeType.getNumber());
        List<HomeVideo> list1 = homeVideoService.getHomeVideoList(homeTypeId, resourceKey, resourceList, homeType.isBigPicture(), page, homeType.getNumber());
        List<HomeVideo> list = new ArrayList<>();
        list.addAll(bigPictureVideos);
        list.addAll(list1);
@@ -463,7 +468,7 @@
        List<HomeVideo> homeVideoList = homeTypeService.getVideoByTypes(type, pageIndex, detailSystem);
        List<VideoInfo> list = new ArrayList<VideoInfo>();
        List<VideoInfo> list = new ArrayList<>();
        for (int i = 0; i < homeVideoList.size(); i++) {
            HomeVideo hv = (HomeVideo) homeVideoList.get(i);
            if (acceptData.getPackageName().contains("doudou")) {
src/main/java/com/yeshi/buwan/domain/HomeVideo.java
@@ -35,6 +35,17 @@
    @Expose
    private Boolean bigPicture;//是否为大图显示
    @Expose
    private String videoId;
    public String getVideoId() {
        return videoId;
    }
    public void setVideoId(String videoId) {
        this.videoId = videoId;
    }
    public Boolean getBigPicture() {
        return bigPicture;
    }
src/main/java/com/yeshi/buwan/funtv/FunTVDataParseUtil.java
@@ -61,7 +61,7 @@
    // 电视剧解析
    public static List<FunTVTVAlbum> parseTVListAlbum(String protocolXML) {
        List<FunTVTVAlbum> videoList = new ArrayList<FunTVTVAlbum>();
        List<FunTVTVAlbum> videoList = new ArrayList<>();
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
@@ -136,7 +136,7 @@
    // 综艺解析
    public static List<FunTVShowAlbum> parseShowListVideo(String protocolXML) {
        List<FunTVShowAlbum> videoList = new ArrayList<FunTVShowAlbum>();
        List<FunTVShowAlbum> videoList = new ArrayList<>();
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
@@ -161,7 +161,7 @@
    // 小视频解析
    public static List<FunTVShortVideo> parseShortListVideo(String protocolXML) {
        List<FunTVShortVideo> videoList = new ArrayList<FunTVShortVideo>();
        List<FunTVShortVideo> videoList = new ArrayList<>();
        try {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
@@ -311,7 +311,7 @@
                    } else if ("details".equalsIgnoreCase(contents.item(j).getNodeName())) {
                        // 详情
                        NodeList videos = contents.item(j).getChildNodes();
                        List<FunTVTVVideo> videoList = new ArrayList<FunTVTVVideo>();
                        List<FunTVTVVideo> videoList = new ArrayList<>();
                        for (int n = 0; n < videos.getLength(); n++) {
                            if (videos.item(n).getNodeName().equalsIgnoreCase("detail")) {
                                NodeList videoDetails = videos.item(n).getChildNodes();
@@ -494,7 +494,7 @@
                    } else if ("details".equalsIgnoreCase(contents.item(j).getNodeName())) {
                        // 详情
                        NodeList videos = contents.item(j).getChildNodes();
                        List<FunTVCartoonVideo> videoList = new ArrayList<FunTVCartoonVideo>();
                        List<FunTVCartoonVideo> videoList = new ArrayList<>();
                        for (int n = 0; n < videos.getLength(); n++) {
                            if (videos.item(n).getNodeName().equalsIgnoreCase("detail")) {
                                NodeList videoDetails = videos.item(n).getChildNodes();
@@ -598,7 +598,7 @@
                    } else if ("shows".equalsIgnoreCase(contents.item(j).getNodeName())) {
                        // 详情
                        NodeList videos = contents.item(j).getChildNodes();
                        List<FunTVShowVideo> videoList = new ArrayList<FunTVShowVideo>();
                        List<FunTVShowVideo> videoList = new ArrayList<>();
                        for (int n = 0; n < videos.getLength(); n++) {
                            if (videos.item(n).getNodeName().equalsIgnoreCase("show")) {
                                NodeList videoDetails = videos.item(n).getChildNodes();
src/main/java/com/yeshi/buwan/funtv/FunTVUtil2.java
@@ -241,7 +241,7 @@
        };
        Collections.sort(pm.getVideoList(), cp);
        List<FunTVVideo> vlist = new ArrayList<FunTVVideo>();
        List<FunTVVideo> vlist = new ArrayList<>();
        boolean isUpdate = false;
        if (pm.getVideoList().size() > 0 && pv != null)
src/main/java/com/yeshi/buwan/job/OrderJob.java
@@ -25,7 +25,7 @@
    private OrderService orderService;
    //打开华为应用市场的广告
    //取消订单
    @XxlJob("order-cancel")
    public ReturnT<String> cancelOrder(String params) throws Exception {
src/main/java/com/yeshi/buwan/service/imp/HomeTypeService.java
@@ -340,89 +340,8 @@
            video = (HomeVideo) iterator.next();
    }
    public long getHomeVideoCount(String homeId) {
        return homeVideoDao.getCount("from HomeVideo h where h.type.id=?", new String[]{homeId});
    }
    public long getHomeTypeVideoPage(String homeId) {
        long count = getHomeVideoCount(homeId);
        return count % (long) Constant.pageCount != 0L ? count / (long) Constant.pageCount + 1L
                : count / (long) Constant.pageCount;
    }
    public List<HomeVideo> getHomeVideoList(String homeId, int page) {
        return homeVideoDao.list(
                "from HomeVideo h where h.type.id=? order by h.video.orderby desc,h.createtime desc",
                (page - 1) * Constant.pageCount, Constant.pageCount, new String[]{homeId});
    }
    public List<HomeVideo> getHomeVideoList(String homeId, String key, int page) {
        return homeVideoDao.list(
                "from HomeVideo h where h.type.id=? and h.video.name like ? order by h.bigPicture desc, h.video.orderby desc,h.video.watchCount desc,h.createtime desc",
                (page - 1) * Constant.pageCount, Constant.pageCount, new String[]{homeId, "%" + key + "%"});
    }
    @Cacheable(value = "homeCache", key = "'getHomeVideoList-'+#homeId+'-'+#resourceKey+'-'+#hasBigPicture+'-'+#page+'-'+#pageSize")
    public List<HomeVideo> getHomeVideoList(String homeId, String resourceKey, List<Long> resourceIds, Boolean hasBigPicture, int page, int pageSize) {
        List<HomeVideo> homeVideos = (List<HomeVideo>) homeVideoDao.excute(new HibernateCallback<List<HomeVideo>>() {
            @Override
            public List<HomeVideo> doInHibernate(Session session) throws HibernateException {
                List<String> rids = new ArrayList<>();
                for (Long rid : resourceIds) {
                    rids.add("rv.`resourceid`=" + rid);
                }
                String sql = String.format("SELECT hv.* FROM wk_video_homevideo hv LEFT JOIN wk_resource_video rv ON rv.`videoid`=hv.`videoid` LEFT JOIN wk_video_video v ON v.`id`=hv.`videoid` WHERE v.show=1 and hv.`hometype`=%s AND (%s) ", homeId, org.yeshi.utils.StringUtil.concat(rids, " or "));
//                if (bigPicture != null) {
//                    sql += " and hv.big_picture=" + (bigPicture ? 1 : 0);
//                }
                sql += " GROUP BY hv.id ORDER BY hv.big_picture desc,hv.`orderby` DESC,hv.`createtime` DESC";
                return session.createSQLQuery(sql).addEntity(HomeVideo.class).setFirstResult((page - 1) * pageSize + (hasBigPicture!=null&&hasBigPicture ? 1 : 0)).setMaxResults(pageSize).list();
            }
        });
        List<VideoInfo> videoInfoList = new ArrayList<>();
        for (HomeVideo hv : homeVideos) {
            if (hv.getVideo() != null)
                videoInfoList.add(hv.getVideo());
        }
        videoInfoExtraService.batchExtra(videoInfoList, resourceIds);
        return homeVideos;
    }
    @Cacheable(value = "homeCache", key = "'getHomeVideoListCount-'+#homeId+'-'+#resourceKey+'-'+#bigPicture")
    public long getHomeVideoListCount(String homeId, String resourceKey, List<Long> resourceIds, Boolean bigPicture) {
        return (Long) homeVideoDao.excute(new HibernateCallback<Long>() {
            @Override
            public Long doInHibernate(Session session) throws HibernateException {
                List<String> rids = new ArrayList<>();
                for (Long rid : resourceIds) {
                    rids.add("rv.`resourceid`=" + rid);
                }
                String sql = String.format("SELECT  count(distinct(hv.id)) FROM wk_video_homevideo hv LEFT JOIN wk_resource_video rv ON rv.`videoid`=hv.`videoid`  LEFT JOIN wk_video_video v ON v.`id`=hv.`videoid`  WHERE v.show=1 and hv.`hometype`=%s AND (%s)", homeId, org.yeshi.utils.StringUtil.concat(rids, " or "));
                if (bigPicture != null) {
                    sql += " and hv.big_picture=" + (bigPicture ? 1 : 0);
                }
                return Long.parseLong(session.createSQLQuery(sql).uniqueResult() + "");
            }
        });
    }
    public long getHomeVideoListCount(String homeId, String key) {
        return homeVideoDao.getCount("select count(*)  from HomeVideo h where h.type.id=? and h.video.name like ? ",
                new String[]{homeId, "%" + key + "%"});
    }
    public Serializable addHomeType(HomeType type) {
        return homeTypeDao.save(type);
src/main/java/com/yeshi/buwan/service/imp/juhe/InternetSearchVideoServiceImpl.java
@@ -8,6 +8,7 @@
import com.yeshi.buwan.service.inter.juhe.InternetSearchVideoService;
import com.yeshi.buwan.service.inter.system.SystemConfigService;
import com.yeshi.buwan.util.mq.CMQManager;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -106,5 +107,12 @@
        return internetSearchVideoDao.get(id);
    }
    @Cacheable(value = "internetSearch", key = "'selectByPrimaryKey-'+#id")
    @Override
    public InternetSearchVideo selectByPrimaryKeyCache(String id) {
        return selectByPrimaryKey(id);
    }
}
src/main/java/com/yeshi/buwan/service/imp/juhe/IqiyiService.java
@@ -388,7 +388,7 @@
                                    list.get(0).getVideo().setTag(tag);
                                    if (ilist != null && ilist.size() > 0) {
                                        updateVideo = list.get(0).getVideo();
                                        List<VideoDetailInfo> detailList = new ArrayList<VideoDetailInfo>();
                                        List<VideoDetailInfo> detailList = new ArrayList<>();
                                        detailList.add(convertVideoinfoToDetail(album, ilist.get(0)));
                                        updateVideo.setVideoDetailList(detailList);
                                    }
src/main/java/com/yeshi/buwan/service/imp/recommend/HomeVideoServiceImpl.java
New file
@@ -0,0 +1,114 @@
package com.yeshi.buwan.service.imp.recommend;
import com.yeshi.buwan.dao.HomeVideoDao;
import com.yeshi.buwan.domain.HomeVideo;
import com.yeshi.buwan.domain.VideoInfo;
import com.yeshi.buwan.domain.video.InternetSearchVideo;
import com.yeshi.buwan.service.inter.juhe.InternetSearchVideoService;
import com.yeshi.buwan.service.inter.recommend.HomeVideoService;
import com.yeshi.buwan.service.inter.video.VideoInfoExtraService;
import com.yeshi.buwan.util.Constant;
import com.yeshi.buwan.util.NumberUtil;
import com.yeshi.buwan.util.StringUtil;
import com.yeshi.buwan.util.factory.VideoInfoFactory;
import org.hibernate.Session;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
public class HomeVideoServiceImpl implements HomeVideoService {
    @Resource
    private HomeVideoDao homeVideoDao;
    @Resource
    private VideoInfoExtraService videoInfoExtraService;
    @Resource
    private InternetSearchVideoService internetSearchVideoService;
    private List<HomeVideo> betchInternetVideos(List<HomeVideo> homeVideoList) {
        for (HomeVideo hv : homeVideoList) {
            if (hv == null || hv.getVideo() == null || !StringUtil.isNullOrEmpty(hv.getVideoId())) {
                continue;
            }
            if (NumberUtil.isNumeric(hv.getVideoId())) {
                continue;
            }
            InternetSearchVideo internetSearchVideo = internetSearchVideoService.selectByPrimaryKeyCache(hv.getVideoId());
            if (internetSearchVideo != null) {
                hv.setVideo(VideoInfoFactory.create(internetSearchVideo));
            }
        }
        return homeVideoList;
    }
    @Override
    public List<HomeVideo> getHomeVideoList(String homeId, String key, int page) {
        List<HomeVideo> homeVideoList = homeVideoDao.list(
                "from HomeVideo h where h.type.id=? and h.video.name like ? order by h.bigPicture desc, h.video.orderby desc,h.video.watchCount desc,h.createtime desc",
                (page - 1) * Constant.pageCount, Constant.pageCount, new String[]{homeId, "%" + key + "%"});
        return betchInternetVideos(homeVideoList);
    }
    @Override
    public long getHomeVideoListCount(String homeId, String key) {
        return homeVideoDao.getCount("select count(*)  from HomeVideo h where h.type.id=? and h.video.name like ? ",
                new String[]{homeId, "%" + key + "%"});
    }
    @Override
    @Cacheable(value = "homeCache", key = "'getHomeVideoList-'+#homeId+'-'+#resourceKey+'-'+#hasBigPicture+'-'+#page+'-'+#pageSize")
    public List<HomeVideo> getHomeVideoList(String homeId, String resourceKey, List<Long> resourceIds, Boolean hasBigPicture, int page, int pageSize) {
        List<HomeVideo> homeVideos = (List<HomeVideo>) homeVideoDao.excute((Session session) -> {
            List<String> rids = new ArrayList<>();
            for (Long rid : resourceIds) {
                rids.add("rv.`resourceid`=" + rid);
            }
            String sql = String.format("SELECT hv.* FROM wk_video_homevideo hv LEFT JOIN wk_resource_video rv ON rv.`videoid`=hv.`videoid` LEFT JOIN wk_video_video v ON v.`id`=hv.`videoid` WHERE v.show=1 and hv.`hometype`=%s AND (%s) ", homeId, org.yeshi.utils.StringUtil.concat(rids, " or "));
            sql += " GROUP BY hv.id ORDER BY hv.`orderby` DESC,hv.`createtime` DESC";
            List<HomeVideo> homeVideoList = session.createSQLQuery(sql).addEntity(HomeVideo.class).setFirstResult((page - 1) * pageSize + (hasBigPicture != null && hasBigPicture ? 1 : 0)).setMaxResults(pageSize).list();
            return homeVideoList;
        });
        List<VideoInfo> videoInfoList = new ArrayList<>();
        for (HomeVideo hv : homeVideos) {
            if (hv.getVideo() != null)
                videoInfoList.add(hv.getVideo());
        }
        homeVideos = betchInternetVideos(homeVideos);
        videoInfoExtraService.batchExtra(videoInfoList, resourceIds);
        return betchInternetVideos(homeVideos);
    }
    @Override
    @Cacheable(value = "homeCache", key = "'getHomeVideoListCount-'+#homeId+'-'+#resourceKey+'-'+#bigPicture")
    public long getHomeVideoListCount(String homeId, String resourceKey, List<Long> resourceIds, Boolean bigPicture) {
        return (Long) homeVideoDao.excute((Session session) -> {
            List<String> rids = new ArrayList<>();
            for (Long rid : resourceIds) {
                rids.add("rv.`resourceid`=" + rid);
            }
            String sql = String.format("SELECT  count(distinct(hv.id)) FROM wk_video_homevideo hv LEFT JOIN wk_resource_video rv ON rv.`videoid`=hv.`videoid`  LEFT JOIN wk_video_video v ON v.`id`=hv.`videoid`  WHERE v.show=1 and hv.`hometype`=%s AND (%s)", homeId, org.yeshi.utils.StringUtil.concat(rids, " or "));
            if (bigPicture != null) {
                sql += " and hv.big_picture=" + (bigPicture ? 1 : 0);
            }
            return Long.parseLong(session.createSQLQuery(sql).uniqueResult() + "");
        });
    }
}
src/main/java/com/yeshi/buwan/service/inter/juhe/InternetSearchVideoService.java
@@ -19,4 +19,11 @@
    public InternetSearchVideo selectByPrimaryKey(String id);
    /**
     * 主键查询缓存
     * @param id
     * @return
     */
    public InternetSearchVideo selectByPrimaryKeyCache(String id);
}
src/main/java/com/yeshi/buwan/service/inter/recommend/HomeVideoService.java
New file
@@ -0,0 +1,19 @@
package com.yeshi.buwan.service.inter.recommend;
import com.yeshi.buwan.domain.HomeVideo;
import java.util.List;
public interface HomeVideoService {
    public List<HomeVideo> getHomeVideoList(String homeId, String key, int page);
    public long getHomeVideoListCount(String homeId, String key);
    public List<HomeVideo> getHomeVideoList(String homeId, String resourceKey, List<Long> resourceIds, Boolean hasBigPicture, int page, int pageSize);
    public long getHomeVideoListCount(String homeId, String resourceKey, List<Long> resourceIds, Boolean hasBigPicture);
}
src/main/java/com/yeshi/buwan/vo/video/VideoAdminInfoVO.java
@@ -6,6 +6,10 @@
import com.yeshi.buwan.util.TimeUtil;
import com.yeshi.buwan.util.video.VideoConstant;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class VideoAdminInfoVO {
    private String id;
@@ -17,6 +21,8 @@
    private String tag;
    private Integer freeType;
    private String area;
    private List<String> resourceList;
    private String createTime;
    public String getArea() {
        return area;
@@ -66,18 +72,16 @@
                        StringUtil.isNullOrEmpty(video.getCreatetime() + "") ? "0" : video.getCreatetime() + ""),
                "yyyy-MM-dd"));
        vo.setTag(video.getTag());
        vo.setCreateTime(TimeUtil.getGernalTime(video.getCreatetime(), "yyyy-MM-dd"));
        return vo;
    }
    public static VideoAdminInfoVO create(SolrAlbumVideo solrVideo) {
    public static VideoAdminInfoVO create(SolrAlbumVideo solrVideo, Map<Long, String> resourceNameMap) {
        VideoAdminInfoVO vo = new VideoAdminInfoVO();
        vo.setId(solrVideo.getId());
        vo.setName(solrVideo.getName());
        if (VideoConstant.isMainCategory(solrVideo.getRootVideoType()))
            vo.setVpicture(solrVideo.getPicture());
        else
            vo.setHpicture(solrVideo.getHpicture());
        vo.setVpicture(solrVideo.getVpicture());
        vo.setShow(solrVideo.getShow() + "");
        vo.setUpdatetime(TimeUtil.getGernalTime(
                Long.parseLong(
@@ -86,6 +90,16 @@
        vo.setTag(solrVideo.getTag());
        vo.setFreeType(solrVideo.getFreeType());
        vo.setArea(solrVideo.getArea());
        vo.setHpicture(solrVideo.getHpicture());
        List<String> resources = new ArrayList<>();
        if (solrVideo.getResourceIds() != null) {
            String[] rids = solrVideo.getResourceIds().split(",");
            for (String rid : rids) {
                resources.add(resourceNameMap.get(Long.parseLong(rid)));
            }
        }
        vo.setResourceList(resources);
        vo.setCreateTime(TimeUtil.getGernalTime(Long.parseLong(solrVideo.getCreatetime()), "yyyy-MM-dd"));
        return vo;
    }
@@ -128,4 +142,20 @@
    public void setVpicture(String vpicture) {
        this.vpicture = vpicture;
    }
    public List<String> getResourceList() {
        return resourceList;
    }
    public void setResourceList(List<String> resourceList) {
        this.resourceList = resourceList;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}
src/main/resources/domain/HomeVideo.hbm.xml
@@ -3,7 +3,7 @@
          "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.yeshi.buwan.domain">
    <class name="HomeVideo" table="wk_video_homevideo">
    <class name="HomeVideo" table="wk_video_homevideo_bak">
        <id name="id" column="Id">
            <generator class="native"></generator>
        </id>
@@ -15,11 +15,13 @@
        <property name="bigPicture" type="boolean" column="big_picture"></property>
        <property name="videoId" column="videoid" type="string"></property>
        <many-to-one name="type" column="hometype" lazy="false"
        <many-to-one name="type" column="hometype" lazy="false" not-found="ignore"
            unique="true"></many-to-one>
        <many-to-one name="video" column="videoid" lazy="false"
        <many-to-one name="video" column="videoid" lazy="false" not-found="ignore" update="false" insert="false"
            unique="true"></many-to-one>
        <many-to-one name="admin" column="adminid" lazy="false"></many-to-one>
src/main/resources/ehcache.xml
@@ -101,4 +101,10 @@
           memoryStoreEvictionPolicy="LRU" />
    <cache name="internetSearch" maxElementsInMemory="1000"
           maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="1200"
           timeToLiveSeconds="1200" overflowToDisk="true"
           memoryStoreEvictionPolicy="LRU" />
</ehcache>
src/main/webapp/admin/new/fenqu.html
@@ -70,6 +70,39 @@
        #hometype-sure div {
            margin-bottom: 20px;
        }
        .video {
            height: 100px !important;
        }
        .video .cover-h {
            height: 100px;
            max-width: 180px;
        }
        .video .cover-v {
            height: 100px;
        }
        .video tr td {
            text-align: center;
        }
        .video .title {
            background: #1DC7EA;
            color: #006dcc;
            border-radius: 5px;
            height: 100px;
            padding: 2px 5px;
        }
        .video .resource {
            background: #EEEEEE;
            color: #666666;
            border-radius: 5px;
            height: 100px;
            padding: 2px 5px;
        }
    </style>
</head>
@@ -154,10 +187,10 @@
                    </label>
                </div>
            </div>
            <button class="btn btn-warning pl-del" type="button">批量删除</button>
            <button class="btn btn-primary pl-addrecommend" type="button">添加推荐</button>
            <button class="btn btn-primary pl-addspecial" type="button">添加到合辑</button>
            <button class="btn btn-primary pl-addtop" type="button">添加到榜首</button>
            <button class="btn btn-warning pl-del" type="button" v-on:click="deleteItems">批量删除</button>
            <button class="btn btn-primary pl-addrecommend" type="button" v-on:click="addToRecommends">添加推荐</button>
            <button class="btn btn-primary pl-addspecial" type="button" v-on:click="addToSpecials"  >添加到合辑</button>
            <button class="btn btn-primary pl-addtop" type="button" v-on:click="addToTops">添加到榜首</button>
            <div class="page">
                <ul class="pagination">
                    <li class="disabled pre">
@@ -197,67 +230,85 @@
                    <thead>
                    <th width="7%">选择</th>
                    <th width="7%">编号</th>
                    <th width="12%">横版封面</th>
                    <th width="8%">竖版封面</th>
                    <th width="17%">标题</th>
                    <th width="8%">来源</th>
                    <th width="12%">时间</th>
                    <th width="12%">标签</th>
                    <th width="5%">区域</th>
                    <th width="12%">封面</th>
                    <th width="17%">名称</th>
                    <th width="15%">更新时间</th>
                    <th width="8%">是否显示</th>
                    <th width="4%">显示</th>
                    <th width="8%">操作</th>
                    <th width="7%">删除</th>
                    <th width="7%">编辑</th>
                    </thead>
                    <tbody>
                    <tr style="display: none;">
                    <tr v-for="(item,index) in videos" class="video">
                        <td width="7%">
                            <div class="xuanze">
                                <label> <input type="checkbox" class="check-item"
                                <label> <input type="checkbox" class="check-item" v-bind:key="item.id"
                                               value="#">
                                </label>
                            </div>
                        </td>
                        <td width="7%">
                            <div class="bianhao videoid">623</div>
                            <div class="bianhao videoid">{{item.id}}</div>
                        </td>
                        <td width="12%">
                            <div class="area" style="text-align: center;line-height: 105px;"></div>
                        </td>
                        <td width="12%">
                            <div class="tupian-banner" style="position: relative">
                                <img alt src="image/banner/青云志.jpg" class="video-img">
                                <span style="position: absolute;right: 2px;bottom: 2px;color: red" class="tag"></span>
                                <img src="image/icon_vip.png"
                                     style="position: absolute;right: 0px;top: 0px;height: 40px;"
                                     class="vip"/>
                            </div>
                        </td>
                        <td width="17%">
                            <div class="bianhao video-name"></div>
                        </td>
                        <td width="15%" style="text-align: center; line-height: 105px;" class="video-updatetime">
                            2016-09-27
                            <img v-bind:src="item.hpicture" class="cover-h">
                        </td>
                        <td width="8%">
                            <img v-bind:src="item.vpicture" class="cover-v">
                        </td>
                        <td width="17%">
                            <div class="title">{{item.name}}</div>
                        </td>
                        <td width="8%">
                            <div class="resource">
                                <div v-for="resource in item.resourceList">{{resource}}</div>
                            </div>
                        </td>
                        <td width="12%">
                            <div>
                                创建:{{item.createTime}}<br>
                                更新:{{item.updatetime}}
                            </div>
                        </td>
                        <td width="8%">
                            <div>
                                {{item.tag}}
                            </div>
                        </td>
                        <td width="8%">
                            <div>
                                {{item.area}}
                            </div>
                        </td>
                        <td width="4%">
                            <div class="xuanze">
                                <label> <input type="checkbox" value="#" class="video-show">
                                <label> <input type="checkbox" value="#" class="video-show" v-bind:checked="item.show"
                                               v-on:click="changeShow($event,item.id)">
                                </label>
                            </div>
                        </td>
                        <td width="8%">
                            <div class="bianhao addrecommend">
                                <a href="javascript:void(0)">添加推荐</a>
                                <a href="javascript:void(0)" v-on:click="addRecommend(item)">添加<br>推荐</a>
                            </div>
                        </td>
                        <td width="7%">
                            <div class="anniu">
                                <img src="image/dustbin.png" class="delete">
                                <img src="image/dustbin.png" class="delete" v-on:click="deleteItem(index,item.id)">
                            </div>
                        </td>
                        <td width="7%">
                            <div class="anniu">
                                <a key="370" target="_blank" class="edit"><img src="image/bianji.png"></a>
                                <a key="370" target="_blank" class="edit"
                                   v-bind:href="'edit-lmneirong-video.html?id='+item.id"><img
                                        src="image/bianji.png"></a>
                            </div>
                        </td>
                    </tr>
@@ -274,10 +325,10 @@
                    </label>
                </div>
            </div>
            <button class="btn btn-warning pl-del" type="button">批量删除</button>
            <button class="btn btn-primary pl-addrecommend" type="button">添加推荐</button>
            <button class="btn btn-primary pl-addspecial" type="button">添加到合辑</button>
            <button class="btn btn-primary pl-addtop" type="button">添加到榜首</button>
            <button class="btn btn-warning pl-del" type="button" v-on:click="deleteItems">批量删除</button>
            <button class="btn btn-primary pl-addrecommend" type="button" v-on:click="addToRecommends">添加推荐</button>
            <button class="btn btn-primary pl-addspecial" type="button" v-on:click="addToSpecials">添加到合辑</button>
            <button class="btn btn-primary pl-addtop" type="button" v-on:click="addToTops">添加到榜首</button>
            <div class="page">
                <ul class="pagination">
@@ -441,91 +492,11 @@
<script src="js/bootstrap.min.js"></script>
<script src="js/page.js"></script>
<script src="js/common.js"></script>
<script src="js/vue.min.js"></script>
<script src="layer/layer.js"></script>
<script>
    $(function () {
        function getCheckedItems() {
            var ids = "";
            for (var i = 0; i < $(".check-item").length; i++) {
                if ($(".check-item").eq(i).is(':checked')) {
                    ids += $(".check-item").eq(i).attr("key") + ",";
                }
            }
            if (ids.length > 0)
                ids = ids.substr(0, ids.length - 1);
            return ids;
        }
        $(".pl-del").click(function () {
            var ids = getCheckedItems();
            if (ids.length < 1) {
                layer.msg("请选择视频");
                return;
            }
            $.post('api/video/deletevideo', {
                'id': ids
            }, function (data) {
                layer.msg(data.msg);
                if (data.code == 0) {
                    $deleteElement.parent().parent().parent().remove();
                }
            }, 'json');
        });
        $(".pl-addrecommend").click(function () {
            var ids = getCheckedItems();
            if (ids.length < 1)
                layer.msg("未选择视频");
            else {
                $("#hometype .videoids").val(ids);
                $("#hometype").modal("show");
            }
        });
        $(".pl-addspecial").click(function () {
            var ids = getCheckedItems();
            if (ids.length < 1)
                layer.msg("未选择视频");
            else {
                $("#special .videoids").val(ids);
                $("#special").modal("show");
            }
        });
        $(".pl-addtop").click(function () {
            layer.open({
                type: 1,
                title: '分类选择',
                shadeClose: true,
                btn: ['确定', '取消'],
                shade: 0.8,
                area: ['400px', '300px'],
                yes: function (index) {
                    var arr = new Array();
                    $(".check-item:checked").each(function () {
                        var vid = $(this).attr("key");
                        arr.push(vid);
                    });
                    if (arr.length == 0) {
                        layer.msg("请先选择数据");
                        return false;
                    }
                    var type = $("#dialog-chooselink .addType option:selected").val();
                    addTop(arr, type);
                    layer.close(index);
                    $(".check-item").prop("checked", false);
                },
                btn2: function (index) {
                    layer.close(index);
                },
                content: $("#dialog-chooselink")
            });
        });
        //获取栏目列表
        $.post('api/home/gethometypelist', {}, function (data) {
@@ -661,7 +632,82 @@
    $(function () {
        var htmlSrc = "<tr>" + $(".zhuti .table tbody tr").eq(0).html() + "</tr>";
        function getData(page) {
        function getCheckedItems() {
            var ids = "";
            for (var i = 0; i < $(".check-item").length; i++) {
                if ($(".check-item").eq(i).is(':checked')) {
                    ids += $(".check-item").eq(i).attr("key") + ",";
                }
            }
            if (ids.length > 0)
                ids = ids.substr(0, ids.length - 1);
            return ids;
        }
        var app = new Vue({
            el: "#neirong",
            data: {
                videos: []
            },
            methods: {
                addRecommend: function (video) {
                    //直接添加到推荐
                    var key = video.id;
                    $("#hometype .videoids").val(key);
                    $("#hometype").modal("show");
                    // var index = layer.open({
                    //     type: 1,
                    //     skin: 'layui-layer-demo', //样式类名
                    //     closeBtn: 0, //不显示关闭按钮
                    //     anim: 2,
                    //     area: ['500px', '250px'],
                    //     shadeClose: true, //开启遮罩关闭
                    //     content: $("#hometype-sure")
                    // });
                    // var key = $(this).attr("key");
                    // $("#hometype-sure input[type=button]").click(function () {
                    //     $("#hometype .picture").val($("#hometype-sure .picture").val());
                    //     $("#hometype .desc").val($("#hometype-sure .desc").val());
                    //     $("#hometype .videoids").val(key);
                    //     layer.close(index);
                    //     $("#hometype").modal("show");
                    // });
                },
                changeShow: function (event, id) {
                    var el = event.currentTarget;
                    var show = $(el).is(":checked") ? "1" : "0";
                    $.post('api/video/changevideoshow', {
                        'id': id,
                        'show': show
                    }, function (data) {
                        layer.msg(data.msg);
                        layer.close(index);
                    }, 'json');
                },
                deleteItem: function (index1, id) {
                    alert(index1);
                    var index = layer.confirm('是否删除该条目?', {
                        btn: ['是', '否'] //按钮
                    }, function () {
                        $.post('api/video/deletevideo', {
                            'id': id
                        }, function (data) {
                            layer.msg(data.msg);
                            layer.close(index);
                            if (data.code == 0) {
                                app.videos.splice(index1, 1);
                            }
                        }, 'json');
                    }, function () {
                    });
                },
                getVideoList: function (page) {
            var index = layer.load(1, {
                shade: false
            })
@@ -685,123 +731,95 @@
                    return;
                fillPage(data.data.pageEntity, function (pageIndex) {
                    getData(pageIndex);
                            app.getVideoList(pageIndex);
                });
                        app.videos = data.data.data;
                //填充数据
                $(".page-totalcount").html(data.data.pageEntity.totalCount);
                    }, 'json');
                $(".zhuti .table tbody").empty();
                for (var i = 0; i < data.data.data.length; i++) {
                    var da = data.data.data[i];
                    $(".zhuti .table tbody").append(htmlSrc);
                    var fk = $(".zhuti .table tbody tr").eq(i);
                    fk.find(".check-item").attr("key", da.id);
                    fk.find(".videoid").html(da.id);
                    fk.find(".video-name").html(da.name);
                    fk.find(".tag").html(da.tag);
                    if(da.vpicture) {
                        fk.find(".video-img").attr("src", da.vpicture);
                        fk.find(".video-img").css("width","180px");
                    }else{
                        fk.find(".video-img").attr("src", da.hpicture);
                        fk.find(".video-img").css("width","240px");
                    }
                },
                    fk.find(".video-updatetime").html(da.updatetime);
                    if (da.show == 1)
                        fk.find(".video-show").attr("checked", true);
                    else
                        fk.find(".video-show").attr("checked", false);
                    fk.find(".video-show").attr("key", da.id);
                    fk.find(".addrecommend a").attr("key", da.id);
                    fk.find(".edit").attr("key", da.id);
                    fk.find(".delete").attr("key", da.id);
                    fk.find(".area").text(da.area);
                    fk.find(".edit").attr("href","edit-lmneirong-video.html?id=" + da.id);
                    if (da.freeType == 1)
                        fk.find(".vip").css("display", "block");
                    else
                        fk.find(".vip").css("display", "none");
                    fk.css("display", "table-row");
                }
                $(".table .addrecommend a").bind("click", function () {
                    //直接添加到推荐
                    var key = $(this).attr("key");
                    $("#hometype .videoids").val(key);
                addToRecommends: function () {
                    var ids = getCheckedItems();
                    if (ids.length < 1)
                        layer.msg("未选择视频");
                    else {
                        $("#hometype .videoids").val(ids);
                    $("#hometype").modal("show");
                    // var index = layer.open({
                    //     type: 1,
                    //     skin: 'layui-layer-demo', //样式类名
                    //     closeBtn: 0, //不显示关闭按钮
                    //     anim: 2,
                    //     area: ['500px', '250px'],
                    //     shadeClose: true, //开启遮罩关闭
                    //     content: $("#hometype-sure")
                    // });
                    // var key = $(this).attr("key");
                    // $("#hometype-sure input[type=button]").click(function () {
                    //     $("#hometype .picture").val($("#hometype-sure .picture").val());
                    //     $("#hometype .desc").val($("#hometype-sure .desc").val());
                    //     $("#hometype .videoids").val(key);
                    //     layer.close(index);
                    //     $("#hometype").modal("show");
                    // });
                });
                $(".table .video-show").bind("click", function () {
                    var show = $(this).is(":checked") ? "1" : "0";
                    var key = $(this).attr("key");
                    $.post('api/video/changevideoshow', {
                        'id': key,
                        'show': show
                    }, function (data) {
                        layer.msg(data.msg);
                        layer.close(index);
                        if (data.code == 0) {
                            $deleteElement.parent().parent().parent().remove();
                        }
                    }, 'json');
                },
                addToSpecials: function () {
                    var ids = getCheckedItems();
                    if (ids.length < 1)
                        layer.msg("未选择视频");
                    else {
                        $("#special .videoids").val(ids);
                        $("#special").modal("show");
                    }
                },
                addToTops: function () {
                    layer.open({
                        type: 1,
                        title: '分类选择',
                        shadeClose: true,
                        btn: ['确定', '取消'],
                        shade: 0.8,
                        area: ['400px', '300px'],
                        yes: function (index) {
                            var arr = new Array();
                            $(".check-item:checked").each(function () {
                                var vid = $(this).attr("key");
                                arr.push(vid);
                });
                            if (arr.length == 0) {
                                layer.msg("请先选择数据");
                                return false;
                            }
                            var type = $("#dialog-chooselink .addType option:selected").val();
                            addTop(arr, type);
                            layer.close(index);
                            $(".check-item").prop("checked", false);
                        },
                        btn2: function (index) {
                            layer.close(index);
                        },
                        content: $("#dialog-chooselink")
                    });
                },
                $(".table .anniu .delete").bind("click", function () {
                    var id = $(this).attr("key");
                    var $deleteElement = $(this);
                    var index = layer.confirm('是否删除该条目?', {
                        btn: ['是', '否'] //按钮
                    }, function () {
                deleteItems: function () {
                    var ids = getCheckedItems();
                    if (ids.length < 1) {
                        layer.msg("请选择视频");
                        return;
                    }
                        $.post('api/video/deletevideo', {
                            'id': id
                        'id': ids
                        }, function (data) {
                            layer.msg(data.msg);
                            layer.close(index);
                            if (data.code == 0) {
                                $deleteElement.parent().parent().parent().remove();
                            }
                        }, 'json');
                    }, function () {
                    });
                });
                // $(".table .anniu .edit").bind("click", function () {
                //     var id = $(this).attr("key");
                //     $("#video-edit-frame").attr("src", "edit-lmneirong-video.html?id=" + id);
                //     $("#video-edit").modal("show")
                // });
            }, 'json');
        }
            }
        });
        $(".search-div .search-button").click(function () {
            getData(1);
            app.getVideoList(1);
        });
        $("#special .modal-footer button:last").click(function () {
src/test/java/com/hxh/spring/test/HomeTypeTest.java
@@ -1,5 +1,6 @@
package com.hxh.spring.test;
import com.yeshi.buwan.dao.HomeVideoDao;
import com.yeshi.buwan.domain.HomeType;
import com.yeshi.buwan.domain.HomeVideo;
import com.yeshi.buwan.service.imp.HomeTypeService;
@@ -21,6 +22,9 @@
    @Resource
    private HomeTypeService homeTypeService;
    @Resource
    private HomeVideoDao homeVideoDao;
    @Test
    public void addTest() {
@@ -35,4 +39,11 @@
    }
    @Test
    public void testHomeVideo() {
        HomeVideo homeVideo = homeVideoDao.find(HomeVideo.class, "47628");
        System.out.println(homeVideo);
    }
}