diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java index 56856993..60b35cc2 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.idempotent.core.keyresolver.impl; import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.SecureUtil; +import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import cn.iocoder.yudao.framework.idempotent.core.keyresolver.IdempotentKeyResolver; import org.aspectj.lang.JoinPoint; @@ -18,7 +19,7 @@ public class DefaultIdempotentKeyResolver implements IdempotentKeyResolver { @Override public String resolver(JoinPoint joinPoint, Idempotent idempotent) { String methodName = joinPoint.getSignature().toString(); - String argsStr = StrUtil.join(",", joinPoint.getArgs()); + String argsStr = StrUtil.join(",", JSONUtil.toJsonStr(joinPoint.getArgs())); return SecureUtil.md5(methodName + argsStr); } diff --git a/zsw-bxg/pom.xml b/zsw-bxg/pom.xml index 1a0d6e2d..dd57a6d5 100644 --- a/zsw-bxg/pom.xml +++ b/zsw-bxg/pom.xml @@ -207,6 +207,10 @@ jsoup 1.14.2 + + cn.iocoder.boot + yudao-spring-boot-starter-protection + diff --git a/zsw-bxg/src/main/java/co/yixiang/app/common/bean/LocalUser.java b/zsw-bxg/src/main/java/co/yixiang/app/common/bean/LocalUser.java index 2cccd6b4..b1906377 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/common/bean/LocalUser.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/common/bean/LocalUser.java @@ -10,7 +10,7 @@ package co.yixiang.app.common.bean; import cn.iocoder.yudao.framework.common.exception.ApiCode; -import co.yixiang.api.UnAuthenticatedException; +import co.yixiang.exception.UnAuthenticatedException; import co.yixiang.app.common.util.JwtToken; import co.yixiang.app.common.util.RequestUtils; import co.yixiang.modules.user.domain.YxUser; diff --git a/zsw-bxg/src/main/java/co/yixiang/app/common/interceptor/PermissionInterceptor.java b/zsw-bxg/src/main/java/co/yixiang/app/common/interceptor/PermissionInterceptor.java index 41b6fc90..c6074a9f 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/common/interceptor/PermissionInterceptor.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/common/interceptor/PermissionInterceptor.java @@ -12,13 +12,11 @@ package co.yixiang.app.common.interceptor; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck; import cn.iocoder.yudao.framework.common.exception.ApiCode; -import co.yixiang.api.UnAuthenticatedException; +import co.yixiang.exception.UnAuthenticatedException; import co.yixiang.app.common.bean.LocalUser; import co.yixiang.app.common.util.JwtToken; -import co.yixiang.constant.ShopConstants; import co.yixiang.modules.user.domain.YxUser; import co.yixiang.modules.user.service.YxUserService; -import co.yixiang.utils.RedisUtils; import com.auth0.jwt.interfaces.Claim; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -26,7 +24,6 @@ import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java index 69260379..1c2ffab3 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java @@ -13,6 +13,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.pojo.ApiResult; import cn.iocoder.yudao.framework.common.exception.ShopException; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.app.common.aop.NoRepeatSubmit; import co.yixiang.app.common.bean.LocalUser; import co.yixiang.app.modules.activity.param.BargainShareParam; @@ -158,7 +159,7 @@ public class AppStoreBargainController { * 参与砍价 */ @AppLog(value = "参与砍价", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/bargain/start") @ApiOperation(value = "参与砍价",notes = "参与砍价") @@ -176,7 +177,7 @@ public class AppStoreBargainController { * 帮助好友砍价 */ @AppLog(value = "帮助好友砍价", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/bargain/help") @ApiOperation(value = "帮助好友砍价",notes = "帮助好友砍价") diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java index 025dcc61..e34415d7 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java @@ -8,6 +8,7 @@ */ package co.yixiang.app.modules.cart.rest; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.annotation.Limit; import cn.iocoder.yudao.framework.common.pojo.ApiResult; import co.yixiang.app.common.aop.NoRepeatSubmit; @@ -66,7 +67,7 @@ public class StoreCartController { * 购物车 添加 */ @AppLog(value = "购物车 添加", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/cart/add") @ApiOperation(value = "添加购物车",notes = "添加购物车") @@ -110,7 +111,7 @@ public class StoreCartController { * 购物车删除产品 */ @AppLog(value = "购物车删除产品", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/cart/del") @ApiOperation(value = "购物车删除产品",notes = "购物车删除产品") diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java index 10b1b741..aad345d3 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java @@ -12,6 +12,7 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.ApiResult; import cn.iocoder.yudao.framework.common.exception.ShopException; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.logging.aop.log.AppLog; import co.yixiang.app.common.aop.NoRepeatSubmit; import co.yixiang.app.common.bean.LocalUser; @@ -93,7 +94,7 @@ public class CouponController { * 领取优惠券 */ @AppLog(value = "领取优惠券", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/coupon/receive") @ApiOperation(value = "领取优惠券",notes = "领取优惠券") diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java index 94241971..d5d145a8 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java @@ -11,6 +11,7 @@ package co.yixiang.app.modules.evaluation.rest; import cn.hutool.core.util.NumberUtil; import cn.iocoder.yudao.framework.common.exception.ShopException; import cn.iocoder.yudao.framework.common.pojo.ApiResult; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck; import co.yixiang.annotation.AnonymousAccess; import co.yixiang.app.common.aop.NoRepeatSubmit; @@ -73,7 +74,7 @@ public class AppStoreEvaluationController { * 添加收藏 */ @AppLog(value = "添加收藏", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/collectEvaluation/add") @ApiOperation(value = "添加收藏",notes = "添加收藏") @@ -90,7 +91,7 @@ public class AppStoreEvaluationController { * 取消收藏 */ @AppLog(value = "取消收藏", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/collectEvaluation/del") @ApiOperation(value = "取消收藏",notes = "取消收藏") diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java index ed260885..da4782b9 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java @@ -13,6 +13,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.pojo.ApiResult; import cn.iocoder.yudao.framework.common.exception.ShopException; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.app.common.aop.NoRepeatSubmit; import co.yixiang.app.common.bean.LocalUser; import co.yixiang.app.modules.order.param.*; @@ -133,7 +134,7 @@ public class AppStoreOrderController { */ @AppLog(value = "订单创建", type = 1) @AuthCheck - @NoRepeatSubmit + @Idempotent @PostMapping("/order/create/{key}") @ApiOperation(value = "订单创建", notes = "订单创建") public ApiResult> create(@Valid @RequestBody OrderParam param, @@ -301,7 +302,7 @@ public class AppStoreOrderController { */ @AppLog(value = "订单评价", type = 1) @AuthCheck - @NoRepeatSubmit + @Idempotent @PostMapping("/order/comment") @ApiOperation(value = "订单评价", notes = "订单评价") public ApiResult comment(@Valid @RequestBody ProductReplyParam param) { @@ -325,7 +326,7 @@ public class AppStoreOrderController { */ @AppLog(value = "订单评价", type = 1) @AuthCheck - @NoRepeatSubmit + @Idempotent @PostMapping("/order/comments") @ApiOperation(value = "订单评价", notes = "订单评价") public ApiResult comments(@Valid @RequestBody List param) { @@ -383,7 +384,7 @@ public class AppStoreOrderController { * 订单退款审核 */ @AppLog(value = "订单退款审核", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/order/refund/verify") @ApiOperation(value = "订单退款审核", notes = "订单退款审核") @@ -400,7 +401,7 @@ public class AppStoreOrderController { * 订单取消 未支付的订单回退积分,回退优惠券,回退库存 */ @AppLog(value = "订单取消", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/order/cancel") @ApiOperation(value = "订单取消", notes = "订单取消") @@ -426,7 +427,7 @@ public class AppStoreOrderController { * 订单删除,用户不可见,但后台可见 */ @AppLog(value = "订单删除", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/order/delete") @ApiOperation(value = "用户进行订单删除", notes = "用户进行订单删除") @@ -475,7 +476,7 @@ public class AppStoreOrderController { * 订单核销 */ @AppLog(value = "订单核销", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/order/order_verific") @ApiOperation(value = "订单核销", notes = "订单核销") diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreProductController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreProductController.java index 7d2af245..bc07d74e 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreProductController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreProductController.java @@ -14,6 +14,7 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.pojo.ApiResult; import cn.iocoder.yudao.framework.common.exception.ShopException; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.app.common.aop.NoRepeatSubmit; import co.yixiang.app.common.bean.LocalUser; import co.yixiang.app.modules.product.param.CollectDelFootParam; @@ -204,7 +205,7 @@ public class AppStoreProductController { * 添加收藏 */ @AppLog(value = "添加收藏", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/collect/add") @ApiOperation(value = "添加收藏",notes = "添加收藏") @@ -221,7 +222,7 @@ public class AppStoreProductController { * 取消收藏 */ @AppLog(value = "取消收藏", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/collect/del") @ApiOperation(value = "取消收藏",notes = "取消收藏") @@ -239,7 +240,7 @@ public class AppStoreProductController { * 取消收藏/足跡 */ @AppLog(value = "删除足跡", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @DeleteMapping("/collect/delFoot") @ApiOperation(value = "删除足跡",notes = "删除足跡") diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/LetterAppUserController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/LetterAppUserController.java index 5d335cdb..674cb7a7 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/LetterAppUserController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/LetterAppUserController.java @@ -11,6 +11,7 @@ package co.yixiang.app.modules.user.rest; import cn.hutool.core.date.DateTime; import cn.iocoder.yudao.framework.common.pojo.ApiResult; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.app.common.aop.NoRepeatSubmit; import co.yixiang.app.common.bean.LocalUser; import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck; @@ -265,7 +266,7 @@ public class LetterAppUserController { * 开始签到 */ @AppLog(value = "开始签到", type = 1) - @NoRepeatSubmit + @Idempotent @AuthCheck @PostMapping("/sign/integral") @ApiOperation(value = "开始签到",notes = "开始签到") diff --git a/zsw-bxg/src/main/java/co/yixiang/api/BusinessException.java b/zsw-bxg/src/main/java/co/yixiang/exception/BusinessException.java similarity index 96% rename from zsw-bxg/src/main/java/co/yixiang/api/BusinessException.java rename to zsw-bxg/src/main/java/co/yixiang/exception/BusinessException.java index 533e6594..5d26e119 100644 --- a/zsw-bxg/src/main/java/co/yixiang/api/BusinessException.java +++ b/zsw-bxg/src/main/java/co/yixiang/exception/BusinessException.java @@ -6,7 +6,7 @@ * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) * 一经发现盗用、分享等行为,将追究法律责任,后果自负 */ -package co.yixiang.api; +package co.yixiang.exception; import cn.iocoder.yudao.framework.common.exception.ApiCode; diff --git a/zsw-bxg/src/main/java/co/yixiang/api/DaoException.java b/zsw-bxg/src/main/java/co/yixiang/exception/DaoException.java similarity index 96% rename from zsw-bxg/src/main/java/co/yixiang/api/DaoException.java rename to zsw-bxg/src/main/java/co/yixiang/exception/DaoException.java index 388e9324..c292e7bd 100644 --- a/zsw-bxg/src/main/java/co/yixiang/api/DaoException.java +++ b/zsw-bxg/src/main/java/co/yixiang/exception/DaoException.java @@ -6,7 +6,7 @@ * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) * 一经发现盗用、分享等行为,将追究法律责任,后果自负 */ -package co.yixiang.api; +package co.yixiang.exception; import cn.iocoder.yudao.framework.common.exception.ApiCode; diff --git a/zsw-bxg/src/main/java/co/yixiang/api/UnAuthenticatedException.java b/zsw-bxg/src/main/java/co/yixiang/exception/UnAuthenticatedException.java similarity index 96% rename from zsw-bxg/src/main/java/co/yixiang/api/UnAuthenticatedException.java rename to zsw-bxg/src/main/java/co/yixiang/exception/UnAuthenticatedException.java index a2adeee4..61c73b76 100644 --- a/zsw-bxg/src/main/java/co/yixiang/api/UnAuthenticatedException.java +++ b/zsw-bxg/src/main/java/co/yixiang/exception/UnAuthenticatedException.java @@ -6,7 +6,7 @@ * 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台) * 一经发现盗用、分享等行为,将追究法律责任,后果自负 */ -package co.yixiang.api; +package co.yixiang.exception; import cn.iocoder.yudao.framework.common.exception.ApiCode; import cn.iocoder.yudao.framework.common.exception.ShopException; diff --git a/zsw-bxg/src/main/java/co/yixiang/mapper/EntityMapper.java b/zsw-bxg/src/main/java/co/yixiang/mapper/EntityMapper.java deleted file mode 100644 index 62eaec23..00000000 --- a/zsw-bxg/src/main/java/co/yixiang/mapper/EntityMapper.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (C) 2018-2022 - * All rights reserved, Designed By www.yixiang.co - - */ -package co.yixiang.mapper; - -import java.util.List; - -/** - * @author Zheng Jie - * @date 2018-11-23 - */ -public interface EntityMapper { - - /** - * DTO转Entity - * @param dto - * @return - */ - E toEntity(D dto); - - /** - * Entity转DTO - * @param entity - * @return - */ - D toDto(E entity); - - /** - * DTO集合转Entity集合 - * @param dtoList - * @return - */ - List toEntity(List dtoList); - - /** - * Entity集合转DTO集合 - * @param entityList - * @return - */ - List toDto(List entityList); -} diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCombinationController.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCombinationController.java index a811c362..1b71673e 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCombinationController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCombinationController.java @@ -7,6 +7,7 @@ package co.yixiang.modules.activity.rest; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.constant.ShopConstants; import co.yixiang.dozer.service.IGenerator; import co.yixiang.enums.SpecTypeEnum; @@ -89,6 +90,7 @@ public class StoreCombinationController { @Log("新增拼团") @ApiOperation(value = "新增拼团") @PostMapping(value = "/yxStoreCombination") + @Idempotent @PreAuthorize("@ss.hasAnyPermissions('admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT')") public ResponseEntity add(@Validated @RequestBody YxStoreCombinationDto resources){ return new ResponseEntity<>(yxStoreCombinationService.saveCombination(resources),HttpStatus.CREATED); diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java index 5d32033c..b4606385 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java @@ -8,6 +8,7 @@ package co.yixiang.modules.activity.rest; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.exception.ShopException; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.enums.CouponEnum; import co.yixiang.event.TemplateBean; import co.yixiang.event.TemplateEvent; @@ -80,6 +81,7 @@ public class StoreCouponController { @Log("新增") @ApiOperation(value = "新增") @PostMapping(value = "/yxStoreCoupon") + @Idempotent @PreAuthorize("@ss.hasAnyPermissions('admin','YXSTORECOUPON_ALL','YXSTORECOUPON_CREATE')") public ResponseEntity create(@Validated @RequestBody YxStoreCoupon resources){ if(CouponEnum.TYPE_1.getValue().equals(resources.getType()) diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueController.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueController.java index 06660cc1..16bb6ccc 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueController.java @@ -5,6 +5,7 @@ */ package co.yixiang.modules.activity.rest; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.logging.aop.log.Log; import co.yixiang.modules.activity.domain.YxStoreCouponIssue; import co.yixiang.modules.activity.service.YxStoreCouponIssueService; @@ -52,6 +53,7 @@ public class StoreCouponIssueController { @Log("发布") @ApiOperation(value = "发布") @PostMapping(value = "/yxStoreCouponIssue") + @Idempotent // @PreAuthorize("@ss.hasAnyPermissions('admin','YXSTORECOUPONISSUE_ALL','YXSTORECOUPONISSUE_CREATE')") @PreAuthorize("@ss.hasAnyPermissions('admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT')") public ResponseEntity create(@Validated @RequestBody YxStoreCouponIssue resources){ diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreSeckillController.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreSeckillController.java index b84387a0..7eb40476 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreSeckillController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreSeckillController.java @@ -6,6 +6,7 @@ package co.yixiang.modules.activity.rest; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.constant.ShopConstants; import co.yixiang.dozer.service.IGenerator; import co.yixiang.enums.SpecTypeEnum; @@ -80,6 +81,7 @@ public class StoreSeckillController { @Log("发布") @ApiOperation(value = "发布") + @Idempotent @PutMapping(value = "/yxStoreSeckill") @PreAuthorize("@ss.hasAnyPermissions('admin','YXSTORESECKILL_ALL','YXSTORESECKILL_EDIT')") public ResponseEntity update(@Validated @RequestBody YxStoreSeckill resources){ diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/aop/ForbidSubmitAspect.java b/zsw-bxg/src/main/java/co/yixiang/modules/aop/ForbidSubmitAspect.java index 7282a017..2e1de6fb 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/aop/ForbidSubmitAspect.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/aop/ForbidSubmitAspect.java @@ -36,8 +36,7 @@ public class ForbidSubmitAspect { @Around("pointCut(forbidSubmit)") public Object around(ProceedingJoinPoint pjp, ForbidSubmit forbidSubmit) throws Throwable { - //用于拦截演示环境一些禁止操作 - //throw new YshopException("演示环境禁止操作"); + //用于拦截演示环境一些禁止操作 ("演示环境禁止操作"); return pjp.proceed(); diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/WeixinPayService.java b/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/WeixinPayService.java index 22122734..756252cc 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/WeixinPayService.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/mp/service/WeixinPayService.java @@ -11,7 +11,7 @@ import cn.hutool.core.lang.UUID; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; -import co.yixiang.api.BusinessException; +import co.yixiang.exception.BusinessException; import cn.iocoder.yudao.framework.common.exception.ShopException; import co.yixiang.enums.AppFromEnum; import co.yixiang.enums.BillDetailEnum; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java index e922a788..7188d2d5 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java @@ -16,7 +16,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.common.exception.ShopException; -import co.yixiang.api.BusinessException; +import co.yixiang.exception.BusinessException; import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.utils.QueryHelpPlus; import co.yixiang.constant.ShopConstants; @@ -96,7 +96,6 @@ import com.github.pagehelper.PageInfo; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.CacheEvict; import org.springframework.context.ApplicationEventPublisher; import org.springframework.data.domain.Pageable; import org.springframework.data.redis.core.RedisTemplate; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java index 6b747550..c1ae6684 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java @@ -11,6 +11,7 @@ package co.yixiang.modules.product.rest; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.exception.ShopException; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import co.yixiang.constant.ShopConstants; import co.yixiang.dozer.service.IGenerator; import co.yixiang.enums.ShopCommonEnum; @@ -140,7 +141,7 @@ public class StoreProductController { @ForbidSubmit @Log("新增/修改商品") @ApiOperation(value = "新增/修改商品") - + @Idempotent(timeout = 3) @PostMapping(value = "/yxStoreProduct/addOrSave") @PreAuthorize("@ss.hasAnyPermissions('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_CREATE')") public ResponseEntity create(@Validated @RequestBody StoreProductDto storeProductDto){ diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductAttrServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductAttrServiceImpl.java index 4ea27ca1..ba73cabb 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductAttrServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductAttrServiceImpl.java @@ -11,7 +11,7 @@ package co.yixiang.modules.product.service.impl; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import co.yixiang.api.BusinessException; +import co.yixiang.exception.BusinessException; import cn.iocoder.yudao.framework.common.exception.ShopException; import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.dozer.service.IGenerator; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/store/rest/YxStoreBrandController.java b/zsw-bxg/src/main/java/co/yixiang/modules/store/rest/YxStoreBrandController.java index 51d0cbec..f583d9d8 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/store/rest/YxStoreBrandController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/store/rest/YxStoreBrandController.java @@ -9,6 +9,8 @@ package co.yixiang.modules.store.rest; import java.util.Arrays; +import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; +import co.yixiang.app.common.aop.NoRepeatSubmit; import co.yixiang.domain.PageResult; import co.yixiang.dozer.service.IGenerator; import co.yixiang.logging.aop.log.Log; @@ -59,6 +61,7 @@ public class YxStoreBrandController { @PostMapping @Log("新增brand") @ApiOperation("新增brand") + @Idempotent // @PreAuthorize("@ss.hasAnyPermissions('admin','yxStoreBrand:add')") public ResponseEntity create(@Validated @RequestBody YxStoreBrand resources){ return new ResponseEntity<>(yxStoreBrandService.save(resources),HttpStatus.CREATED); diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/template/service/impl/YxShippingTemplatesServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/template/service/impl/YxShippingTemplatesServiceImpl.java index b127a6df..0be4da1e 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/template/service/impl/YxShippingTemplatesServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/template/service/impl/YxShippingTemplatesServiceImpl.java @@ -10,7 +10,7 @@ package co.yixiang.modules.template.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.IdUtil; -import co.yixiang.api.BusinessException; +import co.yixiang.exception.BusinessException; import cn.iocoder.yudao.framework.common.exception.ShopException; import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.utils.QueryHelpPlus; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserServiceImpl.java index fb673ccb..05f1755d 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserServiceImpl.java @@ -12,7 +12,7 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.exception.ApiCode; -import co.yixiang.api.UnAuthenticatedException; +import co.yixiang.exception.UnAuthenticatedException; import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.utils.QueryHelpPlus; import co.yixiang.constant.SystemConfigConstants;