feat:联调bug修改
parent
32f6eae269
commit
fa1c50d84c
|
|
@ -1,9 +1,15 @@
|
|||
package com.unisinsight.project.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
|
|
@ -11,4 +17,16 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||
WebMvcConfigurer.super.addResourceHandlers(registry);
|
||||
registry.addResourceHandler("/api/vdi/file/down/**").addResourceLocations("file:/var/lib/vdi/test/");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
// 找到Jackson消息转换器并配置命名策略
|
||||
converters.stream()
|
||||
.filter(converter -> converter instanceof MappingJackson2HttpMessageConverter)
|
||||
.map(converter -> (MappingJackson2HttpMessageConverter) converter)
|
||||
.forEach(converter -> {
|
||||
ObjectMapper objectMapper = converter.getObjectMapper();
|
||||
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ public class StoragePool {
|
|||
*/
|
||||
@TableField("pool_name")
|
||||
@ApiModelProperty(value = "存储池名称")
|
||||
@JsonProperty("pool_name")
|
||||
private String poolName;
|
||||
|
||||
/**
|
||||
|
|
@ -63,7 +62,6 @@ public class StoragePool {
|
|||
*/
|
||||
@TableField("create_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonProperty("create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
|
|
@ -71,7 +69,6 @@ public class StoragePool {
|
|||
*/
|
||||
@TableField("update_time")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@JsonProperty("update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue