mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-11 05:19:00 +08:00
🎨 改进结构和代码格式,字典信息缓存
This commit is contained in:
1 parent
a21a5c9ac7
commit
7b7e387c1f
2 files changed
+12
-5
No files matched your search
+10
-4
@@ -8,21 +8,27 @@ package com.pig4cloud.pigx.common.core.constant;
|
||||
*/
|
||||
public interface CacheConstants {
|
||||
|
||||
/**
|
||||
* 菜单信息缓存
|
||||
*/
|
||||
String MENU_DETAILS = "menu_details";
|
||||
|
||||
/**
|
||||
* 用户信息缓存
|
||||
*/
|
||||
String USER_DETAILS = "user_details";
|
||||
|
||||
/**
|
||||
* 字典信息缓存
|
||||
*/
|
||||
String DICT_DETAILS = "dict_details";
|
||||
|
||||
|
||||
/**
|
||||
* oauth 客户端信息
|
||||
*/
|
||||
String CLIENT_DETAILS_KEY = "pigx_oauth:client:details";
|
||||
|
||||
/**
|
||||
* 菜单信息缓存
|
||||
*/
|
||||
String MENU_DETAILS = "menu_details";
|
||||
|
||||
/**
|
||||
* spring boot admin 事件key
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ import com.pig4cloud.pigx.admin.api.entity.SysDictItem;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysDictItemMapper;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysDictMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysDictService;
|
||||
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -46,7 +47,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(value = "dict_details", allEntries = true)
|
||||
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean removeDict(Integer id) {
|
||||
baseMapper.deleteById(id);
|
||||
|
||||
Reference in new issue
Block a user