|
@@ -1,15 +1,19 @@
|
|
package com.koobietech.eas.controller;
|
|
package com.koobietech.eas.controller;
|
|
|
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
import com.koobietech.eas.common.result.JsonResult;
|
|
import com.koobietech.eas.common.result.JsonResult;
|
|
import com.koobietech.eas.common.result.PageData;
|
|
import com.koobietech.eas.common.result.PageData;
|
|
import com.koobietech.eas.mbg.model.EasSysDepartment;
|
|
import com.koobietech.eas.mbg.model.EasSysDepartment;
|
|
import com.koobietech.eas.service.EasDepartmentService;
|
|
import com.koobietech.eas.service.EasDepartmentService;
|
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
|
+@Tag(name = "部门模块")
|
|
@RequestMapping("/department")
|
|
@RequestMapping("/department")
|
|
public class EasDepartmentController {
|
|
public class EasDepartmentController {
|
|
|
|
|
|
@@ -17,13 +21,17 @@ public class EasDepartmentController {
|
|
EasDepartmentService easDepartmentService;
|
|
EasDepartmentService easDepartmentService;
|
|
|
|
|
|
|
|
|
|
- @GetMapping("/query")
|
|
|
|
- public JsonResult query(@RequestParam Long id) {
|
|
|
|
- PageData ret = easDepartmentService.query(id);
|
|
|
|
|
|
+ @PostMapping("/query")
|
|
|
|
+ @Operation(summary = "查询部门" , description = "根据参数查询基本信息")
|
|
|
|
+ public JsonResult query(@RequestBody EasSysDepartment department,
|
|
|
|
+ @RequestParam Integer pageNum, @RequestParam Integer pageSize ) {
|
|
|
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
|
|
+ PageData ret = easDepartmentService.query(department);
|
|
return JsonResult.data(ret);
|
|
return JsonResult.data(ret);
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
|
|
+ @Operation(summary = "添加部门" , description = "添加部门信息")
|
|
public JsonResult add(@RequestBody EasSysDepartment department) {
|
|
public JsonResult add(@RequestBody EasSysDepartment department) {
|
|
Boolean ret = easDepartmentService.add(department);
|
|
Boolean ret = easDepartmentService.add(department);
|
|
if (ret) {
|
|
if (ret) {
|
|
@@ -33,8 +41,9 @@ public class EasDepartmentController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- @DeleteMapping("/delete")
|
|
|
|
- public JsonResult delete(@RequestParam Long id) {
|
|
|
|
|
|
+ @DeleteMapping("/delete/{id}")
|
|
|
|
+ @Operation(summary = "删除部门" , description = "删除部门根据ID")
|
|
|
|
+ public JsonResult delete(@PathVariable(name="id") Long id) {
|
|
Boolean ret = easDepartmentService.delete(id);
|
|
Boolean ret = easDepartmentService.delete(id);
|
|
if (ret) {
|
|
if (ret) {
|
|
return JsonResult.ok();
|
|
return JsonResult.ok();
|
|
@@ -44,6 +53,7 @@ public class EasDepartmentController {
|
|
|
|
|
|
|
|
|
|
@PutMapping("/update")
|
|
@PutMapping("/update")
|
|
|
|
+ @Operation(summary = "更新部门" , description = "更新部门信息根据ID")
|
|
public JsonResult update(@RequestBody EasSysDepartment department) {
|
|
public JsonResult update(@RequestBody EasSysDepartment department) {
|
|
Boolean ret = easDepartmentService.update(department);
|
|
Boolean ret = easDepartmentService.update(department);
|
|
if (ret) {
|
|
if (ret) {
|