升级:升级后端依赖

1.Spring Boot 2.7.8 => 2.7.10
2.Redisson 3.19.0 => 2.20.0
3.Easy Excel 3.2.0 => 3.2.1
4.Knife4j 4.0.0 => 4.1.0(此版本已内置了 springdoc-openapi-ui 依赖)
5.Hutool 5.8.11 => 5.8.16
This commit is contained in:
2023-03-27 21:22:14 +08:00
parent 405d40e19d
commit 51a82d8f4e
5 changed files with 64 additions and 50 deletions

View File

@@ -132,11 +132,6 @@ limitations under the License.
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
</dependency>
<!-- Spring Doc OpenAPI可以结合 Spring Boot 使用的,基于 OpenAPI3 的 API 文档生成工具) -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
</dependency>
<!-- Redisson不仅仅是一个 Redis Java 客户端) -->
<dependency>

View File

@@ -25,6 +25,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.CacheControl;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.cors.CorsConfiguration;
@@ -108,11 +109,16 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
*/
@Override
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
// 自定义 converters 时,需要手动在最前面添加 ByteArrayHttpMessageConverter
// 否则 Spring Doc OpenAPI 的 /*/api-docs/**(例如:/v3/api-docs/default接口响应内容会变为 Base64 编码后的内容,最终导致接口文档解析失败
// 详情请参阅https://github.com/springdoc/springdoc-openapi/issues/2143
converters.add(new ByteArrayHttpMessageConverter());
converters.removeIf(MappingJackson2HttpMessageConverter.class::isInstance);
if (Objects.isNull(mappingJackson2HttpMessageConverter)) {
converters.add(0, new MappingJackson2HttpMessageConverter());
converters.add(new MappingJackson2HttpMessageConverter());
} else {
converters.add(0, mappingJackson2HttpMessageConverter);
converters.add(mappingJackson2HttpMessageConverter);
}
}
}