This commit is contained in:
xiangwbs
2018-03-07 17:12:26 +08:00
parent 0146ab7704
commit 65948ab6ca
10 changed files with 110 additions and 110 deletions
@@ -8,7 +8,7 @@ import com.xwbing.domain.entity.vo.DataDictionaryVo;
import com.xwbing.domain.entity.vo.ListDataDictionaryVo;
import com.xwbing.domain.entity.vo.RestMessageVo;
import com.xwbing.service.sys.DataDictionaryService;
import com.xwbing.util.JSONObjResult;
import com.xwbing.util.JsonResult;
import com.xwbing.util.RestMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -38,7 +38,7 @@ public class DataDictionaryControl {
@ApiOperation(value = "添加字典", response = RestMessageVo.class)
public JSONObject save(@RequestBody DataDictionary dictionary) {
RestMessage result = dataDictionaryService.save(dictionary);
return JSONObjResult.toJSONObj(result);
return JsonResult.toJSONObj(result);
}
@LogInfo("修改字典")
@@ -46,10 +46,10 @@ public class DataDictionaryControl {
@ApiOperation(value = "修改字典", response = RestMessageVo.class)
public JSONObject update(@RequestBody DataDictionary dictionary) {
if (StringUtils.isEmpty(dictionary.getId())) {
return JSONObjResult.toJSONObj("主键不能为空");
return JsonResult.toJSONObj("主键不能为空");
}
RestMessage result = dataDictionaryService.update(dictionary);
return JSONObjResult.toJSONObj(result);
return JsonResult.toJSONObj(result);
}
@LogInfo("获取字典详情")
@@ -57,13 +57,13 @@ public class DataDictionaryControl {
@GetMapping("getById")
public JSONObject getById(@RequestParam String id) {
if (StringUtils.isEmpty(id)) {
return JSONObjResult.toJSONObj("主键不能为空");
return JsonResult.toJSONObj("主键不能为空");
}
DataDictionary dataDictionary = dataDictionaryService.getById(id);
if (dataDictionary == null) {
return JSONObjResult.toJSONObj("该字典不存在");
return JsonResult.toJSONObj("该字典不存在");
}
return JSONObjResult.toJSONObj(dataDictionary, "");
return JsonResult.toJSONObj(dataDictionary, "");
}
@LogInfo("校验编码")
@@ -76,7 +76,7 @@ public class DataDictionaryControl {
if (b) {
result.setSuccess(true);
}
return JSONObjResult.toJSONObj(result);
return JsonResult.toJSONObj(result);
}
@LogInfo("根据父id列表查询")
@@ -91,7 +91,7 @@ public class DataDictionaryControl {
parentId = CommonConstant.ROOT;
}
List<DataDictionary> listByParent = dataDictionaryService.findListByParent(parentId, enable);
return JSONObjResult.toJSONObj(listByParent, "");
return JsonResult.toJSONObj(listByParent, "");
}
@LogInfo("根据编码查询字典列表")
@@ -100,9 +100,9 @@ public class DataDictionaryControl {
@PostMapping("findListByCode")
public JSONObject findListByCode(@RequestParam String code, String enable) {
if (StringUtils.isEmpty(code)) {
return JSONObjResult.toJSONObj("编码不能为空");
return JsonResult.toJSONObj("编码不能为空");
}
List<DataDictionary> listByParent = dataDictionaryService.findListByCode(code, enable);
return JSONObjResult.toJSONObj(listByParent, "");
return JsonResult.toJSONObj(listByParent, "");
}
}