From 5de142a5b9210e30a4826714d157e950693e5379 Mon Sep 17 00:00:00 2001 From: PQZ Date: Fri, 27 Sep 2024 17:38:36 +0800 Subject: [PATCH] 1 --- .../app/customer/admin/CustomerMainApi.java | 28 +++++++++++++++++++ .../admin/CustomerActiveController.java | 4 --- .../admin/ActiveMainController.java | 9 ++---- .../src/main/resources/application.yaml | 2 +- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/admin/CustomerMainApi.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/admin/CustomerMainApi.java index 9c2c459e..fe578390 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/admin/CustomerMainApi.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/admin/CustomerMainApi.java @@ -11,7 +11,10 @@ import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.custom.vo.CustomerActiveSaveReqVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; import cn.iocoder.yudao.module.member.entity.MemberLevel; +import cn.iocoder.yudao.module.member.service.ActiveMainService; import cn.iocoder.yudao.module.member.service.MemberLevelService; +import cn.iocoder.yudao.module.member.vo.ActiveMainPageReqVO; +import cn.iocoder.yudao.module.member.vo.ActiveMainRespVO; import cn.iocoder.yudao.module.member.vo.MemberLevelPageReqVO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.swagger.v3.oas.annotations.Operation; @@ -40,6 +43,8 @@ public class CustomerMainApi { private MemberLevelService levelService; @Resource private CustomerActiveService activeService; + @Resource + private ActiveMainService activeMainService; /** * 查询当前登录客户信息 @@ -87,4 +92,27 @@ public class CustomerMainApi { activeService.attendActive(createReqVO); return success(true); } + + + + @GetMapping("/getActive") + @Operation(summary = "获得营销活动") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getActiveMain(@RequestParam("id") String id) { + ActiveMainRespVO activeMain = activeMainService.getActiveMain(id,false); + return success(activeMain); + } + + /** + * + * @author PQZ + * @date 16:12 2024/9/23 + * @param pageReqVO ActiveMainPageReqVO实体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult> + **/ + @GetMapping("/activeList") + @Operation(summary = "可参与营销活动") + public CommonResult> getActiveMainPage(ActiveMainPageReqVO pageReqVO) { + return success(activeService.isJoinActive(pageReqVO)); + } } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerActiveController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerActiveController.java index 99a7ee13..c038e633 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerActiveController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerActiveController.java @@ -51,7 +51,6 @@ public class CustomerActiveController { @DeleteMapping("/delete") @Operation(summary = "删除用户参与活动记录") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('base:customer-active:delete')") public CommonResult deleteCustomerActive(@RequestParam("id") String id) { customerActiveService.deleteCustomerActive(id); return success(true); @@ -60,7 +59,6 @@ public class CustomerActiveController { @GetMapping("/get") @Operation(summary = "获得用户参与活动记录") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('base:customer-active:query')") public CommonResult getCustomerActive(@RequestParam("id") String id) { CustomerActive customerActive = customerActiveService.getCustomerActive(id); return success(BeanUtils.toBean(customerActive, CustomerActiveRespVO.class)); @@ -68,7 +66,6 @@ public class CustomerActiveController { @GetMapping("/page") @Operation(summary = "获得用户参与活动记录分页") - @PreAuthorize("@ss.hasPermission('base:customer-active:query')") public CommonResult> getCustomerActivePage(@Valid CustomerActivePageReqVO pageReqVO) { PageResult pageResult = customerActiveService.getCustomerActivePage(pageReqVO); return success(BeanUtils.toBean(pageResult, CustomerActiveRespVO.class)); @@ -84,7 +81,6 @@ public class CustomerActiveController { **/ @GetMapping("/list") @Operation(summary = "可参与营销活动") - @PreAuthorize("@ss.hasPermission('member:active-main:query')") public CommonResult> getActiveMainPage(ActiveMainPageReqVO pageReqVO) { return success(customerActiveService.isJoinActive(pageReqVO)); } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/controller/admin/ActiveMainController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/controller/admin/ActiveMainController.java index fc971e33..cc0086cc 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/controller/admin/ActiveMainController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/controller/admin/ActiveMainController.java @@ -42,7 +42,6 @@ public class ActiveMainController { **/ @PostMapping("/create") @Operation(summary = "创建营销活动") - @PreAuthorize("@ss.hasPermission('member:active-main:create')") public CommonResult createActiveMain(@Valid @RequestBody ActiveMainSaveReqVO createReqVO) { activeMainService.saveActiveMain(createReqVO); return success(true); @@ -58,7 +57,6 @@ public class ActiveMainController { **/ @PutMapping("/update") @Operation(summary = "更新营销活动") - @PreAuthorize("@ss.hasPermission('member:active-main:update')") public CommonResult updateActiveMain(@Valid @RequestBody ActiveMainSaveReqVO updateReqVO) { activeMainService.saveActiveMain(updateReqVO); return success(true); @@ -75,7 +73,6 @@ public class ActiveMainController { @DeleteMapping("/delete") @Operation(summary = "删除营销活动") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('member:active-main:delete')") public CommonResult deleteActiveMain(@RequestParam("id") String id) { activeMainService.deleteActiveMain(id); return success(true); @@ -92,10 +89,9 @@ public class ActiveMainController { @GetMapping("/get") @Operation(summary = "获得营销活动") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('member:active-main:query')") public CommonResult getActiveMain(@RequestParam("id") String id) { - ActiveMain activeMain = activeMainService.getActiveMain(id,false); - return success(BeanUtils.toBean(activeMain, ActiveMainRespVO.class)); + ActiveMainRespVO activeMain = activeMainService.getActiveMain(id,false); + return success(activeMain); } /** @@ -108,7 +104,6 @@ public class ActiveMainController { **/ @GetMapping("/page") @Operation(summary = "获得营销活动分页") - @PreAuthorize("@ss.hasPermission('member:active-main:query')") public CommonResult> getActiveMainPage(ActiveMainPageReqVO pageReqVO, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 8531d105..fa3d2809 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -3,7 +3,7 @@ spring: name: yudao-server profiles: - active: prod + active: local main: allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。