|
@@ -8,6 +8,8 @@ import cn.reghao.dfs.store.model.po.AudioFile;
|
|
|
import cn.reghao.dfs.store.model.po.ImageFile;
|
|
import cn.reghao.dfs.store.model.po.ImageFile;
|
|
|
import cn.reghao.dfs.store.model.po.VideoFile;
|
|
import cn.reghao.dfs.store.model.po.VideoFile;
|
|
|
import cn.reghao.dfs.store.model.po.VideoUrl;
|
|
import cn.reghao.dfs.store.model.po.VideoUrl;
|
|
|
|
|
+import cn.reghao.oss.api.dto.VideoUrlDto;
|
|
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Repository;
|
|
import org.springframework.stereotype.Repository;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
@@ -54,6 +56,11 @@ public class MediaRepository {
|
|
|
return videoUrlMapper.findHighestQuality(videoFileId);
|
|
return videoUrlMapper.findHighestQuality(videoFileId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Cacheable(cacheNames = "oss:store:videoUrls", key = "#videoFileId", unless = "#result.empty")
|
|
|
|
|
+ public List<VideoUrlDto> findVideoUrls(String videoFileId) {
|
|
|
|
|
+ return videoUrlMapper.findVideoUrls(videoFileId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public ImageFile findImageFile(String imageFileId) {
|
|
public ImageFile findImageFile(String imageFileId) {
|
|
|
return imageFileMapper.findByImageFileId(imageFileId);
|
|
return imageFileMapper.findByImageFileId(imageFileId);
|
|
|
}
|
|
}
|