java
编译人生
天行健,君子自强不息;地势坤,君子厚德载物~!
展开
-
spirngboot项目 使用AOP限流用户单位时间请求接口次数
说明:使用AOP+redis 实现限制用户单位时间内多次访问接口,我这里使用参数中的userId(用户唯一标识),也可以通过IP或者其他参数来做限制。原创 2023-09-08 17:55:54 · 427 阅读 · 0 评论 -
spring cloud gateway 实现动态路由
spring cloud gateway原创 2023-01-04 17:53:58 · 870 阅读 · 0 评论 -
Java 使用Thumbnails 等比例 base64压缩、旋转等处理图片
1、添加依赖<dependency> <groupId>net.coobird</groupId> <artifactId>thumbnailator</artifactId> <version>0.4.11</version></dependency>import lombok.extern.slf4j.Slf4j;import net.coobird.thumbnai.原创 2020-07-23 17:28:16 · 1666 阅读 · 3 评论 -
将数据库表的数据加载到内存中
Map<String, List<User>> config = new ConcurrentHashMap<>(100);List<User> list = new ArrayList<>(10);User bo1 = new User("A","1");User bo2 = new User("B","1");User bo3 = new User("C","1");User bo4 = new User("A","2");...原创 2020-05-20 19:00:19 · 1974 阅读 · 0 评论 -
java 利用注解及反射做通用的入参校验
类import lombok.Getter;import lombok.Setter;import lombok.ToString;import javax.validation.constraints.*;import java.io.Serializable;@Getter@Setter@ToStringpublic class User implements S...原创 2020-04-27 14:53:19 · 284 阅读 · 0 评论 -
Loading class `com.mysql.jdbc.Driver'. This is deprecated. 警告
springboot启动警告如下:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading...原创 2019-11-05 17:01:39 · 162 阅读 · 0 评论 -
java合并PDF
1.import java.io.FileOutputStream; 2.import java.io.IOException; 3.import com.lowagie.text.Document; 4.import com.lowagie.text.DocumentException; 5.import com.lowagie.text.pdf.PdfCopy; ...原创 2014-12-06 15:34:41 · 91 阅读 · 0 评论