增加清除系统缓存接口
This commit is contained in:
parent
e00563d3b5
commit
17d527d60a
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.mdd.admin.controller.system;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mdd.admin.aop.Log;
|
||||||
|
import com.mdd.admin.service.ISystemCacheService;
|
||||||
|
import com.mdd.common.core.AjaxResult;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/system/cache")
|
||||||
|
@Api(tags = "系统缓存管理")
|
||||||
|
public class SystemCacheController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ISystemCacheService iSystemCacheService;
|
||||||
|
|
||||||
|
@Log(title = "清除系统缓存")
|
||||||
|
@PostMapping("/clear")
|
||||||
|
@ApiOperation(value = "清除系统缓存")
|
||||||
|
public AjaxResult<Object> clear() {
|
||||||
|
iSystemCacheService.clear();
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.mdd.admin.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统缓存接口类
|
||||||
|
*/
|
||||||
|
public interface ISystemCacheService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除系统缓存
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.mdd.admin.service.impl;
|
||||||
|
|
||||||
|
import com.mdd.admin.service.ISystemCacheService;
|
||||||
|
import com.mdd.common.cache.ConfigCache;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统缓存实现类
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SystemCacheServiceImpl implements ISystemCacheService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除系统缓存
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
ConfigCache.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -20,7 +20,6 @@ public class ConfigCache {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置缓存配置
|
* 设置缓存配置
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public static void set() {
|
public static void set() {
|
||||||
SystemConfigMapper model = SpringUtils.getBean(SystemConfigMapper.class);
|
SystemConfigMapper model = SpringUtils.getBean(SystemConfigMapper.class);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue