提交 393ab9ad 编写于 作者: L lishangbu

Introducing new features. 支持清除字典和字典项缓存

上级 e878a5cb
......@@ -179,4 +179,12 @@ public class DictController {
return R.ok();
}
@SysLog("清除字典缓存")
@DeleteMapping("/cache")
@PreAuthorize("@pms.hasPermission('sys_dict_del')")
public R clearDictCache() {
sysDictService.clearDictCache();
return R.ok();
}
}
......@@ -103,4 +103,12 @@ public class OauthClientDetailsController {
return R.ok(sysOauthClientDetailsService.updateClientDetailsById(sysOauthClientDetails));
}
@SysLog("清除终端缓存")
@DeleteMapping("/cache")
@PreAuthorize("@pms.hasPermission('sys_client_del')")
public R clearClientCache() {
sysOauthClientDetailsService.clearClientCache();
return R.ok();
}
}
......@@ -40,4 +40,9 @@ public interface SysDictService extends IService<SysDict> {
*/
void updateDict(SysDict sysDict);
/**
* 清除缓存
*/
void clearDictCache();
}
......@@ -37,10 +37,15 @@ public interface SysOauthClientDetailsService extends IService<SysOauthClientDet
Boolean removeClientDetailsById(String id);
/**
* 根据客户端信息
* 修改客户端信息
* @param sysOauthClientDetails
* @return
*/
Boolean updateClientDetailsById(SysOauthClientDetails sysOauthClientDetails);
/**
* 清除客户端缓存
*/
void clearClientCache();
}
......@@ -64,6 +64,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
* @return
*/
@Override
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
public void updateDict(SysDict dict) {
SysDict sysDict = this.getById(dict.getId());
// 系统内置
......@@ -71,4 +72,10 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
this.updateById(dict);
}
@Override
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
public void clearDictCache() {
}
}
......@@ -58,4 +58,13 @@ public class SysOauthClientDetailsServiceImpl extends ServiceImpl<SysOauthClient
return this.updateById(clientDetails);
}
/**
* 清除客户端缓存
*/
@Override
@CacheEvict(value = CacheConstants.CLIENT_DETAILS_KEY, allEntries = true)
public void clearClientCache() {
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册