11 2023 档案

摘要:DockerCompose 通过一个单独的 docker-compose.yml 模板文件(yaml 格式)来定义一组相关联的应用容器,帮助我们实现多个相互关联的 Docker 容器的快速部署 阅读全文
posted @ 2023-11-29 22:27 1stzz1 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-28 09:09 1stzz1 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-23 20:48 1stzz1 阅读(2) 评论(0) 推荐(0) 编辑
摘要:cors:浏览器询问服务器(浏览器给服务器发送 options 请求),让不让跨域 阅读全文
posted @ 2023-11-23 12:06 1stzz1 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-23 11:48 1stzz1 阅读(3) 评论(0) 推荐(0) 编辑
摘要:代码步骤: ① 网关模块里 创建一个类并实现 GlobalFilter 接口 @Order(-1) //值越小,优先级越高。也可以实现Ordered接口指定优先级@Component //注入到 Spring 容器public class AuthorizeFilter implements Glo 阅读全文
posted @ 2023-11-22 22:30 1stzz1 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-22 22:00 1stzz1 阅读(6) 评论(0) 推荐(0) 编辑
摘要:路由断言工厂 Route Predicate Factory 我们在配置文件中写的断言规则只是字符串,这些字符串会被 Predicate Factory 读取并处理,转变为路由判断的条件 阅读全文
posted @ 2023-11-22 21:33 1stzz1 阅读(9) 评论(0) 推荐(0) 编辑
摘要:网关本身也是微服务,也需要把自己注册到 Nacos 或从 Nacos 中拉取服务 一个服务要想启动,得需要main函数,所以弄一个application: 这些配置是让网关能够联系上 Nacos,实现网关服务的注册,以及服务发现 然后是路由配置: server: port: 10010spring: 阅读全文
posted @ 2023-11-22 21:02 1stzz1 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-22 20:07 1stzz1 阅读(4) 评论(0) 推荐(0) 编辑
摘要:代码示例: ① 创建一个名为 feign-api 的模块,引入 feign 的 starter 依赖 ② 将 order-service 中编写的 UserClient、User 都剪切到 feign-api 模块中 ③ 在 order-service 中引入 feign-api 模块的依赖 ④ 修 阅读全文
posted @ 2023-11-17 21:46 1stzz1 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-17 17:59 1stzz1 阅读(6) 评论(0) 推荐(0) 编辑
摘要:Feign 是一个声明式的 http 客户端,作用是帮我们实现 http 请求的发送,替换掉之前的 restTemplate Feign 不仅可以实现远程调用,还可以自动帮我们负载均衡,因为 Feign 内部集成了负载均衡的功能 阅读全文
posted @ 2023-11-17 17:45 1stzz1 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-17 17:11 1stzz1 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-17 16:37 1stzz1 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-17 15:58 1stzz1 阅读(14) 评论(0) 推荐(0) 编辑
摘要:①win + R 进入cmd ②d: ③cd D:\Nacos\bin ④startup.cmd -m standalone 阅读全文
posted @ 2023-11-16 21:17 1stzz1 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-16 20:35 1stzz1 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-16 18:45 1stzz1 阅读(5) 评论(0) 推荐(0) 编辑
摘要:代码示例: 1. 修改service层代码: @Servicepublic class OrderService { @Autowired private OrderMapper orderMapper; @Autowired private RestTemplate restTemplate; p 阅读全文
posted @ 2023-11-16 18:34 1stzz1 阅读(13) 评论(0) 推荐(0) 编辑
摘要:代码示例: usersvice: orderservice: 阅读全文
posted @ 2023-11-16 18:22 1stzz1 阅读(23) 评论(0) 推荐(0) 编辑
摘要:代码示例: 启动类: @SpringBootApplication@EnableEurekaServer //自动装配的开关public class EurekaApplication { public static void main(String[] args) { SpringApplicat 阅读全文
posted @ 2023-11-16 17:56 1stzz1 阅读(13) 评论(0) 推荐(0) 编辑
摘要:1. 注册 RestTemplate 对象到 Spring 容器中(Bean 的注入只能放在配置类里,而启动类本身就是配置类) @SpringBootApplicationpublic class OrderServiceApplication { public static void main(S 阅读全文
posted @ 2023-11-16 16:26 1stzz1 阅读(104) 评论(0) 推荐(0) 编辑
摘要:@Data → 等于 getter + setter + tostring + hashCode + equals(没有构造方法) @NoArgsConstructor → 无参构造 @AllArgsConstructor → 有参构造 阅读全文
posted @ 2023-11-09 20:15 1stzz1 阅读(7) 评论(0) 推荐(0) 编辑
摘要:@Mapper public interface DeptMapper { Dept getById(Integer id); } 问:这段代码是把这个接口注入到spring的bean容器当中去了,但是spring的bean容器不是存的实例化对象吗? 答: 在Spring框架中,将一个类(或接口)注 阅读全文
posted @ 2023-11-09 19:55 1stzz1 阅读(75) 评论(0) 推荐(0) 编辑
摘要:SpringBoot 内嵌 Tomcat 工作原理是 将 Tomcat 服务器作为对象运行,并将该对象交给 Spring 容器管理 变更内嵌服务器思想是去除现有服务器,添加全新的服务器 阅读全文
posted @ 2023-11-08 21:38 1stzz1 阅读(17) 评论(0) 推荐(0) 编辑
摘要:SpringBoot 工程提供引导类用来启动程序,SpringBoot 工程启动后创建并初始化 Spring 容器 package com.itheima;import org.springframework.boot.SpringApplication;import org.springframe 阅读全文
posted @ 2023-11-08 21:23 1stzz1 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-11-08 20:19 1stzz1 阅读(12) 评论(0) 推荐(0) 编辑
摘要:运行SpringBoot程序通过运行Application程序入口进行 要想保证SpringBoot程序运行起来,主要需要俩文件: 1. pom.xml 2. Application类 @SpringBootApplicationpublic class Springboot01Applicatio 阅读全文
posted @ 2023-11-08 20:16 1stzz1 阅读(11) 评论(0) 推荐(0) 编辑
摘要:@Repository 在Dao层类上使用 @Service 在Service层类上使用 @Controller 在Web层类上使用 阅读全文
posted @ 2023-11-03 22:33 1stzz1 阅读(6) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示