|
@@ -8,8 +8,10 @@ import cc.iotkit.common.log.enums.BusinessType;
|
|
|
import cc.iotkit.common.web.core.BaseController;
|
|
|
import cc.iotkit.system.dto.bo.SysPostBo;
|
|
|
import cc.iotkit.system.dto.vo.SysPostVo;
|
|
|
-import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cc.iotkit.system.service.ISysPostService;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -27,6 +29,7 @@ import java.util.List;
|
|
|
@RequiredArgsConstructor
|
|
|
@RestController
|
|
|
@RequestMapping("/system/post")
|
|
|
+@Api(tags = "岗位信息")
|
|
|
public class SysPostController extends BaseController {
|
|
|
|
|
|
private final ISysPostService postService;
|
|
@@ -34,8 +37,9 @@ public class SysPostController extends BaseController {
|
|
|
/**
|
|
|
* 获取岗位列表
|
|
|
*/
|
|
|
+ @ApiOperation("获取岗位列表")
|
|
|
@SaCheckPermission("system:post:list")
|
|
|
- @GetMapping("/list")
|
|
|
+ @PostMapping("/list")
|
|
|
public Paging<SysPostVo> list(SysPostBo post, PageRequest<?> query) {
|
|
|
return postService.selectPagePostList(post, query);
|
|
|
}
|
|
@@ -43,6 +47,7 @@ public class SysPostController extends BaseController {
|
|
|
/**
|
|
|
* 导出岗位列表
|
|
|
*/
|
|
|
+ @ApiOperation("导出岗位列表")
|
|
|
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
|
|
@SaCheckPermission("system:post:export")
|
|
|
@PostMapping("/export")
|
|
@@ -56,8 +61,9 @@ public class SysPostController extends BaseController {
|
|
|
*
|
|
|
* @param postId 岗位ID
|
|
|
*/
|
|
|
+ @ApiOperation("根据岗位编号获取详细信息")
|
|
|
@SaCheckPermission("system:post:query")
|
|
|
- @GetMapping(value = "/{postId}")
|
|
|
+ @PostMapping(value = "/{postId}")
|
|
|
public SysPostVo getInfo(@PathVariable Long postId) {
|
|
|
return postService.selectPostById(postId);
|
|
|
}
|
|
@@ -65,6 +71,7 @@ public class SysPostController extends BaseController {
|
|
|
/**
|
|
|
* 新增岗位
|
|
|
*/
|
|
|
+ @ApiOperation("新增岗位")
|
|
|
@SaCheckPermission("system:post:add")
|
|
|
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
@@ -80,9 +87,10 @@ public class SysPostController extends BaseController {
|
|
|
/**
|
|
|
* 修改岗位
|
|
|
*/
|
|
|
+ @ApiOperation("修改岗位")
|
|
|
@SaCheckPermission("system:post:edit")
|
|
|
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
|
|
- @PutMapping
|
|
|
+ @PostMapping
|
|
|
public void edit(@Validated @RequestBody SysPostBo post) {
|
|
|
if (!postService.checkPostNameUnique(post)) {
|
|
|
fail("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
|
@@ -97,9 +105,10 @@ public class SysPostController extends BaseController {
|
|
|
*
|
|
|
* @param postIds 岗位ID串
|
|
|
*/
|
|
|
+ @ApiOperation("删除岗位")
|
|
|
@SaCheckPermission("system:post:remove")
|
|
|
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{postIds}")
|
|
|
+ @PostMapping("/{postIds}")
|
|
|
public void remove(@PathVariable Collection postIds) {
|
|
|
postService.deletePostByIds(postIds);
|
|
|
}
|
|
@@ -107,7 +116,8 @@ public class SysPostController extends BaseController {
|
|
|
/**
|
|
|
* 获取岗位选择框列表
|
|
|
*/
|
|
|
- @GetMapping("/optionselect")
|
|
|
+ @ApiOperation("获取岗位选择框列表")
|
|
|
+ @PostMapping("/optionselect")
|
|
|
public List<SysPostVo> optionselect() {
|
|
|
return postService.selectPostAll();
|
|
|
}
|