摘要: 全局异常处理类 /** * @Author:humorchen * @Date 2020/11/6 10:46 */ @ControllerAdvice @ResponseBody public class GlobalExceptionHandler { private static final 阅读全文
posted @ 2020-11-08 17:22 HumorChen99 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 添加依赖: <!-- Swagger2--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> 阅读全文
posted @ 2020-11-08 17:15 HumorChen99 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 报错信息:autoType is not support 阅读源码后找这个autotype 解决办法: 在fastjson的序列化器中加一句 static { ParserConfig.getGlobalInstance().addAccept("com.humorchen"); } 阅读全文
posted @ 2020-11-08 15:08 HumorChen99 阅读(1) 评论(0) 推荐(0) 编辑
摘要: FastJson序列化器 实现RedisSerializer /** * @Author:humorchen * @Date 2020/11/8 13:32 */ @Component public class FastJson2JsonRedisSerializer<T> implements R 阅读全文
posted @ 2020-11-08 15:04 HumorChen99 阅读(2) 评论(0) 推荐(0) 编辑
摘要: org.springframework.web.servlet.resource.ResourceHttpRequestHandler cannot be cast to org.springframework.web.method.HandlerMethod 访问的是http://localhos 阅读全文
posted @ 2020-11-08 12:18 HumorChen99 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 按照以下配置即可修复 Swagger配置类 @Configuration public class SwaggerConfig implements WebMvcConfigurer { @Bean public Docket createRestApi() { return new Docket( 阅读全文
posted @ 2020-11-08 12:06 HumorChen99 阅读(1) 评论(0) 推荐(0) 编辑