随笔分类 -  springboot

摘要:@Validated和@Valid区别:Spring validation验证框架对入参实体进行嵌套验证必须在相应属性(字段)加上@Valid而不是@Validated Spring Validation验证框架对参数的验证机制提供了@Validated(Spring's JSR-303规范,是标准 阅读全文
posted @ 2020-12-07 17:08 懒癌 阅读(753) 评论(0) 推荐(0)
摘要:项目开发过程中,经常会使用到异步处理。对于异步处理,我们最先想到的基本是直接在写类,然后继承Thread类或者实现Runnable接口,然后调用start()方法,这样也就达到了异步效果。 在SpringBoot或者Spring中若我们仅仅想使用异步功能,处理一些耗时久,且不是核心的逻辑,使用Spr 阅读全文
posted @ 2020-12-02 16:58 懒癌 阅读(1463) 评论(0) 推荐(0)
摘要:Sentinel: 分布式系统的流量防卫兵 Sentinel 是什么? 随着微服务的流行,服务和服务之间的稳定性变得越来越重要。Sentinel 以流量为切入点,从流量控制、熔断降级、系统负载保护等多个维度保护服务的稳定性。 Sentinel 具有以下特征: 丰富的应用场景:Sentinel 承接了 阅读全文
posted @ 2020-08-04 10:49 懒癌 阅读(266) 评论(0) 推荐(0)
摘要:官网 https://nacos.io/zh-cn/index.html 下载地址 https://github.com/alibaba/nacos/releases 什么是 Nacos Nacos 致力于帮助您发现、配置和管理微服务。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发 阅读全文
posted @ 2020-08-03 15:02 懒癌 阅读(438) 评论(0) 推荐(0)
摘要:关于mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 错误的问题。 原创 2016年05月09日 11:05:18 标签: intellij idea / eclipse 阅读全文
posted @ 2020-07-21 09:42 懒癌 阅读(1199) 评论(0) 推荐(0)
摘要:Spring的ApplicationEvent的使用 Spring 3.0中提供了很多类似*Aware的类,其中ApplicationContextAware接口可以实现我们在初始化bean的时候给bean注入ApplicationConxt(Spring上下文对象)对象。ApplicationCo 阅读全文
posted @ 2019-11-07 10:04 懒癌 阅读(1242) 评论(0) 推荐(0)
摘要:Swagger2 生成 Spring Boot API 文档POM 文件代码支持访问地址Swagger UI注解Swagger 是一个规范和完整的框架,用于生成、描述、调用和可视化 RESTful 风格的 Web 服务。本文主要介绍了在 Spring Boot 添加 Swagger 支持, 生成可自 阅读全文
posted @ 2019-11-07 10:03 懒癌 阅读(675) 评论(0) 推荐(0)
摘要:swagger常用注解说明 Xiangdong_She 关注2017.03.16 17:25* 字数 505 阅读 20849评论 13喜欢 15赞赏 1常用到的注解有:ApiApiModelApiModelPropertyApiOperationApiParamApiResponseApiResp 阅读全文
posted @ 2019-11-07 10:02 懒癌 阅读(158) 评论(0) 推荐(0)
摘要:1.修改properties(spring默认的)数据源的前缀 新增中台数据2编写数据源上下文mport java.util.List;public class DataSourceContextHolder { private static final ThreadLocal<String> co 阅读全文
posted @ 2019-11-07 09:55 懒癌 阅读(2799) 评论(0) 推荐(0)
摘要:idea Spring-boot三种启动方式由于新建的Spring-Boot项目启动会报 Whitelabel Error Page ,所以我新建一个Test类 url接口为 /hello ,GET请求方式第一种启动方式: 这个启动方式相当于我们用的Main 启动一样第二种启动方式: 进入 cmd 阅读全文
posted @ 2019-11-07 09:37 懒癌 阅读(5388) 评论(0) 推荐(0)