| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.oying.modules.system.domain.Job; |
| | | import com.oying.modules.system.domain.dto.JobQueryCriteria; |
| | | import com.oying.utils.R; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Set; |
| | |
| | | @ApiOperation("查询岗位") |
| | | @GetMapping |
| | | @PreAuthorize("@el.check('job:list','user:list')") |
| | | public ResponseEntity<PageResult<Job>> queryJob(JobQueryCriteria criteria){ |
| | | public ResponseEntity<Object> queryJob(JobQueryCriteria criteria) { |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | return new ResponseEntity<>(jobService.queryAll(criteria, page),HttpStatus.OK); |
| | | return new ResponseEntity<>(R.success(jobService.queryAll(criteria, page)), HttpStatus.OK); |
| | | } |
| | | |
| | | @Log("新增岗位") |
| | |
| | | throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); |
| | | } |
| | | jobService.create(resources); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.CREATED); |
| | | } |
| | | |
| | | @Log("修改岗位") |
| | |
| | | @PreAuthorize("@el.check('job:edit')") |
| | | public ResponseEntity<Object> updateJob(@Validated(Job.Update.class) @RequestBody Job resources){ |
| | | jobService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @Log("删除岗位") |
| | |
| | | // 验证是否被用户关联 |
| | | jobService.verification(ids); |
| | | jobService.delete(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | return new ResponseEntity<>(R.success(), HttpStatus.OK); |
| | | } |
| | | } |