diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFile.java b/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFile.java index 27926ac..36321c3 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFile.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFile.java @@ -16,7 +16,7 @@ package org.springblade.core.boot.file; import org.springblade.core.tool.constant.SystemConstant; -import org.springblade.core.tool.date.DateUtil; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.web.multipart.MultipartFile; import java.io.File; diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileProxyFactory.java b/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileProxyFactory.java index 1236818..ae3fefb 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileProxyFactory.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/file/BladeFileProxyFactory.java @@ -16,7 +16,7 @@ package org.springblade.core.boot.file; import org.springblade.core.tool.constant.SystemConstant; -import org.springblade.core.tool.date.DateUtil; +import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.ImageUtil; import org.springblade.core.tool.utils.StringPool; diff --git a/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java b/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java index fc5dc6c..77d01b4 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java @@ -23,7 +23,7 @@ import org.springblade.core.secure.exception.SecureException; import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.ResultCode; import org.springblade.core.tool.utils.Func; -import org.springblade.core.tool.utils.URLUtil; +import org.springblade.core.tool.utils.UrlUtil; import org.springblade.core.tool.utils.WebUtil; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; @@ -155,7 +155,7 @@ public class BladeRestExceptionTranslator { public R handleError(Throwable e) { log.error("服务器异常", e); //发送服务异常事件 - ErrorLogPublisher.publishEvent(e, URLUtil.getPath(WebUtil.getRequest().getRequestURI())); + ErrorLogPublisher.publishEvent(e, UrlUtil.getPath(WebUtil.getRequest().getRequestURI())); return R.failure(ResultCode.INTERNAL_SERVER_ERROR, (Func.isEmpty(e.getMessage()) ? ResultCode.INTERNAL_SERVER_ERROR.getMessage() : e.getMessage())); } diff --git a/blade-core-log/src/main/java/org/springblade/core/log/event/ApiLogListener.java b/blade-core-log/src/main/java/org/springblade/core/log/event/ApiLogListener.java index 931fdf5..5c2e88d 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/event/ApiLogListener.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/event/ApiLogListener.java @@ -22,7 +22,7 @@ import org.springblade.core.log.constant.EventConstant; import org.springblade.core.launch.props.BladeProperties; import org.springblade.core.secure.utils.SecureUtil; import org.springblade.core.launch.server.ServerInfo; -import org.springblade.core.tool.utils.URLUtil; +import org.springblade.core.tool.utils.UrlUtil; import org.springblade.core.tool.utils.WebUtil; import org.springblade.core.log.feign.ILogClient; import org.springblade.core.log.model.LogApi; @@ -64,7 +64,7 @@ public class ApiLogListener { logApi.setEnv(bladeProperties.getEnv()); logApi.setRemoteIp(WebUtil.getIP(request)); logApi.setUserAgent(request.getHeader(WebUtil.USER_AGENT_HEADER)); - logApi.setRequestUri(URLUtil.getPath(request.getRequestURI())); + logApi.setRequestUri(UrlUtil.getPath(request.getRequestURI())); logApi.setMethod(request.getMethod()); logApi.setParams(WebUtil.getRequestParamString(request)); logApi.setCreateBy(SecureUtil.getUserAccount(request)); diff --git a/blade-core-log/src/main/java/org/springblade/core/log/event/BladeLogListener.java b/blade-core-log/src/main/java/org/springblade/core/log/event/BladeLogListener.java index b75cf11..c0e7532 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/event/BladeLogListener.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/event/BladeLogListener.java @@ -24,7 +24,7 @@ import org.springblade.core.log.constant.EventConstant; import org.springblade.core.log.feign.ILogClient; import org.springblade.core.log.model.LogBlade; import org.springblade.core.secure.utils.SecureUtil; -import org.springblade.core.tool.utils.URLUtil; +import org.springblade.core.tool.utils.UrlUtil; import org.springblade.core.tool.utils.WebUtil; import org.springframework.context.event.EventListener; import org.springframework.core.annotation.Order; @@ -56,7 +56,7 @@ public class BladeLogListener { Map source = (Map) event.getSource(); LogBlade logBlade = (LogBlade) source.get(EventConstant.EVENT_LOG); HttpServletRequest request = (HttpServletRequest) source.get(EventConstant.EVENT_REQUEST); - logBlade.setRequestUri(URLUtil.getPath(request.getRequestURI())); + logBlade.setRequestUri(UrlUtil.getPath(request.getRequestURI())); logBlade.setUserAgent(request.getHeader(WebUtil.USER_AGENT_HEADER)); logBlade.setMethod(request.getMethod()); logBlade.setParams(WebUtil.getRequestParamString(request)); diff --git a/blade-core-log/src/main/java/org/springblade/core/log/model/LogApi.java b/blade-core-log/src/main/java/org/springblade/core/log/model/LogApi.java index 6bf3d08..e385e07 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/model/LogApi.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/model/LogApi.java @@ -21,7 +21,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; -import org.springblade.core.tool.date.DatePattern; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; @@ -113,8 +113,8 @@ public class LogApi implements Serializable { /** * 创建时间 */ - @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) - @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) private LocalDateTime createTime; diff --git a/blade-core-log/src/main/java/org/springblade/core/log/model/LogBlade.java b/blade-core-log/src/main/java/org/springblade/core/log/model/LogBlade.java index 7b4ebb8..c489eff 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/model/LogBlade.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/model/LogBlade.java @@ -21,7 +21,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; -import org.springblade.core.tool.date.DatePattern; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; @@ -95,8 +95,8 @@ public class LogBlade implements Serializable { /** * 创建时间 */ - @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) - @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) private LocalDateTime createTime; diff --git a/blade-core-log/src/main/java/org/springblade/core/log/model/LogError.java b/blade-core-log/src/main/java/org/springblade/core/log/model/LogError.java index 7ebfb48..2fd9093 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/model/LogError.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/model/LogError.java @@ -21,7 +21,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; -import org.springblade.core.tool.date.DatePattern; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; @@ -114,7 +114,7 @@ public class LogError implements Serializable { /** * 创建时间 */ - @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) - @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) private LocalDateTime createTime; } diff --git a/blade-core-mybatis/src/main/java/org/springblade/core/mp/base/BaseEntity.java b/blade-core-mybatis/src/main/java/org/springblade/core/mp/base/BaseEntity.java index 06c3a63..8b26a4e 100644 --- a/blade-core-mybatis/src/main/java/org/springblade/core/mp/base/BaseEntity.java +++ b/blade-core-mybatis/src/main/java/org/springblade/core/mp/base/BaseEntity.java @@ -21,7 +21,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import org.springblade.core.tool.date.DatePattern; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; @@ -50,8 +50,8 @@ public class BaseEntity implements Serializable { /** * 创建时间 */ - @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) - @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) @ApiModelProperty(value = "创建时间") private LocalDateTime createTime; @@ -64,8 +64,8 @@ public class BaseEntity implements Serializable { /** * 更新时间 */ - @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) - @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) @ApiModelProperty(value = "更新时间") private LocalDateTime updateTime; diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/config/JacksonConfiguration.java b/blade-core-tool/src/main/java/org/springblade/core/tool/config/JacksonConfiguration.java index 7a662f0..a094aef 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/config/JacksonConfiguration.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/config/JacksonConfiguration.java @@ -19,8 +19,8 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import org.springblade.core.tool.date.DatePattern; import org.springblade.core.tool.jackson.BladeJavaTimeModule; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; @@ -47,7 +47,7 @@ public class JacksonConfiguration { @Primary @Bean public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) { - builder.simpleDateFormat(DatePattern.NORM_DATETIME_PATTERN); + builder.simpleDateFormat(DateUtil.PATTERN_DATETIME); //创建ObjectMapper ObjectMapper objectMapper = builder.createXmlMapper(false).build(); //设置地点为中国 @@ -57,7 +57,7 @@ public class JacksonConfiguration { //设置为中国上海时区 objectMapper.setTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault())); //序列化时,日期的统一格式 - objectMapper.setDateFormat(new SimpleDateFormat(DatePattern.NORM_DATETIME_PATTERN, Locale.CHINA)); + objectMapper.setDateFormat(new SimpleDateFormat(DateUtil.PATTERN_DATETIME, Locale.CHINA)); //序列化处理 objectMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true); objectMapper.configure(JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER, true); diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/PathUtil.java b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/PathUtil.java index 54730c8..2eef300 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/utils/PathUtil.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/utils/PathUtil.java @@ -54,7 +54,7 @@ public class PathUtil { return null; } String protocol = url.getProtocol(); - String file = URLUtil.decodeURL(url.getPath(), Charsets.UTF_8); + String file = UrlUtil.decodeURL(url.getPath(), Charsets.UTF_8); if (FILE_PROTOCOL.equals(protocol)) { return new File(file).getParentFile().getParentFile().getAbsolutePath(); } else if (JAR_PROTOCOL.equals(protocol) || ZIP_PROTOCOL.equals(protocol)) {