package com.iplatform.recvideo.service;
|
|
import com.iplatform.model.po.Rc_video_batch;
|
import com.iplatform.model.po.Rc_video_t2;
|
import com.iplatform.model.po.Rc_video_user;
|
import com.walker.db.page.GenericPager;
|
import com.walker.jdbc.service.BaseServiceImpl;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
@Service
|
public class VideoShowServiceImpl extends BaseServiceImpl {
|
|
/**
|
* 查询给定用户推荐的视频集合
|
* @param userId
|
* @param limit 限制返回几条
|
* @return
|
*/
|
public List<Rc_video_user> queryRecommendList(long userId, int limit){
|
if(limit <= 0){
|
limit = 128;
|
}
|
return this.select("select video_id, score from rc_video_user where user_id=? order by score desc limit ?", new Object[]{userId, limit}, new Rc_video_user());
|
}
|
|
/**
|
* 返回部分原始视频集合,用于选择相似视频使用。
|
* @return
|
*/
|
public GenericPager<Rc_video_batch> queryPageVideoBatchList(){
|
return this.selectSplit("select * from rc_video_batch", new Object[]{}, 1, 128, new Rc_video_batch());
|
}
|
|
/**
|
* 返回给定原始视频,相似视频集合。
|
* @param srcVideoId
|
* @return
|
*/
|
public List<Rc_video_t2> querySimilarVideoList(String srcVideoId){
|
return this.select(new Rc_video_t2(), "where src_video_id=?", new Object[]{srcVideoId});
|
}
|
|
/**
|
* 根据原始视频ID,查询该视频信息。
|
* @param srcVideoId
|
* @return
|
*/
|
public Rc_video_batch queryOneVideoInfo(String srcVideoId){
|
return this.get(new Rc_video_batch(), "where src_video_id=?", new Object[]{srcVideoId});
|
}
|
}
|