增加清除系统缓存接口

This commit is contained in:
mofung1 2023-03-23 16:06:08 +08:00
parent e00563d3b5
commit 17d527d60a
4 changed files with 66 additions and 1 deletions

View File

@ -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();
}
}

View File

@ -0,0 +1,14 @@
package com.mdd.admin.service;
/**
* 系统缓存接口类
*/
public interface ISystemCacheService {
/**
* 清除系统缓存
*
*/
void clear();
}

View File

@ -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();
}
}

View File

@ -20,7 +20,6 @@ public class ConfigCache {
/**
* 设置缓存配置
*
*/
public static void set() {
SystemConfigMapper model = SpringUtils.getBean(SystemConfigMapper.class);