mirror of https://gitee.com/stylefeng/roses
【8.0】【config】整理config代码
parent
6cd3117c16
commit
826787f901
|
@ -26,16 +26,14 @@ package cn.stylefeng.roses.kernel.config.modular.pojo.param;
|
|||
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest.batchDelete;
|
||||
import cn.stylefeng.roses.kernel.validator.api.validators.flag.FlagValue;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 系统参数配置参数
|
||||
|
@ -103,7 +101,7 @@ public class SysConfigParam extends BaseRequest {
|
|||
private String groupCode;
|
||||
|
||||
/**
|
||||
* 角色id集合,用在批量删除
|
||||
* configId集合,用在批量删除
|
||||
*/
|
||||
@NotEmpty(message = "configId集合不能为空", groups = batchDelete.class)
|
||||
@ChineseDescription("configId集合,用在批量删除")
|
||||
|
|
|
@ -318,7 +318,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|||
@Override
|
||||
public void batchDelete(SysConfigParam sysConfigParam) {
|
||||
|
||||
for(Long configId:sysConfigParam.getConfigIdList()){
|
||||
for (Long configId : sysConfigParam.getConfigIdList()) {
|
||||
// 1.根据id获取常量
|
||||
SysConfig sysConfig = this.getById(configId);
|
||||
if (ObjectUtil.isEmpty(sysConfig) || sysConfig.getDelFlag().equals(YesOrNotEnum.Y.getCode())) {
|
||||
|
@ -326,7 +326,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|||
}
|
||||
|
||||
// 2.不能删除系统参数
|
||||
if (YesOrNotEnum.Y.getCode().equals(configId)) {
|
||||
if (YesOrNotEnum.Y.getCode().equals(sysConfig.getSysFlag())) {
|
||||
throw new ConfigException(ConfigExceptionEnum.CONFIG_SYS_CAN_NOT_DELETE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue