admin
2021-07-30 19533a17aa55fafc70d0a385928e785cb50e1ebc
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
package com.yeshi.buwan.service.imp.recommend;
 
import java.util.List;
 
import javax.annotation.Resource;
 
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
 
import com.yeshi.buwan.dao.recommend.AdRecommendRightDao;
import com.yeshi.buwan.domain.recommend.AdRecommendRight;
 
@Service
public class AdRecommendRightService {
 
    @Resource
    private AdRecommendRightDao adRecommendRightDao;
 
    @Cacheable(value="homeCache",key="'getAdRecommendRight'")
    public AdRecommendRight getAdRecommendRight() {
        List<AdRecommendRight> list = adRecommendRightDao.list("from AdRecommendRight");
        if (list == null || list.size() == 0) {
            return null;
        } else {
            return list.get(0);
        }
    }
}