Browse Source

👍 增加幂等性的验证,删除过期无用的注解。

sj
Loki 2 years ago
parent
commit
691efec9f7
  1. 3
      yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java
  2. 4
      zsw-bxg/pom.xml
  3. 2
      zsw-bxg/src/main/java/co/yixiang/app/common/bean/LocalUser.java
  4. 5
      zsw-bxg/src/main/java/co/yixiang/app/common/interceptor/PermissionInterceptor.java
  5. 5
      zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java
  6. 5
      zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java
  7. 3
      zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java
  8. 5
      zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java
  9. 15
      zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java
  10. 7
      zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreProductController.java
  11. 3
      zsw-bxg/src/main/java/co/yixiang/app/modules/user/rest/LetterAppUserController.java
  12. 2
      zsw-bxg/src/main/java/co/yixiang/exception/BusinessException.java
  13. 2
      zsw-bxg/src/main/java/co/yixiang/exception/DaoException.java
  14. 2
      zsw-bxg/src/main/java/co/yixiang/exception/UnAuthenticatedException.java
  15. 43
      zsw-bxg/src/main/java/co/yixiang/mapper/EntityMapper.java
  16. 2
      zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCombinationController.java
  17. 2
      zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java
  18. 2
      zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponIssueController.java
  19. 2
      zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreSeckillController.java
  20. 3
      zsw-bxg/src/main/java/co/yixiang/modules/aop/ForbidSubmitAspect.java
  21. 2
      zsw-bxg/src/main/java/co/yixiang/modules/mp/service/WeixinPayService.java
  22. 3
      zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java
  23. 3
      zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java
  24. 2
      zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductAttrServiceImpl.java
  25. 3
      zsw-bxg/src/main/java/co/yixiang/modules/store/rest/YxStoreBrandController.java
  26. 2
      zsw-bxg/src/main/java/co/yixiang/modules/template/service/impl/YxShippingTemplatesServiceImpl.java
  27. 2
      zsw-bxg/src/main/java/co/yixiang/modules/user/service/impl/YxUserServiceImpl.java

3
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);
}

4
zsw-bxg/pom.xml

@ -207,6 +207,10 @@
<artifactId>jsoup</artifactId>
<version>1.14.2</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-protection</artifactId>
</dependency>
</dependencies>

2
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;

5
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;

5
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 = "帮助好友砍价")

5
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 = "购物车删除产品")

3
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 = "领取优惠券")

5
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 = "取消收藏")

15
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<Map<String, Object>> 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<Boolean> 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<Boolean> comments(@Valid @RequestBody List<ProductReplyParam> 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 = "订单核销")

7
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 = "删除足跡")

3
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 = "开始签到")

2
zsw-bxg/src/main/java/co/yixiang/api/BusinessException.java → 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;

2
zsw-bxg/src/main/java/co/yixiang/api/DaoException.java → 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;

2
zsw-bxg/src/main/java/co/yixiang/api/UnAuthenticatedException.java → 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;

43
zsw-bxg/src/main/java/co/yixiang/mapper/EntityMapper.java

@ -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<D, E> {
/**
* DTO转Entity
* @param dto
* @return
*/
E toEntity(D dto);
/**
* Entity转DTO
* @param entity
* @return
*/
D toDto(E entity);
/**
* DTO集合转Entity集合
* @param dtoList
* @return
*/
List <E> toEntity(List<D> dtoList);
/**
* Entity集合转DTO集合
* @param entityList
* @return
*/
List <D> toDto(List<E> entityList);
}

2
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);

2
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())

2
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){

2
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){

3
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();

2
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;

3
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;

3
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){

2
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;

3
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<Object> create(@Validated @RequestBody YxStoreBrand resources){
return new ResponseEntity<>(yxStoreBrandService.save(resources),HttpStatus.CREATED);

2
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;

2
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;

Loading…
Cancel
Save