|
|
|
@ -1,8 +1,8 @@ |
|
|
|
/** |
|
|
|
* Copyright (c) 2018 人人开源 All rights reserved. |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* https://www.renren.io
|
|
|
|
* |
|
|
|
* <p> |
|
|
|
* 版权所有,侵权必究! |
|
|
|
*/ |
|
|
|
|
|
|
|
@ -39,7 +39,7 @@ import java.util.Map; |
|
|
|
*/ |
|
|
|
@RestController |
|
|
|
@RequestMapping("dict") |
|
|
|
@Api(tags="数据字典") |
|
|
|
@Api(tags = "数据字典") |
|
|
|
public class SysDictController { |
|
|
|
@Autowired |
|
|
|
private SysDictService sysDictService; |
|
|
|
@ -47,14 +47,14 @@ public class SysDictController { |
|
|
|
@GetMapping("page") |
|
|
|
@ApiOperation("字典分类") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , |
|
|
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , |
|
|
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , |
|
|
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , |
|
|
|
@ApiImplicitParam(name = "dictType", value = "字典类型", paramType = "query", dataType="String"), |
|
|
|
@ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType="String") |
|
|
|
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), |
|
|
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), |
|
|
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), |
|
|
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"), |
|
|
|
@ApiImplicitParam(name = "dictType", value = "字典类型", paramType = "query", dataType = "String"), |
|
|
|
@ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType = "String") |
|
|
|
}) |
|
|
|
public Result<PageData<SysDictDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){ |
|
|
|
public Result<PageData<SysDictDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) { |
|
|
|
//字典分类
|
|
|
|
PageData<SysDictDTO> page = sysDictService.page(params); |
|
|
|
|
|
|
|
@ -64,9 +64,9 @@ public class SysDictController { |
|
|
|
|
|
|
|
@GetMapping("sublist/{pid}") |
|
|
|
@ApiOperation("子列表") |
|
|
|
public Result<List<SysDictDTO>> sublist(@PathVariable("pid") String pid){ |
|
|
|
public Result<List<SysDictDTO>> sublist(@PathVariable("pid") String pid) { |
|
|
|
Map map = new HashMap(); |
|
|
|
map.put("pid",pid); |
|
|
|
map.put("pid", pid); |
|
|
|
List<SysDictDTO> list = sysDictService.subList(map); |
|
|
|
return new Result<List<SysDictDTO>>().ok(list); |
|
|
|
} |
|
|
|
@ -74,10 +74,10 @@ public class SysDictController { |
|
|
|
@GetMapping("list") |
|
|
|
@ApiOperation("字典分类数据") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType="String"), |
|
|
|
@ApiImplicitParam(name = "dictValue", value = "字典值", paramType = "query", dataType="String") |
|
|
|
@ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType = "String"), |
|
|
|
@ApiImplicitParam(name = "dictValue", value = "字典值", paramType = "query", dataType = "String") |
|
|
|
}) |
|
|
|
public Result<List<SysDictDTO>> list(@ApiIgnore @RequestParam Map<String, Object> params){ |
|
|
|
public Result<List<SysDictDTO>> list(@ApiIgnore @RequestParam Map<String, Object> params) { |
|
|
|
//字典分类数据
|
|
|
|
List<SysDictDTO> list = sysDictService.list(params); |
|
|
|
|
|
|
|
@ -86,7 +86,7 @@ public class SysDictController { |
|
|
|
|
|
|
|
@GetMapping("{id}") |
|
|
|
@ApiOperation("信息") |
|
|
|
public Result<SysDictDTO> get(@PathVariable("id") Long id){ |
|
|
|
public Result<SysDictDTO> get(@PathVariable("id") Long id) { |
|
|
|
SysDictDTO data = sysDictService.get(id); |
|
|
|
|
|
|
|
return new Result<SysDictDTO>().ok(data); |
|
|
|
@ -95,7 +95,7 @@ public class SysDictController { |
|
|
|
@PostMapping |
|
|
|
@ApiOperation("保存") |
|
|
|
@LogOperation("Save Dict") |
|
|
|
public Result save(@RequestBody SysDictDTO dto){ |
|
|
|
public Result save(@RequestBody SysDictDTO dto) { |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, DefaultGroup.class); |
|
|
|
|
|
|
|
@ -107,7 +107,7 @@ public class SysDictController { |
|
|
|
@PutMapping |
|
|
|
@ApiOperation("修改") |
|
|
|
@LogOperation("Update Dict") |
|
|
|
public Result update(@RequestBody SysDictDTO dto){ |
|
|
|
public Result update(@RequestBody SysDictDTO dto) { |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
|
|
|
|
|
@ -119,7 +119,7 @@ public class SysDictController { |
|
|
|
@DeleteMapping |
|
|
|
@ApiOperation("删除") |
|
|
|
@LogOperation("Delete Dict") |
|
|
|
public Result delete(@RequestBody Long[] ids){ |
|
|
|
public Result delete(@RequestBody Long[] ids) { |
|
|
|
//效验数据
|
|
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
|
|
|
|
|
@ -138,10 +138,7 @@ public class SysDictController { |
|
|
|
*/ |
|
|
|
@GetMapping("listSimple/{dictType}") |
|
|
|
@ApiOperation("字典分类数据") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType = "String") |
|
|
|
}) |
|
|
|
public Result<List<SysSimpleDictDTO>> listSimpleDictInfo(@ApiIgnore @PathVariable("dictType") String dictType) { |
|
|
|
public Result<List<SysSimpleDictDTO>> listSimpleDictInfo(@PathVariable("dictType") String dictType) { |
|
|
|
//字典分类数据
|
|
|
|
return sysDictService.listSimpleDictInfo(dictType); |
|
|
|
} |
|
|
|
|