From 758bd515e1455ced3c1d6c0ed04e2c22fce6be55 Mon Sep 17 00:00:00 2001 From: niudehua <657563945@qq.com> Date: Mon, 28 Jun 2021 22:13:18 +0800 Subject: [PATCH] sping->spring --- .../permission/SysMenuServiceTest.java | 2 +- .../permission/SysRoleServiceTest.java | 2 +- .../{sping => spring}/SpringAopUtils.java | 2 +- .../SpringExpressionUtils.java | 2 +- .../impl/yunpian/YunpianSmsCodeMapping.java | 40 +++++++++++++------ .../tracer/core/aop/BizTraceAspect.java | 2 +- 6 files changed, 32 insertions(+), 18 deletions(-) rename yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/{sping => spring}/SpringAopUtils.java (96%) rename yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/{sping => spring}/SpringExpressionUtils.java (98%) diff --git a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/system/service/permission/SysMenuServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/system/service/permission/SysMenuServiceTest.java index 81dcfd71d..9479c56bf 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/system/service/permission/SysMenuServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/system/service/permission/SysMenuServiceTest.java @@ -12,7 +12,7 @@ import cn.iocoder.yudao.adminserver.modules.system.dal.mysql.permission.SysMenuM import cn.iocoder.yudao.adminserver.modules.system.enums.permission.MenuTypeEnum; import cn.iocoder.yudao.adminserver.modules.system.mq.producer.permission.SysMenuProducer; import cn.iocoder.yudao.adminserver.modules.system.service.permission.impl.SysMenuServiceImpl; -import cn.iocoder.yudao.framework.common.util.sping.SpringAopUtils; +import cn.iocoder.yudao.framework.common.util.spring.SpringAopUtils; import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import com.google.common.collect.Multimap; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/system/service/permission/SysRoleServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/system/service/permission/SysRoleServiceTest.java index 3943268bd..3b39e976c 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/system/service/permission/SysRoleServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/yudao/adminserver/modules/system/service/permission/SysRoleServiceTest.java @@ -13,7 +13,7 @@ import cn.iocoder.yudao.adminserver.modules.system.dal.mysql.permission.SysRoleM import cn.iocoder.yudao.adminserver.modules.system.enums.permission.SysRoleTypeEnum; import cn.iocoder.yudao.adminserver.modules.system.mq.producer.permission.SysRoleProducer; import cn.iocoder.yudao.adminserver.modules.system.service.permission.impl.SysRoleServiceImpl; -import cn.iocoder.yudao.framework.common.util.sping.SpringAopUtils; +import cn.iocoder.yudao.framework.common.util.spring.SpringAopUtils; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/sping/SpringAopUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/spring/SpringAopUtils.java similarity index 96% rename from yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/sping/SpringAopUtils.java rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/spring/SpringAopUtils.java index efd73c9c8..b71342cb3 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/sping/SpringAopUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/spring/SpringAopUtils.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.framework.common.util.sping; +package cn.iocoder.yudao.framework.common.util.spring; import cn.hutool.core.bean.BeanUtil; import org.springframework.aop.framework.AdvisedSupport; diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/sping/SpringExpressionUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/spring/SpringExpressionUtils.java similarity index 98% rename from yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/sping/SpringExpressionUtils.java rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/spring/SpringExpressionUtils.java index cab09ccaf..659053da7 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/sping/SpringExpressionUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/spring/SpringExpressionUtils.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.framework.common.util.sping; +package cn.iocoder.yudao.framework.common.util.spring; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.map.MapUtil; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java index d6ecdce92..f467ceb4f 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java @@ -9,7 +9,7 @@ import static com.yunpian.sdk.constant.Code.*; /** * 云片的 SmsCodeMapping 实现类 - * + *

* 参见 https://www.yunpian.com/official/document/sms/zh_CN/returnvalue_common 文档 * * @author 芋道源码 @@ -20,24 +20,38 @@ public class YunpianSmsCodeMapping implements SmsCodeMapping { public ErrorCode apply(String apiCode) { int code = Integer.parseInt(apiCode); switch (code) { - case OK: return SUCCESS; - case ARGUMENT_MISSING: return SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR; - case BAD_ARGUMENT_FORMAT: return SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_PARAM_ERROR; + case OK: + return SUCCESS; + case ARGUMENT_MISSING: + return SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR; + case BAD_ARGUMENT_FORMAT: + return SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_PARAM_ERROR; case TPL_NOT_FOUND: - case TPL_NOT_VALID: return SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_INVALID; - case MONEY_NOT_ENOUGH: return SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_MONEY_NOT_ENOUGH; - case BLACK_WORD: return SmsFrameworkErrorCodeConstants.SMS_SEND_CONTENT_INVALID; + case TPL_NOT_VALID: + return SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_INVALID; + case MONEY_NOT_ENOUGH: + return SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_MONEY_NOT_ENOUGH; + case BLACK_WORD: + return SmsFrameworkErrorCodeConstants.SMS_SEND_CONTENT_INVALID; case DUP_IN_SHORT_TIME: case TOO_MANY_TIME_IN_5: case DAY_LIMIT_PER_MOBILE: - case HOUR_LIMIT_PER_MOBILE: return SmsFrameworkErrorCodeConstants.SMS_SEND_BUSINESS_LIMIT_CONTROL; - case BLACK_PHONE_FILTER: return SmsFrameworkErrorCodeConstants.SMS_MOBILE_BLACK; + case HOUR_LIMIT_PER_MOBILE: + return SmsFrameworkErrorCodeConstants.SMS_SEND_BUSINESS_LIMIT_CONTROL; + case BLACK_PHONE_FILTER: + return SmsFrameworkErrorCodeConstants.SMS_MOBILE_BLACK; case SIGN_NOT_MATCH: case BAD_SIGN_FORMAT: - case SIGN_NOT_VALID: return SmsFrameworkErrorCodeConstants.SMS_SIGN_INVALID; - case BAD_API_KEY: return SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_INVALID; - case API_NOT_ALLOWED: return SmsFrameworkErrorCodeConstants.SMS_PERMISSION_DENY; - case IP_NOT_ALLOWED: return SmsFrameworkErrorCodeConstants.SMS_IP_DENY; + case SIGN_NOT_VALID: + return SmsFrameworkErrorCodeConstants.SMS_SIGN_INVALID; + case BAD_API_KEY: + return SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_INVALID; + case API_NOT_ALLOWED: + return SmsFrameworkErrorCodeConstants.SMS_PERMISSION_DENY; + case IP_NOT_ALLOWED: + return SmsFrameworkErrorCodeConstants.SMS_IP_DENY; + default: + break; } return SmsFrameworkErrorCodeConstants.SMS_UNKNOWN; } diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java index 28d94fd0e..7300352de 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.tracer.core.aop; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.tracer.core.annotation.BizTrace; -import cn.iocoder.yudao.framework.common.util.sping.SpringExpressionUtils; +import cn.iocoder.yudao.framework.common.util.spring.SpringExpressionUtils; import cn.iocoder.yudao.framework.tracer.core.util.TracerFrameworkUtils; import io.opentracing.Span; import io.opentracing.Tracer;