This commit is contained in:
xiangwb
2017-11-09 14:25:25 +08:00
parent 03974da97a
commit 4cb41dfc51
8 changed files with 53 additions and 50 deletions
@@ -33,12 +33,12 @@ public class SysConfigControl {
private SysConfigService sysConfigService;
@ApiOperation(value = "新增", notes = "新增系统配置信息")
@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"),
@ApiImplicitParam(name = "name", value = "配置名称,长度为1-10", paramType = "query", required = true, dataType = "string")
})
// @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"),
// @ApiImplicitParam(name = "name", value = "配置名称,长度为1-10", paramType = "query", required = true, dataType = "string")
// })
@PostMapping("save")
public JSONObject save(@RequestBody @Valid SysConfig sysConfig) {
String logMsg = "新增系统配置信息";
@@ -78,14 +78,14 @@ public class SysConfigControl {
@ApiOperation(value = "查找", notes = "根据key查找系统配置信息")
@ApiImplicitParam(name = "code", value = "配置项的code", paramType = "query", required = true, dataType = "string")
@GetMapping("findByCode")
public JSONObject findByCode(@RequestParam String code) {
@GetMapping("getByCode")
public JSONObject getByCode(@RequestParam String code) {
String logMsg = "根据code查找系统配置信息";
logger.info(logMsg + " code:{}", code);
if (StringUtils.isEmpty(code)) {
return JSONObjResult.toJSONObj("code不能为空");
}
SysConfig one = sysConfigService.findByCode(code);
SysConfig one = sysConfigService.getByCode(code);
if (one == null) {
return JSONObjResult.toJSONObj("该配置不存在");
}
@@ -95,13 +95,13 @@ public class SysConfigControl {
@ApiOperation(value = "查找列表", notes = "根据是否启用查找配置列表")
@ApiImplicitParam(name = "enable", value = "是否启用,格式为Y|N", paramType = "query", required = true, dataType = "string")
@GetMapping("listByEnable")
public JSONObject findByEnable(@RequestParam String enable) {
public JSONObject listByEnable(@RequestParam String enable) {
String logMsg = "根据是否启用查找配置列表";
logger.info(logMsg + " enable:{}", enable);
if (StringUtils.isEmpty(enable)) {
return JSONObjResult.toJSONObj("是否启用不能为空");
}
List<SysConfig> byEnable = sysConfigService.findByEnable(enable);
List<SysConfig> byEnable = sysConfigService.listByEnable(enable);
return JSONObjResult.toJSONObj(byEnable, true, "");
}
}
@@ -57,12 +57,12 @@ public class SysUserControl {
}
@LogInfo("获取用户详情")
@GetMapping("findById")
public JSONObject findById(@RequestParam String id) {
@GetMapping("getById")
public JSONObject getById(@RequestParam String id) {
if (StringUtils.isEmpty(id)) {
return JSONObjResult.toJSONObj("主键不能为空");
}
SysUser sysUser = sysUserService.findOne(id);
SysUser sysUser = sysUserService.getOne(id);
if (sysUser == null) {
return JSONObjResult.toJSONObj("未查到该对象");
}
@@ -70,8 +70,8 @@ public class SysUserControl {
}
@LogInfo("列表查询所有用户")
@GetMapping("findList")
public JSONObject findList() {
@GetMapping("listAll")
public JSONObject listAll() {
List<SysUser> list = sysUserService.listAll();
return JSONObjResult.toJSONObj(list, true, "");
}