1. 文件服务器(oss) 类似于百度图片
上传一个base64 的流,一个key 就可以存储。成熟的文件服务器会自动对比,上传的流跟库里有没有重复的,有返回则返回相同的code,没有则新建一个code
2.Factory @Mapping
@Mapper(componentModel = "spring")
public inferface stringFactory{
@Mapping(source = "workOrder", target = "workOrderOn")
NameBo inputToBo(NameInput);
}
pom
<dependencies>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>
</dependencies>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
<!-- other annotation processors -->
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
3 hootul 的工具包 嘎嘎好用
1.csv生成解析
2.xls生成解析
3.时间工具
都挺好用的
4 mq ,redis
// mq: 做并行处理,多线程处理,共同领域事件,ddd领域模型数据同步,
@RabbitListener(queues = QUEUE_NAME //队列
, concurrency = "1" //同时进入的链接数
, exclusive = true // 排他锁
, containerFactory = "ConsumerRabbitFactory") // 工厂
// redis:做数据查重,数据码表存储
5 二维码生成
// 生成二维码
QRCodeWriter qrCodeWriter1 = new QRCodeWriter();
//设置二维码图片宽高
BitMatrix bitMatrix1 = qrCodeWriter1.encode(data,BarcodeFormat.QR_CODE, 600, 600);
// 写到输出流
ByteArrayOutputStream outputStream1 = new ByteArrayOutputStream();
写入stream
MatrixToImageWriter.writeToStream(bitMatrix1, "PNG", outputStream1);
// 转base64 流
String advUrl = Base64.encode(outputStream1.toByteArray());
<!--二维码-->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
</dependency>
6 maven 库
https://repo1.maven.org/maven2/