随笔分类 -  spring boot

1 2 3 下一页
html 转pdf pdf 抓 图片
该文被密码保护。
posted @ 2024-06-24 09:51 lshan 阅读(0) 评论(0) 推荐(0)
Spring Data JPA 使用 SQLite
摘要:Springboot+JPA+Sqlite整合demo参考: https://afu-bob.blog.csdn.net/article/details/90294553 简单使用: 1.依赖 <!-- https://mvnrepository.com/artifact/com.github.gw 阅读全文
posted @ 2022-08-24 11:44 lshan 阅读(1014) 评论(0) 推荐(0)
分布式幂等 2 (基于请求参数幂等)- 自定义接口幂等(注解) @AvoidResubmit(isLoc = false,interval=3000)
摘要:场景:用于接口请求参数幂等,基于请求参数判断在3s(interval)时间内是否重复提交,重复提交,则直接返回 {"code":2500,"message":"重复提交"} EVN : springboot 2.3.12 + jdk8 使用: 1.(在需要做类似幂等的接口加上注解)@AvoidRes 阅读全文
posted @ 2022-08-05 10:50 lshan 阅读(85) 评论(0) 推荐(0)
分布式幂等1(基于一次性token) - 自定义接口幂等(注解) @AvoidResubmit(isLoc = false)
摘要:/** * 目的: 自定义切片,防止表单重复提交, 尤其是服务间调用,retry,防止重复提交数据 * 1. 表单提交时 , 优先获取 一个token * 2. 提交表单时, 携带token 请求头 (header name: rdtc_token) * 3. 如果重复提交,响应: 重复提交 {"c 阅读全文
posted @ 2022-08-02 19:51 lshan 阅读(153) 评论(0) 推荐(0)
分布式事务( TCC) -- seata eurake springboot mysql (1.4.2)
摘要:项目搭建见: 分布式事务( XA) -- seata eurake springboot mysql (1.4.2) https://www.cnblogs.com/lshan/p/16533280.html 官网示例代码: https://github.com/seata/seata-sample 阅读全文
posted @ 2022-08-01 18:19 lshan 阅读(229) 评论(0) 推荐(0)
分布式锁-Redisson的使用
摘要:Redisson分布式锁的使用 1.依赖: <!-- 原生,本章使用--> <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> <version>3.13.6</version> </depen 阅读全文
posted @ 2022-08-01 09:51 lshan 阅读(1373) 评论(0) 推荐(0)
分布式事务( XA) -- seata eurake springboot mysql (1.4.2)
摘要:官网文档: https://seata.io/zh-cn/docs/user/configurations.html官网示例代码: https://github.com/seata/seata-samples 1. 下载 : https://github.com/seata/seata/releas 阅读全文
posted @ 2022-07-29 18:58 lshan 阅读(216) 评论(0) 推荐(0)
Spring Boot 统一实现各种参数校验 (jsr303 转)
摘要:原文:https://mp.weixin.qq.com/s/Q0lDPUPUk7FEFk0mLobSYw 说明: 适用于简单VO 校验 简单使用 Java API规范 (JSR303) 定义了Bean校验的标准validation-api,但没有提供实现。hibernate validation是对 阅读全文
posted @ 2022-05-11 09:47 lshan 阅读(389) 评论(0) 推荐(0)
SpringBoot v2.x MongodB 中 去除 _class 字段
摘要:https://blog.csdn.net/bigtree_3721/article/details/82787411 在使用SpringBoot中使用MongoTemplate时,数据库中数据会有_class字段.。_class的意义,在下面这个链接有很好的解答: http://stackover 阅读全文
posted @ 2022-03-28 15:38 lshan 阅读(1778) 评论(0) 推荐(0)
springboot Log4j2 漏洞 最简单方式
摘要:版本: <fastjson.version>1.2.76</fastjson.version>log4j : 受影响的版本 受本次漏洞影响的版本范围为 Apache log4j2 2.0 - 2.14.1 。 最简修复方式 改起来非常简单,不用惊讶,只需要加个下面的配置就可以了 <propertie 阅读全文
posted @ 2022-03-28 11:49 lshan 阅读(355) 评论(0) 推荐(0)
springboot 运行时复制jar中的文件夹到本地 FileUtils
摘要:场景: springboot项目运行时从配置文件夹 加载多个配置,读取路径:Paths.get("src/main/resources/conf"), 在idea中运行是可以读取到的 但是以jar 的方式运行,加载jar中的文件夹,配置无法加载. 换成读取jar中的绝对路径 String path 阅读全文
posted @ 2021-12-22 11:50 lshan 阅读(1563) 评论(0) 推荐(0)
SpringContextUtils Spring 工具类
摘要:SpringContextUtils import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeansException; import org.springframework.context.Ap 阅读全文
posted @ 2021-09-10 11:05 lshan 阅读(1740) 评论(0) 推荐(0)
springboot2.1.3配置sftp,自定义sftp连接池(转)
摘要:原文: https://blog.csdn.net/qq_35433926/article/details/91880345 springboot2.1.3配置sftp,自定义sftp连接池 项目地址 maven依赖 application.yml配置 SftpProperties sftp连接工厂 阅读全文
posted @ 2021-08-24 14:54 lshan 阅读(2013) 评论(0) 推荐(0)
springboot项目启动后,先执行一段代码
摘要:参考原文:https://www.cnblogs.com/zuidongfeng/p/9926471.html 方式1:implements ApplicationRunner import org.springframework.boot.ApplicationArguments; import 阅读全文
posted @ 2021-02-04 14:28 lshan 阅读(592) 评论(0) 推荐(0)
springboot 多数据源(2)使用 Mongorepository
摘要:原文:https://blog.csdn.net/qq_35418518/article/details/107411512?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.chan 阅读全文
posted @ 2020-11-04 12:12 lshan 阅读(1024) 评论(0) 推荐(0)
SpringBoot+Redis分布式锁(模拟抢单)
该文被密码保护。
posted @ 2020-10-12 11:42 lshan 阅读(0) 评论(0) 推荐(0)
springboot 2.1.3 + 单元测试
摘要:依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclu 阅读全文
posted @ 2020-09-08 10:39 lshan 阅读(640) 评论(0) 推荐(0)
springCloud 调用Python web 服务(sideCard)(转)
摘要:原文请参考:https://blog.csdn.net/hliq5399/article/details/80540760 个人应用场景: 使用python 实现一些算法,然后通过java springboot 项目去调用。。。。 ********************************** 阅读全文
posted @ 2020-09-01 10:26 lshan 阅读(1610) 评论(0) 推荐(0)
springboot获取项目的绝对路径和根目录
摘要:原文:https://blog.csdn.net/f45056231p/article/details/88692444 System.getProperty("user.dir") 输出目录: G:\outshine\wangsoso //获取classes目录绝对路径 String path = 阅读全文
posted @ 2020-07-30 17:39 lshan 阅读(8816) 评论(0) 推荐(2)
springboot druid 多数据源(jpa)
摘要:依赖: <!-- add by john com.alibaba/druid --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.19</version> </depe 阅读全文
posted @ 2020-07-30 12:37 lshan 阅读(710) 评论(0) 推荐(0)

1 2 3 下一页