| | |
| | | import me.zhengjie.modules.task.service.TaskService; |
| | | import me.zhengjie.modules.task.service.TaskUserService; |
| | | import me.zhengjie.modules.task.service.dto.TaskQueryCriteria; |
| | | import me.zhengjie.utils.SecurityUtils; |
| | | import org.springframework.data.domain.Pageable; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.http.HttpStatus; |
| | |
| | | |
| | | @GetMapping(value = "/ChildrenTaskAnyParent") |
| | | public ResponseEntity<Object> queryChildrenTaskAnyParent(TaskQueryCriteria criteria){ |
| | | return new ResponseEntity<>(taskService.queryChildrenTaskAnyParent(criteria),HttpStatus.OK); |
| | | return new ResponseEntity<>(taskService.queryChildrenTaskAnyParent(SecurityUtils.getCurrentUserId(),criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | |
| | | @ApiOperation("新增任务") |
| | | @PreAuthorize("@el.check('task:add')") |
| | | public ResponseEntity<Object> createTask(@Validated @RequestBody TaskMongo resources){ |
| | | return new ResponseEntity<>(taskService.create(resources),HttpStatus.CREATED); |
| | | return new ResponseEntity<>(taskService.create(SecurityUtils.getCurrentUserId(),resources),HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | |
| | | @ApiOperation("修改任务") |
| | | @PreAuthorize("@el.check('task:edit')") |
| | | public ResponseEntity<Object> updateTask(@Validated @RequestBody TaskMongo resources){ |
| | | return new ResponseEntity<>(taskService.update(resources), HttpStatus.NO_CONTENT); |
| | | return new ResponseEntity<>(taskService.update(SecurityUtils.getCurrentUserId(),resources), HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | |
| | | @ApiOperation("删除任务") |
| | | @PreAuthorize("@el.check('task:del')") |
| | | public ResponseEntity<Object> deleteTask(@RequestBody String[] ids) { |
| | | return new ResponseEntity<>(taskService.deleteAll(ids), HttpStatus.OK); |
| | | return new ResponseEntity<>(taskService.deleteAll(SecurityUtils.getCurrentUserId(),ids), HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/total") |