From b425df38b434f1eaf4762690905cd7affcf4c7b6 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期五, 20 九月 2024 09:33:24 +0800 Subject: [PATCH] mpk --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java index ad7352f..f6fcaea 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java @@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.Operation; import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -30,12 +31,14 @@ @GetMapping("page") @Operation(summary = "分页") + @PreAuthorize("@ss.hasPermission('mpk:file:query')") public CommonResult<PageData<MpkFileDTO>> page(@RequestParam Map<String, Object> params) { PageData<MpkFileDTO> page = mpkFileService.page(params); return success(page); } + @PreAuthorize("@ss.hasPermission('mpk:file:query')") @GetMapping("{id}") public CommonResult<MpkFileDTO> info(@PathVariable("id") String id) { MpkFileDTO schedule = mpkFileService.get(id); @@ -43,6 +46,7 @@ return success(schedule); } + @PreAuthorize("@ss.hasPermission('mpk:file:query')") @GetMapping("list") public CommonResult<List<MpkFileDTO>> list() { List<MpkFileDTO> list = mpkFileService.list(new HashMap<>()); @@ -50,22 +54,25 @@ return success(list); } + @PreAuthorize("@ss.hasPermission('mpk:file:create')") @PostMapping - public CommonResult save(@RequestBody MpkFileDTO dto) { + public CommonResult<Boolean> save(@RequestBody MpkFileDTO dto) { mpkFileService.save(dto); - return CommonResult.success(); + return CommonResult.success(true); } + @PreAuthorize("@ss.hasPermission('mpk:file:delete')") @DeleteMapping - public CommonResult delete(String id) { + public CommonResult<Boolean> delete(String id) { mpkFileService.delete(id); - return CommonResult.success(); + return CommonResult.success(true); } + @PreAuthorize("@ss.hasPermission('mpk:file:update')") @PutMapping - public CommonResult update(@RequestBody MpkFileDTO dto) { + public CommonResult<Boolean> update(@RequestBody MpkFileDTO dto) { mpkFileService.update(dto); - return CommonResult.success(); + return CommonResult.success(true); } @GetMapping("generat") -- Gitblit v1.9.3