|
|
|
@ -13,6 +13,7 @@ import com.cloud.kicc.common.core.constant.AppConstants;
@@ -13,6 +13,7 @@ import com.cloud.kicc.common.core.constant.AppConstants;
|
|
|
|
|
import com.cloud.kicc.common.core.constant.CacheConstants; |
|
|
|
|
import com.cloud.kicc.common.log.annotation.SysLog; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springframework.cache.annotation.CacheEvict; |
|
|
|
|
import org.springframework.cache.annotation.Cacheable; |
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
@ -66,6 +67,7 @@ public class ConfigController {
@@ -66,6 +67,7 @@ public class ConfigController {
|
|
|
|
|
@SysLog("参数新增") |
|
|
|
|
@PostMapping("/save") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('config_add')") |
|
|
|
|
@CacheEvict(value= CacheConstants.CONFIG_PARAM, allEntries = true) |
|
|
|
|
public R save(@Validated @RequestBody Config config) { |
|
|
|
|
configService.save(config); |
|
|
|
|
return R.ok(); |
|
|
|
@ -74,6 +76,7 @@ public class ConfigController {
@@ -74,6 +76,7 @@ public class ConfigController {
|
|
|
|
|
@SysLog("参数修改") |
|
|
|
|
@PutMapping("/update") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('config_edit')") |
|
|
|
|
@CacheEvict(value= CacheConstants.CONFIG_PARAM, allEntries = true) |
|
|
|
|
public R update(@Validated @RequestBody Config config) { |
|
|
|
|
configService.updateById(config); |
|
|
|
|
return R.ok(); |
|
|
|
@ -82,6 +85,7 @@ public class ConfigController {
@@ -82,6 +85,7 @@ public class ConfigController {
|
|
|
|
|
@SysLog("参数删除") |
|
|
|
|
@DeleteMapping("/remove/{id:[\\w,]+}") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('config_del')") |
|
|
|
|
@CacheEvict(value= CacheConstants.CONFIG_PARAM, allEntries = true) |
|
|
|
|
public R remove(@PathVariable String[] id) { |
|
|
|
|
configService.removeByIds(Arrays.asList(id)); |
|
|
|
|
return R.ok(); |
|
|
|
|