|
|
@@ -1,95 +1,64 @@
|
|
|
-package cn.iocoder.yudao.module.iscs.controller.admin.blacklist;
|
|
|
-
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import jakarta.annotation.Resource;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
-import io.swagger.v3.oas.annotations.Parameter;
|
|
|
-import io.swagger.v3.oas.annotations.Operation;
|
|
|
-
|
|
|
-import jakarta.validation.constraints.*;
|
|
|
-import jakarta.validation.*;
|
|
|
-import jakarta.servlet.http.*;
|
|
|
-import java.util.*;
|
|
|
-import java.io.IOException;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
-import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
-import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
-import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.module.iscs.controller.admin.blacklist.vo.*;
|
|
|
-import cn.iocoder.yudao.module.iscs.dal.dataobject.blacklist.BlacklistDO;
|
|
|
-import cn.iocoder.yudao.module.iscs.service.blacklist.BlacklistService;
|
|
|
-
|
|
|
-@Tag(name = "管理后台 - 黑名单关联")
|
|
|
-@RestController
|
|
|
-@RequestMapping("/iscs/blacklist")
|
|
|
-@Validated
|
|
|
-public class BlacklistController {
|
|
|
-
|
|
|
- @Resource
|
|
|
- private BlacklistService blacklistService;
|
|
|
-
|
|
|
- @PostMapping("/insertBlacklist")
|
|
|
- @Operation(summary = "创建黑名单关联")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:blacklist:create')")
|
|
|
- public CommonResult<Long> insertBlacklist(@Valid @RequestBody BlacklistSaveReqVO createReqVO) {
|
|
|
- return success(blacklistService.createBlacklist(createReqVO));
|
|
|
- }
|
|
|
-
|
|
|
- @PutMapping("/updateBlacklist")
|
|
|
- @Operation(summary = "更新黑名单关联")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:blacklist:update')")
|
|
|
- public CommonResult<Boolean> updateBlacklist(@Valid @RequestBody BlacklistSaveReqVO updateReqVO) {
|
|
|
- blacklistService.updateBlacklist(updateReqVO);
|
|
|
- return success(true);
|
|
|
- }
|
|
|
-
|
|
|
- @DeleteMapping("/deleteBlacklistList")
|
|
|
- @Parameter(name = "ids", description = "编号", required = true)
|
|
|
- @Operation(summary = "批量删除黑名单关联")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:blacklist:delete')")
|
|
|
- public CommonResult<Boolean> deleteBlacklistList(@RequestParam("ids") List<Long> ids) {
|
|
|
- blacklistService.deleteBlacklistListByIds(ids);
|
|
|
- return success(true);
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/selectBlacklistById")
|
|
|
- @Operation(summary = "获得黑名单关联")
|
|
|
- @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:blacklist:query')")
|
|
|
- public CommonResult<BlacklistRespVO> selectBlacklistById(@RequestParam("id") Long id) {
|
|
|
- BlacklistDO blacklist = blacklistService.getBlacklist(id);
|
|
|
- return success(BeanUtils.toBean(blacklist, BlacklistRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/getBlacklistPage")
|
|
|
- @Operation(summary = "获得黑名单关联分页")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:blacklist:query')")
|
|
|
- public CommonResult<PageResult<BlacklistRespVO>> getBlacklistPage(@Valid BlacklistPageReqVO pageReqVO) {
|
|
|
- PageResult<BlacklistDO> pageResult = blacklistService.getBlacklistPage(pageReqVO);
|
|
|
- return success(BeanUtils.toBean(pageResult, BlacklistRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/exportBlacklistExcel")
|
|
|
- @Operation(summary = "导出黑名单关联 Excel")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:blacklist:export')")
|
|
|
- @ApiAccessLog(operateType = EXPORT)
|
|
|
- public void exportBlacklistExcel(@Valid BlacklistPageReqVO pageReqVO,
|
|
|
- HttpServletResponse response) throws IOException {
|
|
|
- pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
- List<BlacklistDO> list = blacklistService.getBlacklistPage(pageReqVO).getList();
|
|
|
- // 导出 Excel
|
|
|
- ExcelUtils.write(response, "黑名单关联.xls", "数据", BlacklistRespVO.class,
|
|
|
- BeanUtils.toBean(list, BlacklistRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
+package cn.iocoder.yudao.module.iscs.controller.admin.blacklist;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.blacklist.vo.BlacklistPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.blacklist.vo.BlacklistRespVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.blacklist.vo.BlacklistSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.blacklist.vo.WhiteUserVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.service.blacklist.BlacklistService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import jakarta.validation.Valid;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - 黑名单关联")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/iscs/blacklist")
|
|
|
+@Validated
|
|
|
+public class BlacklistController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private BlacklistService blacklistService;
|
|
|
+
|
|
|
+ @PostMapping("/insertBlacklist")
|
|
|
+ @Operation(summary = "创建黑名单关联")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:blacklist:create')")
|
|
|
+ public CommonResult<Long> insertBlacklist(@Valid @RequestBody List<BlacklistSaveReqVO> list) {
|
|
|
+ return success(blacklistService.createBlacklist(list));
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/deleteBlacklistList")
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
+ @Operation(summary = "批量删除黑名单关联")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:blacklist:delete')")
|
|
|
+ public CommonResult<Boolean> deleteBlacklistList(@RequestParam("ids") List<Long> ids) {
|
|
|
+ blacklistService.deleteBlacklistListByIds(ids);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getBlacklistPage")
|
|
|
+ @Operation(summary = "获得黑名单关联分页")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:blacklist:query')")
|
|
|
+ public CommonResult<PageResult<BlacklistRespVO>> getBlacklistPage(@Valid BlacklistPageReqVO pageReqVO) {
|
|
|
+ PageResult<BlacklistRespVO> pageResult = blacklistService.getBlacklistPage(pageReqVO);
|
|
|
+ return success(pageResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getWhiteUserPage")
|
|
|
+ @Operation(summary = "获得白名单关联分页")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:blacklist:query')")
|
|
|
+ public CommonResult<PageResult<WhiteUserVO>> getWhiteUserPage(@Valid BlacklistPageReqVO pageReqVO) {
|
|
|
+ PageResult<WhiteUserVO> pageResult = blacklistService.getWhiteUserPage(pageReqVO);
|
|
|
+ return success(pageResult);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|