| | |
| | | package com.hxh.spring.test; |
| | | |
| | | import com.yeshi.buwan.dao.HomeNoticeDao; |
| | | import com.yeshi.buwan.dao.juhe.youku.InternetSearchVideoDao; |
| | | import com.yeshi.buwan.dao.video.AlbumVideoMapDao; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.solr.SolrAlbumVideo; |
| | |
| | | import com.yeshi.buwan.dto.search.SolrResultDTO; |
| | | import com.yeshi.buwan.dto.search.SolrShortVideoSearchFilter; |
| | | import com.yeshi.buwan.dto.search.SolrVideoSearchFilter; |
| | | import com.yeshi.buwan.job.video.ShortVideoUpdateJob; |
| | | import com.yeshi.buwan.service.imp.VideoInfoService; |
| | | import com.yeshi.buwan.service.inter.juhe.AlbumVideoMapService; |
| | | import com.yeshi.buwan.service.inter.juhe.InternetSearchVideoService; |
| | | import com.yeshi.buwan.service.manager.search.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.SolrCommonVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrInternetSearchVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.test.context.ContextConfiguration; |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | |
| | | |
| | | @Test |
| | | public void search() { |
| | | String key = "大唐狄公案"; |
| | | SolrVideoSearchFilter filter = new SolrVideoSearchFilter(); |
| | | filter.setKey(key); |
| | | filter.setContentType(1); |
| | | |
| | | SolrResultDTO internetSearchResultDTO = solrInternetSearchVideoDataManager.find(filter, 1, 10); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void addToAlbum() { |
| | | albumVideoMapService.add(videoInfoService.getVideoInfo("8441251")); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void getById() { |
| | | |
| | | SolrAlbumVideo solrAlbumVideo = solrDataManager.findOne("8441251"); |
| | | System.out.println(solrAlbumVideo); |
| | | } |
| | | |
| | | @Test |
| | | public void syncInternetSearch(){ |
| | | solrInternetSearchVideoDataManager.syncAllAlbum(); |
| | | } |
| | | |
| | | @Resource |
| | | private InternetSearchVideoDao internetSearchVideoDao; |
| | | |
| | | @Test |
| | | public void updateTag(){ |
| | | Query query=new Query(); |
| | | query.addCriteria(Criteria.where("tag").is("评分:null")); |
| | | List<InternetSearchVideo> list = internetSearchVideoDao.findList(query); |
| | | for(InternetSearchVideo video:list){ |
| | | InternetSearchVideo update=new InternetSearchVideo(); |
| | | update.setTag("评分:9.0"); |
| | | update.setId(video.getId()); |
| | | internetSearchVideoDao.updateSelective(update); |
| | | } |
| | | System.out.println(list); |
| | | } |
| | | |
| | | } |