| | |
| | | package com.hxh.spring.test; |
| | | |
| | | import java.util.List; |
| | | import java.util.regex.Pattern; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.VideoDetailInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | |
| | | |
| | | public class Test { |
| | | |
| | | @org.junit.Test |
| | | public void test() { |
| | | VideoResourceUtil videoResouceUtil = com.yeshi.buwan.util.BeanUtil.getBean(VideoResourceUtil.class); |
| | | VideoDetailUtil videoDeailUtil = com.yeshi.buwan.util.BeanUtil.getBean(VideoDetailUtil.class); |
| | | ClassService classService = com.yeshi.buwan.util.BeanUtil.getBean(ClassService.class); |
| | | @org.junit.Test |
| | | public void test() { |
| | | VideoResourceUtil videoResouceUtil = com.yeshi.buwan.util.BeanUtil.getBean(VideoResourceUtil.class); |
| | | VideoDetailUtil videoDeailUtil = com.yeshi.buwan.util.BeanUtil.getBean(VideoDetailUtil.class); |
| | | ClassService classService = com.yeshi.buwan.util.BeanUtil.getBean(ClassService.class); |
| | | |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt(70 + "")); |
| | | List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt(70 + ""), null); |
| | | |
| | | VideoInfo info = (videoDeailUtil.getVideoInfo(null,3400048 + "", 13 + "", resourceList, |
| | | CacheUtil.getMD5Long(resourceList))); |
| | | VideoInfo info = (videoDeailUtil.getVideoInfo(null, 3400048 + "", 13 + "", resourceList, |
| | | CacheUtil.getMD5Long(resourceList))); |
| | | |
| | | List<VideoType> typeList = classService.getVideoTypeList(info.getId()); |
| | | if (typeList != null && typeList.size() > 0) { |
| | | VideoType type = typeList.get(0); |
| | | while (type.getParent() != null) |
| | | type = type.getParent(); |
| | | info.setVideoType(type); |
| | | } |
| | | List<VideoType> typeList = classService.getVideoTypeList(info.getId()); |
| | | if (typeList != null && typeList.size() > 0) { |
| | | VideoType type = typeList.get(0); |
| | | while (type.getParent() != null) |
| | | type = type.getParent(); |
| | | info.setVideoType(type); |
| | | } |
| | | |
| | | info.setPlayPicture(VideoPictureUtil.getShowPicture(info, "android", 70 + "")); |
| | | for (VideoDetailInfo vd : info.getVideoDetailList()) { |
| | | if (StringUtil.isNullOrEmpty(vd.getExtraId())) |
| | | vd.setExtraId(vd.getId() + ""); |
| | | } |
| | | info.setPlayPicture(VideoPictureUtil.getShowPicture(info, "android", 70 + "")); |
| | | for (VideoDetailInfo vd : info.getVideoDetailList()) { |
| | | if (StringUtil.isNullOrEmpty(vd.getExtraId())) |
| | | vd.setExtraId(vd.getId() + ""); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | @org.junit.Test |
| | | public void test2() { |
| | | BanQuanService banQuanService = BeanUtil.getBean(BanQuanService.class); |
| | | List<String> keys = banQuanService.getBanQuanKeyListAll(43); |
| | | System.out.println(keys); |
| | | } |
| | | @org.junit.Test |
| | | public void test2() { |
| | | BanQuanService banQuanService = BeanUtil.getBean(BanQuanService.class); |
| | | List<String> keys = banQuanService.getBanQuanKeyListAll(43); |
| | | System.out.println(keys); |
| | | } |
| | | |
| | | @org.junit.Test |
| | | public void test3() { |
| | | SolrUtil.dataimportVideo(); |
| | | } |
| | | |
| | | @org.junit.Test |
| | | public void test4() { |
| | | SolrUtil.dataimportVideo(); |
| | | } |
| | | @org.junit.Test |
| | | public void test3() { |
| | | SolrUtil.dataimportVideo(); |
| | | } |
| | | |
| | | @org.junit.Test |
| | | public void test4() { |
| | | String regex = "^http://www\\.baidu\\.com"; |
| | | System.out.print(Pattern.matches(regex, "http://www.baidu.com")); |
| | | } |
| | | |
| | | } |