diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..4598f80cb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +*.css linguist-language=java +*.less linguist-language=java +*.js linguist-language=java +*.html linguist-language=java diff --git a/README.md b/README.md index f4ac6fe44..7f1a4474e 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,35 @@ TODO 暂时不提供管理后台的账号密码,等后面提供。 TODO 此处应有一个演示的装逼 GIF 图。 -## TODO +## 其它演示 -提供其他演示环境。例如说 skywalking、sentinel 等等。 +下面,我们会提供目前用到的中间件的管理平台。 + +> 艿艿:考虑到大家可以看到更全的功能,所以一般提供 admin 账号。所以,大家素质使用哟。 + +** SkyWalking UI ** + +* 地址:http://skywalking-ui.shop.iocoder.cn:18099 +* 管理员账号:admin / admin + +** Dubbo Admin ** + +* 地址:http://dubbo-admin.shop.iocoder.cn:18099 +* 管理员账号:无需登陆 + +** RocketMQ Console ** + +* 地址:http://rocketmq-console.shop.iocoder.cn:18099 +* 管理员账号:admin / RPsa2GHjTNs8pxEU + +** Sentinel Console ** + +TODO + +** XXL-Job Console ** + +* 地址:http://job-console.shop.iocoder.cn:18099 +* 管理员账号:admin / 233666 # 技术 diff --git a/Server.md b/Server.md deleted file mode 100644 index d29f3b0fb..000000000 --- a/Server.md +++ /dev/null @@ -1,18 +0,0 @@ -# 前端 Server - -* admin 18083 -* - -# 后端 Server - -# 基础服务 - -## MySQL - -## Zookeeper - -# 运维 - -* ssh 端口 -* 工作目录 /work2/ - diff --git a/common/common-framework/src/main/java/cn/iocoder/common/framework/config/GlobalExceptionHandler.java b/common/common-framework/src/main/java/cn/iocoder/common/framework/config/GlobalExceptionHandler.java index ebe57cc7d..61909bbfb 100644 --- a/common/common-framework/src/main/java/cn/iocoder/common/framework/config/GlobalExceptionHandler.java +++ b/common/common-framework/src/main/java/cn/iocoder/common/framework/config/GlobalExceptionHandler.java @@ -54,4 +54,6 @@ public class GlobalExceptionHandler { return CommonResult.error(SysErrorCodeEnum.SYS_ERROR.getCode(), SysErrorCodeEnum.SYS_ERROR.getMessage()); } + // TODO 芋艿,应该还有其它的异常,需要进行翻译 + } diff --git a/common/common-framework/src/main/java/cn/iocoder/common/framework/dubbo/DubboExceptionFilter.java b/common/common-framework/src/main/java/cn/iocoder/common/framework/dubbo/DubboExceptionFilter.java new file mode 100644 index 000000000..2ac4dca9b --- /dev/null +++ b/common/common-framework/src/main/java/cn/iocoder/common/framework/dubbo/DubboExceptionFilter.java @@ -0,0 +1,105 @@ +package cn.iocoder.common.framework.dubbo; + +import cn.iocoder.common.framework.exception.ServiceException; +import org.apache.dubbo.common.Constants; +import org.apache.dubbo.common.extension.Activate; +import org.apache.dubbo.common.logger.Logger; +import org.apache.dubbo.common.logger.LoggerFactory; +import org.apache.dubbo.common.utils.ReflectUtils; +import org.apache.dubbo.common.utils.StringUtils; +import org.apache.dubbo.rpc.*; +import org.apache.dubbo.rpc.filter.ExceptionFilter; +import org.apache.dubbo.rpc.service.GenericService; + +import java.lang.reflect.Method; + +/** + * 基于 {@link org.apache.dubbo.rpc.filter.ExceptionFilter} 实现 + * + * 主要目的是,一些全局性的异常,能够返回。因为,Dubbo Consumer 能够保证,一定会引入全局性的异常。 + */ +@Activate(group = Constants.PROVIDER) +public class DubboExceptionFilter implements Filter { + + private final Logger logger; + + public DubboExceptionFilter() { + this(LoggerFactory.getLogger(ExceptionFilter.class)); + } + + public DubboExceptionFilter(Logger logger) { + this.logger = logger; + } + + @Override + public Result invoke(Invoker invoker, Invocation invocation) throws RpcException { + try { + return invoker.invoke(invocation); + } catch (RuntimeException e) { + logger.error("Got unchecked and undeclared exception which called by " + RpcContext.getContext().getRemoteHost() + + ". service: " + invoker.getInterface().getName() + ", method: " + invocation.getMethodName() + + ", exception: " + e.getClass().getName() + ": " + e.getMessage(), e); + throw e; + } + } + + @Override + public Result onResponse(Result result, Invoker invoker, Invocation invocation) { + if (result.hasException() && GenericService.class != invoker.getInterface()) { + try { + Throwable exception = result.getException(); + + // directly throw if it's checked exception + if (!(exception instanceof RuntimeException) && (exception instanceof Exception)) { + return result; + } else if (exception instanceof ServiceException) { // add by 芋艿。如果是业务异常,继续抛出 + return result; + } + // directly throw if the exception appears in the signature + try { + Method method = invoker.getInterface().getMethod(invocation.getMethodName(), invocation.getParameterTypes()); + Class[] exceptionClassses = method.getExceptionTypes(); + for (Class exceptionClass : exceptionClassses) { + if (exception.getClass().equals(exceptionClass)) { + return result; + } + } + } catch (NoSuchMethodException e) { + return result; + } + + // for the exception not found in method's signature, print ERROR message in server's log. + logger.error("Got unchecked and undeclared exception which called by " + RpcContext.getContext().getRemoteHost() + + ". service: " + invoker.getInterface().getName() + ", method: " + invocation.getMethodName() + + ", exception: " + exception.getClass().getName() + ": " + exception.getMessage(), exception); + + // directly throw if exception class and interface class are in the same jar file. + String serviceFile = ReflectUtils.getCodeBase(invoker.getInterface()); + String exceptionFile = ReflectUtils.getCodeBase(exception.getClass()); + if (serviceFile == null || exceptionFile == null || serviceFile.equals(exceptionFile)) { + return result; + } + // directly throw if it's JDK exception + String className = exception.getClass().getName(); + if (className.startsWith("java.") || className.startsWith("javax.")) { + return result; + } + // directly throw if it's dubbo exception + if (exception instanceof RpcException) { + return result; + } + + // otherwise, wrap with RuntimeException and throw back to the client + return new RpcResult(new RuntimeException(StringUtils.toString(exception))); + } catch (Throwable e) { + logger.warn("Fail to ExceptionFilter when called by " + RpcContext.getContext().getRemoteHost() + + ". service: " + invoker.getInterface().getName() + ", method: " + invocation.getMethodName() + + ", exception: " + e.getClass().getName() + ": " + e.getMessage(), e); + return result; + } + } + return result; + } + +} + diff --git a/common/common-framework/src/main/java/cn/iocoder/common/framework/exception/ServiceException.java b/common/common-framework/src/main/java/cn/iocoder/common/framework/exception/ServiceException.java index 1bca1cd7c..933255c26 100644 --- a/common/common-framework/src/main/java/cn/iocoder/common/framework/exception/ServiceException.java +++ b/common/common-framework/src/main/java/cn/iocoder/common/framework/exception/ServiceException.java @@ -27,7 +27,7 @@ package cn.iocoder.common.framework.exception; * 不限制规则。 * 一般建议,每个模块自增。 */ -public class ServiceException extends RuntimeException { +public final class ServiceException extends RuntimeException { /** * 错误码 @@ -43,4 +43,4 @@ public class ServiceException extends RuntimeException { return code; } -} \ No newline at end of file +} diff --git a/common/common-framework/src/main/resource/META-INF/dubbo/com.alibaba.dubbo.rpc.Filter b/common/common-framework/src/main/resource/META-INF/dubbo/com.alibaba.dubbo.rpc.Filter new file mode 100644 index 000000000..7bae86c9d --- /dev/null +++ b/common/common-framework/src/main/resource/META-INF/dubbo/com.alibaba.dubbo.rpc.Filter @@ -0,0 +1 @@ +dubboExceptionFilter=cn.iocoder.common.framework.dubbo.DubboExceptionFilter diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/CartItemGroupBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/CartItemGroupBO.java deleted file mode 100644 index 0ee268219..000000000 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/CartItemGroupBO.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -import java.util.List; - -/** - * 商品分组 BO - * - * 主要目的是,多个商品, - */ -public class CartItemGroupBO { - - /** - * TODO 芋艿,活动 - */ - private Object activity; - /** - * 商品数组 - */ - private List items; - -} diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/FeeMessageBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/FeeMessageBO.java deleted file mode 100644 index 0712a1cb3..000000000 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/FeeMessageBO.java +++ /dev/null @@ -1,26 +0,0 @@ -package cn.iocoder.mall.order.api.bo; - -public class FeeMessageBO { - - /** - * 总价 - */ - private Integer originalTotal; - /** - * 优惠总价 - * - * 注意,满多少元包邮,不算在优惠中。 - */ - private Integer discountTotal; - /** - * 邮费 - */ - private Integer postageTotal; - /** - * 最终价格 - * - * 计算公式 = 总价 - 优惠总价 + 邮费 - */ - private Integer presentTotal; - -} diff --git a/order/order-service-impl/src/main/resources/config/application-test.yaml b/order/order-service-impl/src/main/resources/config/application-test.yaml new file mode 100644 index 000000000..268e6407b --- /dev/null +++ b/order/order-service-impl/src/main/resources/config/application-test.yaml @@ -0,0 +1,7 @@ +spring: + # datasource + datasource: + url: jdbc:mysql://192.168.88.14:3306/mall_order?useSSL=false&useUnicode=true&characterEncoding=UTF-8 + driver-class-name: com.mysql.jdbc.Driver + username: root + password: ${MALL_MYSQL_PASSWORD} diff --git a/order/order-service-impl/src/main/resources/config/application.yaml b/order/order-service-impl/src/main/resources/config/application.yaml index 9a80ed381..70dc731f8 100644 --- a/order/order-service-impl/src/main/resources/config/application.yaml +++ b/order/order-service-impl/src/main/resources/config/application.yaml @@ -24,6 +24,7 @@ dubbo: scan: base-packages: cn.iocoder.mall.order.biz.service provider: + filter: -exception CartService: version: 1.0.0 consumer: diff --git a/pay/pay-service-impl/src/main/resources/config/application-dev.yaml b/pay/pay-service-impl/src/main/resources/config/application-dev.yaml deleted file mode 100644 index b8ff14095..000000000 --- a/pay/pay-service-impl/src/main/resources/config/application-dev.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# xxl-job -xxl: - job: - admin: - addresses: http://127.0.0.1:18079/ - executor: - appname: pay-job-executor - ip: - port: 0 - logpath: /Users/yunai/logs/xxl-job/ - logretentiondays: 1 - accessToken: diff --git a/pay/pay-service-impl/src/main/resources/config/application-test.yaml b/pay/pay-service-impl/src/main/resources/config/application-test.yaml new file mode 100644 index 000000000..901ef17a7 --- /dev/null +++ b/pay/pay-service-impl/src/main/resources/config/application-test.yaml @@ -0,0 +1,26 @@ +spring: + # datasource + datasource: + url: jdbc:mysql://192.168.88.14:3306/mall_apy?useSSL=false&useUnicode=true&characterEncoding=UTF-8 + driver-class-name: com.mysql.jdbc.Driver + username: root + password: ${MALL_MYSQL_PASSWORD} + +# xxl-job +xxl: + job: + admin: + addresses: http://127.0.0.1:18079/ + executor: + appname: pay-job-executor + ip: + port: 0 + logpath: /Users/yunai/logs/xxl-job/ + logretentiondays: 1 + accessToken: + +# rocketmq +rocketmq: + name-server: 192.168.88.14:9876 + producer: + group: pay-producer-group diff --git a/pay/pay-service-impl/src/main/resources/config/application.yaml b/pay/pay-service-impl/src/main/resources/config/application.yaml index 70f3aad20..800ee9835 100644 --- a/pay/pay-service-impl/src/main/resources/config/application.yaml +++ b/pay/pay-service-impl/src/main/resources/config/application.yaml @@ -24,6 +24,7 @@ dubbo: scan: base-packages: cn.iocoder.mall.pay.biz.service provider: + filter: -exception PayTransactionService: version: 1.0.0 PayRefundService: diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSpuDO.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSpuDO.java index 25fa9774c..4a906deaa 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSpuDO.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSpuDO.java @@ -6,6 +6,8 @@ import lombok.experimental.Accessors; /** * 商品 SPU + * + * TODO 芋艿,后面增加商品普通参数。例如说,正面材料,背面材料,屏幕尺寸。 */ @Data @Accessors(chain = true) diff --git a/product/product-service-impl/src/main/resources/config/application-test.yaml b/product/product-service-impl/src/main/resources/config/application-test.yaml new file mode 100644 index 000000000..d5d5c6689 --- /dev/null +++ b/product/product-service-impl/src/main/resources/config/application-test.yaml @@ -0,0 +1,13 @@ +spring: + # datasource + datasource: + url: jdbc:mysql://192.168.88.14:3306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8 + driver-class-name: com.mysql.jdbc.Driver + username: root + password: ${MALL_MYSQL_PASSWORD} + +# rocketmq +rocketmq: + name-server: 192.168.88.14:9876 + producer: + group: product-producer-group diff --git a/product/product-service-impl/src/main/resources/config/application.yaml b/product/product-service-impl/src/main/resources/config/application.yaml index 09cf91221..27e328f55 100644 --- a/product/product-service-impl/src/main/resources/config/application.yaml +++ b/product/product-service-impl/src/main/resources/config/application.yaml @@ -24,6 +24,7 @@ dubbo: scan: base-packages: cn.iocoder.mall.product.service provider: + filter: -exception ProductAttrService: version: 1.0.0 ProductCategoryService: diff --git a/promotion/promotion-service-impl/src/main/resources/config/application-test.yaml b/promotion/promotion-service-impl/src/main/resources/config/application-test.yaml new file mode 100644 index 000000000..2abf34582 --- /dev/null +++ b/promotion/promotion-service-impl/src/main/resources/config/application-test.yaml @@ -0,0 +1,7 @@ +spring: + # datasource + datasource: + url: jdbc:mysql://192.168.88.14:3306/mall_promotion?useSSL=false&useUnicode=true&characterEncoding=UTF-8 + driver-class-name: com.mysql.jdbc.Driver + username: root + password: ${MALL_MYSQL_PASSWORD} diff --git a/promotion/promotion-service-impl/src/main/resources/config/application.yaml b/promotion/promotion-service-impl/src/main/resources/config/application.yaml index c9a459e0c..41426d793 100644 --- a/promotion/promotion-service-impl/src/main/resources/config/application.yaml +++ b/promotion/promotion-service-impl/src/main/resources/config/application.yaml @@ -27,6 +27,7 @@ dubbo: ProductSpuService: version: 1.0.0 provider: + filter: -exception BannerService: version: 1.0.0 CouponService: diff --git a/search/search-application/src/main/java/cn/iocoder/mall/search/application/controller/users/UsersProductSearchController.java b/search/search-application/src/main/java/cn/iocoder/mall/search/application/controller/users/UsersProductSearchController.java index ab0bc2758..508356672 100644 --- a/search/search-application/src/main/java/cn/iocoder/mall/search/application/controller/users/UsersProductSearchController.java +++ b/search/search-application/src/main/java/cn/iocoder/mall/search/application/controller/users/UsersProductSearchController.java @@ -19,6 +19,9 @@ import java.util.Collections; import static cn.iocoder.common.framework.vo.CommonResult.success; +// TODO 芋艿,搜索关键字的配置 +// TODO 芋艿,搜索日志 + @RestController @RequestMapping("users/product") @Api("商品搜索") diff --git a/search/search-service-impl/src/main/resources/config/application-test.yaml b/search/search-service-impl/src/main/resources/config/application-test.yaml new file mode 100644 index 000000000..5e48f70bf --- /dev/null +++ b/search/search-service-impl/src/main/resources/config/application-test.yaml @@ -0,0 +1,14 @@ +# es +spring: + data: + elasticsearch: + cluster-name: elasticsearch + cluster-nodes: 192.168.88.14:9300 + repositories: + enable: true + +# rocketmq +rocketmq: + name-server: 192.168.88.14:9876 + producer: + group: search-producer-group diff --git a/search/search-service-impl/src/main/resources/config/application.yaml b/search/search-service-impl/src/main/resources/config/application.yaml index 537878428..e58d6f5fe 100644 --- a/search/search-service-impl/src/main/resources/config/application.yaml +++ b/search/search-service-impl/src/main/resources/config/application.yaml @@ -19,6 +19,7 @@ dubbo: scan: base-packages: cn.iocoder.mall.search.biz.service provider: + filter: -exception ProductSearchService: version: 1.0.0 consumer: diff --git a/system/system-application/src/main/java/cn/iocoder/mall/admin/application/controller/admins/AdminController.java b/system/system-application/src/main/java/cn/iocoder/mall/admin/application/controller/admins/AdminController.java index 0bbd73da5..11f1c10a3 100644 --- a/system/system-application/src/main/java/cn/iocoder/mall/admin/application/controller/admins/AdminController.java +++ b/system/system-application/src/main/java/cn/iocoder/mall/admin/application/controller/admins/AdminController.java @@ -50,7 +50,6 @@ public class AdminController { public CommonResult> menuResourceTree() { List resources = resourceService.getResourcesByTypeAndRoleIds(ResourceConstants.TYPE_MENU, AdminSecurityContextHolder.getContext().getRoleIds()); // 创建 AdminMenuTreeNodeVO Map -// Map treeNodeMap = resources.stream().collect(Collectors.toMap(ResourceBO::getId, ResourceConvert.INSTANCE::convert)); Map treeNodeMap = new LinkedHashMap<>(); // 使用 LinkedHashMap 的原因,是为了排序 。实际也可以用 Stream API ,就是太丑了。 resources.stream().sorted(Comparator.comparing(ResourceBO::getSort)).forEach(resourceBO -> treeNodeMap.put(resourceBO.getId(), ResourceConvert.INSTANCE.convert(resourceBO))); // 处理父子关系 diff --git a/system/system-application/src/main/resources/application-test.yaml b/system/system-application/src/main/resources/application-test.yaml index 3a00bd5a7..a5868258e 100644 --- a/system/system-application/src/main/resources/application-test.yaml +++ b/system/system-application/src/main/resources/application-test.yaml @@ -2,7 +2,7 @@ spring: boot: admin: client: - enabled: true + enabled: false # 暂时不用了 url: http://127.0.0.1:18097 @@ -12,4 +12,4 @@ management: exposure: include: "*" server: - port: 19083 # 配置独立端口。而该端口,不使用 nginx 对外暴露,从而不配置安全认证。也就是说,内网环境可访问,外网环境不可访问。当然,这么做的前提是,认为内网安全。 \ No newline at end of file + port: 19083 # 配置独立端口。而该端口,不使用 nginx 对外暴露,从而不配置安全认证。也就是说,内网环境可访问,外网环境不可访问。当然,这么做的前提是,认为内网安全。 diff --git a/system/system-sdk/src/main/java/cn/iocoder/mall/admin/sdk/context/AdminSecurityContextHolder.java b/system/system-sdk/src/main/java/cn/iocoder/mall/admin/sdk/context/AdminSecurityContextHolder.java index 50419489c..532d650e1 100644 --- a/system/system-sdk/src/main/java/cn/iocoder/mall/admin/sdk/context/AdminSecurityContextHolder.java +++ b/system/system-sdk/src/main/java/cn/iocoder/mall/admin/sdk/context/AdminSecurityContextHolder.java @@ -7,24 +7,24 @@ package cn.iocoder.mall.admin.sdk.context; */ public class AdminSecurityContextHolder { - private static final ThreadLocal securityContext = new ThreadLocal(); + private static final ThreadLocal SECURITY_CONTEXT = new ThreadLocal<>(); public static void setContext(AdminSecurityContext context) { - securityContext.set(context); + SECURITY_CONTEXT.set(context); } public static AdminSecurityContext getContext() { - AdminSecurityContext ctx = securityContext.get(); + AdminSecurityContext ctx = SECURITY_CONTEXT.get(); // 为空时,设置一个空的进去 if (ctx == null) { ctx = new AdminSecurityContext(null, null); - securityContext.set(ctx); + SECURITY_CONTEXT.set(ctx); } return ctx; } public static void clear() { - securityContext.remove(); + SECURITY_CONTEXT.remove(); } -} \ No newline at end of file +} diff --git a/system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dataobject/AdminDO.java b/system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dataobject/AdminDO.java index 32ed645c6..77a0231b3 100644 --- a/system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dataobject/AdminDO.java +++ b/system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dataobject/AdminDO.java @@ -34,4 +34,7 @@ public class AdminDO extends DeletableDO { */ private Integer status; + // TODO 芋艿,最后登陆时间、最后登陆 IP + // TODO 芋艿,登陆日志 + } diff --git a/system/system-service-impl/src/main/resources/config/application-test.yaml b/system/system-service-impl/src/main/resources/config/application-test.yaml new file mode 100644 index 000000000..04e958187 --- /dev/null +++ b/system/system-service-impl/src/main/resources/config/application-test.yaml @@ -0,0 +1,7 @@ +spring: + # datasource + datasource: + url: jdbc:mysql://192.168.88.14:3306/mall_admin?useSSL=false&useUnicode=true&characterEncoding=UTF-8 + driver-class-name: com.mysql.jdbc.Driver + username: root + password: ${MALL_MYSQL_PASSWORD} diff --git a/system/system-service-impl/src/main/resources/config/application.yaml b/system/system-service-impl/src/main/resources/config/application.yaml index cef938fb0..aaf7532f0 100644 --- a/system/system-service-impl/src/main/resources/config/application.yaml +++ b/system/system-service-impl/src/main/resources/config/application.yaml @@ -24,6 +24,7 @@ dubbo: scan: base-packages: cn.iocoder.mall.admin.service provider: + filter: -exception AdminAccessLogService: version: 1.0.0 AdminService: diff --git a/user/user-sdk/src/main/java/cn/iocoder/mall/user/sdk/context/UserSecurityContextHolder.java b/user/user-sdk/src/main/java/cn/iocoder/mall/user/sdk/context/UserSecurityContextHolder.java index cb51cabeb..09ca1bcd1 100644 --- a/user/user-sdk/src/main/java/cn/iocoder/mall/user/sdk/context/UserSecurityContextHolder.java +++ b/user/user-sdk/src/main/java/cn/iocoder/mall/user/sdk/context/UserSecurityContextHolder.java @@ -7,24 +7,24 @@ package cn.iocoder.mall.user.sdk.context; */ public class UserSecurityContextHolder { - private static final ThreadLocal securityContext = new ThreadLocal(); + private static final ThreadLocal SECURITY_CONTEXT = new ThreadLocal(); public static void setContext(UserSecurityContext context) { - securityContext.set(context); + SECURITY_CONTEXT.set(context); } public static UserSecurityContext getContext() { - UserSecurityContext ctx = securityContext.get(); + UserSecurityContext ctx = SECURITY_CONTEXT.get(); // 为空时,设置一个空的进去 if (ctx == null) { ctx = new UserSecurityContext(null); - securityContext.set(ctx); + SECURITY_CONTEXT.set(ctx); } return ctx; } public static void clear() { - securityContext.remove(); + SECURITY_CONTEXT.remove(); } -} \ No newline at end of file +} diff --git a/user/user-service-impl/src/main/resources/config/application-test.yaml b/user/user-service-impl/src/main/resources/config/application-test.yaml new file mode 100644 index 000000000..f96dc7220 --- /dev/null +++ b/user/user-service-impl/src/main/resources/config/application-test.yaml @@ -0,0 +1,7 @@ +spring: + # datasource + datasource: + url: jdbc:mysql://192.168.88.14:3306/mall_user?useSSL=false&useUnicode=true&characterEncoding=UTF-8 + driver-class-name: com.mysql.jdbc.Driver + username: root + password: ${MALL_MYSQL_PASSWORD} diff --git a/user/user-service-impl/src/main/resources/config/application.yaml b/user/user-service-impl/src/main/resources/config/application.yaml index 2b098b75c..e469d9354 100644 --- a/user/user-service-impl/src/main/resources/config/application.yaml +++ b/user/user-service-impl/src/main/resources/config/application.yaml @@ -24,6 +24,7 @@ dubbo: scan: base-packages: cn.iocoder.mall.user.biz.service provider: + filter: -exception MobileCodeService: version: 1.0.0 OAuth2Service: