| | |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:jkcabinetlog:create") |
| | | public ApiResponse create(@RequestBody JkCabinetLog jkCabinetLog) { |
| | | public ApiResponse create(@RequestBody JkCabinetLog jkCabinetLog,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(jkCabinetLogService.create(jkCabinetLog)); |
| | | } |
| | | |
| | | @ApiOperation("根据ID删除") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:jkcabinetlog:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | jkCabinetLogService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("批量删除") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:jkcabinetlog:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | |
| | | @ApiOperation("根据ID修改") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:jkcabinetlog:update") |
| | | public ApiResponse updateById(@RequestBody JkCabinetLog jkCabinetLog) { |
| | | public ApiResponse updateById(@RequestBody JkCabinetLog jkCabinetLog,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | jkCabinetLogService.updateById(jkCabinetLog); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:jkcabinetlog:query") |
| | | public ApiResponse<PageData<JkCabinetLog>> findPage (@RequestBody PageWrap<JkCabinetLog> pageWrap) { |
| | | public ApiResponse<PageData<JkCabinetLog>> findPage (@RequestBody PageWrap<JkCabinetLog> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(jkCabinetLogService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:jkcabinetlog:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<JkCabinetLog> pageWrap, HttpServletResponse response) { |
| | | public void exportExcel (@RequestBody PageWrap<JkCabinetLog> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | ExcelExporter.build(JkCabinetLog.class).export(jkCabinetLogService.findPage(pageWrap).getRecords(), "钥匙柜开关门记录", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:jkcabinetlog:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(jkCabinetLogService.findById(id)); |
| | | } |
| | | } |