摘要: pom <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org. 阅读全文
posted @ 2020-10-09 19:50 刃牙 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑