| | |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.buwan.service.manager.SolrAlbumDataManager; |
| | | import com.yeshi.buwan.util.SolrUtil; |
| | | import org.springframework.stereotype.Component; |
| | | import org.yeshi.utils.LinuxRemoteCommandUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | /** |
| | |
| | | @Component |
| | | public class SolrJob { |
| | | |
| | | @Resource |
| | | private SolrAlbumDataManager solrAlbumDataManager; |
| | | |
| | | @XxlJob("solr-watch") |
| | | public ReturnT<String> reStartSolr(String param) throws Exception { |
| | | String solrIP = "172.16.16.12"; |
| | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 同步专辑 |
| | | * |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("solr-syncAlbum") |
| | | public ReturnT<String> syncAlbum(String param) throws Exception { |
| | | solrAlbumDataManager.syncAllAlbum(); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 同步常规搜索 |
| | | * |
| | | * @param param |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("solr-syncVideoCore") |
| | | public ReturnT<String> syncCore(String param) throws Exception { |
| | | //同步视频 |
| | | SolrUtil.dataimportVideo(param); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |