admin
2021-07-30 19533a17aa55fafc70d0a385928e785cb50e1ebc
src/main/java/com/yeshi/buwan/service/imp/VideoInfoService.java
@@ -14,6 +14,7 @@
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.orm.hibernate4.HibernateCallback;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -44,9 +45,18 @@
    @Resource
    private VideoResourceService videoResourceService;
    @Resource
    private ClearService clearService;
    public VideoInfo getVideoInfo(String vid) {
        return videoInfoDao.find(VideoInfo.class, vid);
    }
    @Cacheable(value = "videoCache",key = "'getVideoInfoDetail-'+#vid")
    public VideoInfo getVideoInfoCache(String vid) {
        return videoInfoDao.find(VideoInfo.class, vid);
    }
    @SuppressWarnings("unchecked")
    public List<VideoInfo> simpleRandomVideoList(final int i) {
@@ -184,6 +194,7 @@
        return null;
    }
    /**
     * 根据名称与主演
     *
@@ -198,7 +209,9 @@
                    VideoInfo vi = list.get(i);
                    if (getSameDirectorOrActorCount(vi.getDirector(), newVideoInfo.getDirector()) > 0 || getSameDirectorOrActorCount(vi.getMainActor(), newVideoInfo.getMainActor()) > 0) {
//                        if (getSameDirectorOrActorCount(vi.getMainActor(), newVideoInfo.getMainActor()) > 0) {
                        return list.get(i);
                        //主分类一样
                        if (vi.getVideoType() != null && newVideoInfo.getVideoType() != null && vi.getVideoType().getId() == newVideoInfo.getVideoType().getId())
                            return list.get(i);
//                        }
                    }
                }