![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
weixin_40415768
一回生,二回熟,三回倒背如流
展开
-
Mybatis-plus 多租户 实现游客模式时 RequestContextHolder.getRequestAttributes() 获取 header 商户id
先来看一下正常的 Mybatis-plus 多租户 获取 租户id @Override public Expression getTenantId() { User user = UserUtils.getUser(); return new StringValue(user.getCorp().getId()); }因为当前没得登录token, 所以, 我们需要通过请求头(header) 或者请求参数 进行租户id 的传递在springboot 中。原创 2021-06-16 17:43:16 · 823 阅读 · 0 评论 -
SpringBoot 启动未检查数据库连接
自己做的一个SpringBoot demo,打算使用--多数据源--配好了之后部署我的测试服务器, 看着日志打印=======启动成功=========完美。但是当抄起我的http请求时:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago.原创 2020-09-21 18:07:56 · 2799 阅读 · 2 评论 -
使用Spring-AOP诠释代理模式
## 如果目标对象实现了接口,默认情况下会采用 JDK 的动态代理实现 AOP;如果目标对象没有实现了接口,则采用 CGLIB 库,Spring 会自动在 JDK 动态代理和 CGLIB 动态代理之间转换。原创 2020-04-15 12:10:31 · 141 阅读 · 0 评论 -
Mybatis - 配置版
配置数据库连接spring: profiles: dev datasource: url: jdbc:mysql://localhost:3306/test_1?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC username: root pass...原创 2020-04-04 14:29:55 · 60 阅读 · 0 评论 -
Mybatis - 注解版
配置数据库连接spring: profiles: dev datasource: url: jdbc:mysql://localhost:3306/test_1?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC username: root pass...原创 2020-04-04 14:29:35 · 87 阅读 · 0 评论 -
SpringBoot - Mybatis开门红
Free Mybatis plugin: 实现java代码与xml 之间的跳转原创 2020-04-04 14:28:54 · 85 阅读 · 0 评论