package com.poyee.manager.impl; import com.poyee.common.domain.entity.SysDictData; import com.poyee.dao.mapper.SysDictDataMapper; import com.poyee.manager.cache.DictCache; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; import javax.annotation.Resource; import javax.validation.constraints.NotNull; import java.util.List; @Component public class DictCacheImpl implements DictCache { @Resource private SysDictDataMapper sysDictDataMapper; @Override @Cacheable(cacheNames = "DICT_DATA_CACHE_KEY#600", key = "#dictType", unless = "#result == null") public List getDict(@NotNull String type) { return sysDictDataMapper.selectDictDataByType(type); } }