|
@@ -11,10 +11,7 @@ import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -27,7 +24,7 @@ import java.util.List;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/dict")
|
|
@RequestMapping("/dict")
|
|
-@Api(tags = "")
|
|
|
|
|
|
+@Api(tags = "字典管理")
|
|
public class DictController {
|
|
public class DictController {
|
|
/**
|
|
/**
|
|
* 服务对象
|
|
* 服务对象
|
|
@@ -42,7 +39,7 @@ public class DictController {
|
|
* @return 单条数据
|
|
* @return 单条数据
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "get", method = RequestMethod.POST)
|
|
@RequestMapping(value = "get", method = RequestMethod.POST)
|
|
- @ApiOperation(value = "查询数据字典配置列表")
|
|
|
|
|
|
+ @ApiOperation(value = "查询单个数据字典配置列表")
|
|
public AjaxMessage<Dict> selectOne(
|
|
public AjaxMessage<Dict> selectOne(
|
|
@ApiParam(value = "数据字典配置", required = true) @RequestBody Dict dict) {
|
|
@ApiParam(value = "数据字典配置", required = true) @RequestBody Dict dict) {
|
|
Dict result = dictService.selectById(dict.getId());
|
|
Dict result = dictService.selectById(dict.getId());
|
|
@@ -81,15 +78,13 @@ public class DictController {
|
|
/**
|
|
/**
|
|
* 删除一条数据
|
|
* 删除一条数据
|
|
*
|
|
*
|
|
- * @param ids 主键,以逗号隔开
|
|
|
|
|
|
+ * @param ids
|
|
* @return Response对象
|
|
* @return Response对象
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "delete", method = RequestMethod.POST)
|
|
@RequestMapping(value = "delete", method = RequestMethod.POST)
|
|
@ApiOperation(value = "删除数据字典配置列表")
|
|
@ApiOperation(value = "删除数据字典配置列表")
|
|
- public AjaxMessage<Integer> delete(String ids) {
|
|
|
|
- String[] arrayIds = ids.split(",");
|
|
|
|
- List<String> idList = Arrays.asList(arrayIds);
|
|
|
|
- int result = dictService.deleteById(idList);
|
|
|
|
|
|
+ public AjaxMessage<Integer> delete(@ApiParam(value = "字典ids", required = true) @RequestParam Long[] ids) {
|
|
|
|
+ int result = dictService.deleteById(ids);
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -103,7 +98,7 @@ public class DictController {
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "selectPage", method = RequestMethod.POST)
|
|
@RequestMapping(value = "selectPage", method = RequestMethod.POST)
|
|
@ApiOperation(value = "查询数据字典配置列表")
|
|
@ApiOperation(value = "查询数据字典配置列表")
|
|
- public AjaxMessage<Pagination<Dict>> selectPage(Integer pageNum, Integer pageSize,String keyWords) {
|
|
|
|
|
|
+ public AjaxMessage<Pagination<Dict>> selectPage(Integer pageNum, Integer pageSize,@ApiParam(value = "查询关键字", required = false)String keyWords) {
|
|
Dict dict = new Dict();
|
|
Dict dict = new Dict();
|
|
dict.setDictName(keyWords);
|
|
dict.setDictName(keyWords);
|
|
dict.setDictCode(keyWords);
|
|
dict.setDictCode(keyWords);
|