mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2026-04-07 14:14:26 +08:00
v3.31 【增加】字典值反序列增加int类型;【优化】java17版本S3上传文件Bug;【优化】本地文件上传优化文件操作符
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package net.lab1024.sa.base.common.json.deserializer;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.ObjectCodec;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 字典值为 int类型的 反序列化
|
||||
*
|
||||
* @Author 1024创新实验室: 卓大
|
||||
* @Date 2026-04-05 22:17:53
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@Slf4j
|
||||
public class DictDataIntDeserializer extends JsonDeserializer<Integer> {
|
||||
|
||||
@Override
|
||||
public Integer deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
|
||||
ObjectCodec objectCodec = jsonParser.getCodec();
|
||||
JsonNode listOrObjectNode = objectCodec.readTree(jsonParser);
|
||||
return Integer.parseInt(listOrObjectNode.asText());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,6 +37,7 @@ import java.util.UUID;
|
||||
@Slf4j
|
||||
public class FileStorageLocalServiceImpl implements IFileStorageService {
|
||||
|
||||
private static final String FILE_SEPARATOR = "/";
|
||||
|
||||
public static final String UPLOAD_MAPPING = "/upload";
|
||||
|
||||
@@ -78,8 +79,8 @@ public class FileStorageLocalServiceImpl implements IFileStorageService {
|
||||
// 目录不存在,新建
|
||||
directory.mkdirs();
|
||||
}
|
||||
if (!path.endsWith(File.separator)) {
|
||||
path = path + File.separator;
|
||||
if (!path.endsWith(FILE_SEPARATOR)) {
|
||||
path = path + FILE_SEPARATOR;
|
||||
}
|
||||
FileUploadVO fileUploadVO = new FileUploadVO();
|
||||
//原文件名
|
||||
|
||||
Reference in New Issue
Block a user