问题描述
swagger的首页可以显示,就是不显示接口

解决方法
配置类上添加:@EnableWebMvc
package com.chengshan.camera.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json

本文介绍了如何在SpringMVC项目中配置Swagger显示接口,同时处理跨域请求的问题,包括使用`@EnableWebMvc`注解启用WebMVC,配置静态资源处理和CORS策略,以及调整Jackson2HttpMessageConverter以避免日期时间戳输出。
最低0.47元/天 解锁文章
2055

被折叠的 条评论
为什么被折叠?



