admin
2021-02-19 58577bae968f2a10232bc8b3c04910b93ea3c69a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.yeshi.buwan.util.JuHe;
 
import com.yeshi.buwan.domain.DetailSystem;
import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
 
@Component
public class VideoResourceUtil {
    @Resource
    private VideoResourceVersionMapService videoResourceVersionMapService;
 
    @Cacheable(value = "homeCache", key = "'getAvailableResourceIds-'+'-'+#detailSystem.id+'-'+#versionCode")
    public List<Long> getAvailableResourceIds(DetailSystem detailSystem, int versionCode) {
        List<String> ridList = videoResourceVersionMapService.listResourceId(detailSystem.getId(), versionCode);
        List<Long> ids = new ArrayList<>();
        if (ridList != null) {
            for (String id : ridList) {
                ids.add(Long.parseLong(id));
            }
        }
        return ids;
    }
 
 
}