| | |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:tasks:create") |
| | | public ApiResponse create(@RequestBody Tasks tasks) { |
| | | public ApiResponse create(@RequestBody Tasks tasks,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(tasksService.create(tasks)); |
| | | } |
| | | |
| | | @ApiOperation("根据ID删除") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:tasks:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | tasksService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("批量删除") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:tasks:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | tasksService.deleteByIdInBatch(this.getIdList(ids)); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("根据ID修改") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:tasks:update") |
| | | public ApiResponse updateById(@RequestBody Tasks tasks) { |
| | | public ApiResponse updateById(@RequestBody Tasks tasks,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | tasksService.updateById(tasks); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:tasks:query") |
| | | public ApiResponse<PageData<Tasks>> findPage (@RequestBody PageWrap<Tasks> pageWrap) { |
| | | public ApiResponse<PageData<Tasks>> findPage (@RequestBody PageWrap<Tasks> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(tasksService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:tasks:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Tasks> pageWrap, HttpServletResponse response) { |
| | | public void exportExcel (@RequestBody PageWrap<Tasks> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | ExcelExporter.build(Tasks.class).export(tasksService.findPage(pageWrap).getRecords(), "安防下发平台任务信息表", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:tasks:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(tasksService.findById(id)); |
| | | } |
| | | } |