Search in sources :

Example 21 with SysDictData

use of com.ruoyi.common.core.domain.entity.SysDictData in project hocassian-media-matrix by hokaso.

the class SysDictTypeServiceImpl method init.

/**
 * 项目启动时,初始化字典到缓存
 */
@PostConstruct
public void init() {
    List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll();
    for (SysDictType dictType : dictTypeList) {
        List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
        DictUtils.setDictCache(dictType.getDictType(), dictDatas);
    }
}
Also used : SysDictData(com.ruoyi.common.core.domain.entity.SysDictData) SysDictType(com.ruoyi.common.core.domain.entity.SysDictType) PostConstruct(javax.annotation.PostConstruct)

Aggregations

SysDictData (com.ruoyi.common.core.domain.entity.SysDictData)21 SysDictType (com.ruoyi.common.core.domain.entity.SysDictType)6 Transactional (org.springframework.transaction.annotation.Transactional)4 List (java.util.List)1 Map (java.util.Map)1 PostConstruct (javax.annotation.PostConstruct)1