![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
社恐Coder
社恐症也要写代码,欢迎关注同名微信号。
展开
-
Swagger3 GET请求,使用对象接收 Query 参数,注解怎么写?
简中互联网上就没一个靠谱的答案,最终翻到了 Github Issue 上才解决,真 TMD…… CSDN 就一坨 shit mountain。原创 2023-11-13 10:18:55 · 2246 阅读 · 5 评论 -
SpringBoot Actuator端点访问失败
Actuator部分端点的访问需要鉴权,否则访问返回401失败; 此时需要在配置文件中将安全校验关闭:# ymlmanagement: security: enabled: false# propertiesmanagerment.security.enabled=false需要鉴权的端点为Sensitive端点,如下: ID 描述 Sensitive autocon原创 2017-12-25 11:46:42 · 4729 阅读 · 0 评论 -
SpringBoot全局错误映射
需要自定义ErrorController,继承org.springframework.boot.autoconfigure.web.BasicErrorController,重写两个方法:// 错误映射到Html,Accept-Type为text/html的 public ModelAndView errorHtml(HttpServletRequest request, HttpServletR原创 2017-12-25 11:55:54 · 1321 阅读 · 0 评论 -
SpringBoot Maven依赖配置 starter
SpringBoot核心依赖:1. 以父项目形式依赖<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.1.RELEASE<...原创 2018-12-23 13:12:38 · 3992 阅读 · 0 评论 -
Eureka注册中心配置,Client配置,高可用配置中心配置
Eureka注册中心server: port: 10081# 禁止注册中心将自己注册为clienteureka: instance: hostname: sky.brozen.top client: # 是否将自己注册到注册中心 register-with-eureka: false # 是否需要检索服务注册信息 fetch-reg...原创 2018-12-22 22:46:58 · 1846 阅读 · 0 评论 -
设置自己的SpringBoot自动配置
声明在META-INF/spring.factories中的自动配置,只要spring.factories文件被扫描到,声明的配置类都会被配置,不论配置类上是否有@Configuration注解(但是方法上必须有@Bean注解);# spring.factoriesorg.springframework.boot.autoconfigure.EnableAutoConfiguration=...原创 2019-04-17 10:31:22 · 184 阅读 · 0 评论