| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | * @author Lion Li |
| | | */ |
| | | @Validated |
| | | @Api(value = "岗位信息控制器", tags = {"岗位信息管理"}) |
| | | @Tag(name ="岗位信息控制器", description = "岗位信息管理") |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/system/post") |
| | |
| | | /** |
| | | * 获取岗位列表 |
| | | */ |
| | | @ApiOperation("获取岗位列表") |
| | | @Operation(summary = "获取岗位列表") |
| | | @SaCheckPermission("system:post:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysPost> list(SysPost post, PageQuery pageQuery) { |
| | | return postService.selectPagePostList(post, pageQuery); |
| | | } |
| | | |
| | | @ApiOperation("导出岗位列表") |
| | | @Operation(summary = "导出岗位列表") |
| | | @Log(title = "岗位管理", businessType = BusinessType.EXPORT) |
| | | @SaCheckPermission("system:post:export") |
| | | @PostMapping("/export") |
| | |
| | | /** |
| | | * 根据岗位编号获取详细信息 |
| | | */ |
| | | @ApiOperation("根据岗位编号获取详细信息") |
| | | @Operation(summary = "根据岗位编号获取详细信息") |
| | | @SaCheckPermission("system:post:query") |
| | | @GetMapping(value = "/{postId}") |
| | | public R<SysPost> getInfo(@ApiParam("岗位ID") @PathVariable Long postId) { |
| | | public R<SysPost> getInfo(@Parameter(name = "岗位ID") @PathVariable Long postId) { |
| | | return R.ok(postService.selectPostById(postId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增岗位 |
| | | */ |
| | | @ApiOperation("新增岗位") |
| | | @Operation(summary = "新增岗位") |
| | | @SaCheckPermission("system:post:add") |
| | | @Log(title = "岗位管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | |
| | | /** |
| | | * 修改岗位 |
| | | */ |
| | | @ApiOperation("修改岗位") |
| | | @Operation(summary = "修改岗位") |
| | | @SaCheckPermission("system:post:edit") |
| | | @Log(title = "岗位管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | |
| | | /** |
| | | * 删除岗位 |
| | | */ |
| | | @ApiOperation("删除岗位") |
| | | @Operation(summary = "删除岗位") |
| | | @SaCheckPermission("system:post:remove") |
| | | @Log(title = "岗位管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{postIds}") |
| | | public R<Void> remove(@ApiParam("岗位ID串") @PathVariable Long[] postIds) { |
| | | public R<Void> remove(@Parameter(name = "岗位ID串") @PathVariable Long[] postIds) { |
| | | return toAjax(postService.deletePostByIds(postIds)); |
| | | } |
| | | |
| | | /** |
| | | * 获取岗位选择框列表 |
| | | */ |
| | | @ApiOperation("获取岗位选择框列表") |
| | | @Operation(summary = "获取岗位选择框列表") |
| | | @GetMapping("/optionselect") |
| | | public R<List<SysPost>> optionselect() { |
| | | List<SysPost> posts = postService.selectPostAll(); |