摘要: pom ribbon的依赖是包含在eureka-client中的 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependenc 阅读全文
posted @ 2020-10-09 19:47 刃牙 阅读(117) 评论(0) 推荐(0) 编辑
摘要: pom <dependencies> <!-- eureka-client --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-cl 阅读全文
posted @ 2020-10-09 19:43 刃牙 阅读(108) 评论(0) 推荐(0) 编辑
摘要: eureka实战 编写pom文件 加入eureka依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifact 阅读全文
posted @ 2020-10-09 19:41 刃牙 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 使用场景 我们在编写代码时候,可能需要给前端一个相对统一的格式,所以经常用一个Result类来封装结果。 @GetMapping("result") public Result get1() { return Result.success(new Person("tom")); } 采用以下方式处理 阅读全文
posted @ 2020-10-09 19:33 刃牙 阅读(891) 评论(0) 推荐(0) 编辑
摘要: 监听器 spring内置事件 spring中有个ApplicationEvent的抽象类,spring中内置的事件都是ApplicationEvent的子类 常用事件 ContextRefreshedEvent spring容器刷新后的事件 ApplicationReadyEvent spring 阅读全文
posted @ 2020-10-09 19:23 刃牙 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 开源技术 微服务条目 落地技术 服务开发 SpringBoot,Spring,SpringMVC 服务配置于管理 Netflix公司的Archaius,阿里的Diamond等 服务注册于发现 Eureka,Consul,Zookeeper 服务调用 Rest,RPC,gRPC 服务熔断 Hystri 阅读全文
posted @ 2020-10-04 10:52 刃牙 阅读(346) 评论(0) 推荐(0) 编辑
摘要: spring ioc ioc执行流程 核心过程 将相关资源加载到Environment 通过BeanDefinitionReader从Environment转换为BeanDefinition,并组册到map中 创建BeanFactory后,执行自定义的BeanFactoryProcessor 阅读全文
posted @ 2020-10-04 10:43 刃牙 阅读(146) 评论(0) 推荐(0) 编辑
摘要: PageHelper 通过pagehelper实现方便分页 依赖和配置 通过以下三个依赖和配置,就可以自动和springboot整合 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artif 阅读全文
posted @ 2020-09-27 18:38 刃牙 阅读(132) 评论(0) 推荐(0) 编辑
摘要: mybatis_generator 导入依赖 作为插件的方式导入 <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1. 阅读全文
posted @ 2020-09-27 18:20 刃牙 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 观察者模式 一般我们理解的观察者是,一个观察者一直主动去观察被观察者,但是程序里的观察者和这种真正的【观察】略有不同,观察者不需要时刻盯着被观察者(例如A不需要每隔1ms就检查一次B的状态),二是采用注册(Register)或者成为订阅(Subscribe)的方式告诉被观察者:我需要你的某某状态,你 阅读全文
posted @ 2020-09-25 18:28 刃牙 阅读(116) 评论(0) 推荐(0) 编辑