This commit is contained in:
xiangwbs
2018-04-16 21:40:00 +08:00
parent a802d8b4bf
commit 6629aab29d
2 changed files with 11 additions and 17 deletions
@@ -73,6 +73,16 @@ public class SysConfigService {
return result;
}
/**
* 根据code查找配置
*
* @param code
* @return
*/
public SysConfig getByCode(String code) {
return sysConfigRepository.getByCode(code);
}
/**
* 修改
*
@@ -86,6 +96,7 @@ public class SysConfigService {
throw new BusinessException("该配置项不存在");
}
old.setValue(sysConfig.getValue());
old.setName(sysConfig.getName());
old.setEnable(sysConfig.getEnable());
old.setModifiedTime(new Date());
SysConfig save = sysConfigRepository.save(old);
@@ -98,16 +109,6 @@ public class SysConfigService {
return result;
}
/**
* 根据code查找配置
*
* @param code
* @return
*/
public SysConfig getByCode(String code) {
return sysConfigRepository.getByCode(code);
}
/**
* 根据状态获取配置列表
*
@@ -10,8 +10,6 @@ import com.xwbing.service.sys.SysConfigService;
import com.xwbing.util.JsonResult;
import com.xwbing.util.RestMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -61,11 +59,6 @@ public class SysConfigControl {
@LogInfo("修改系统配置信息")
@ApiOperation(value = "修改", notes = "修改系统配置信息", response = RestMessageVo.class)
@ApiImplicitParams({
@ApiImplicitParam(name = "code", value = "配置项的key,长度为1-50", paramType = "query", required = true, dataType = "string"),
@ApiImplicitParam(name = "value", value = "配置项的值", paramType = "query", required = true, dataType = "string"),
@ApiImplicitParam(name = "enable", value = "是否启用,格式为Y|N", paramType = "query", required = true, dataType = "string"),
})
@PostMapping("update")
public JSONObject update(SysConfig sysConfig) {
String logMsg = "修改系统配置信息";