diff --git a/apps/vscode/java/assets/image-20230524161111146-1684915873721-1.png b/apps/vscode/java/assets/image-20230524161111146-1684915873721-1.png new file mode 100644 index 0000000..5bb9908 Binary files /dev/null and b/apps/vscode/java/assets/image-20230524161111146-1684915873721-1.png differ diff --git a/apps/vscode/java/assets/image-20230524161111146.png b/apps/vscode/java/assets/image-20230524161111146.png new file mode 100644 index 0000000..5bb9908 Binary files /dev/null and b/apps/vscode/java/assets/image-20230524161111146.png differ diff --git a/apps/vscode/java/assets/image-20230524161135118.png b/apps/vscode/java/assets/image-20230524161135118.png new file mode 100644 index 0000000..79da614 Binary files /dev/null and b/apps/vscode/java/assets/image-20230524161135118.png differ diff --git a/apps/vscode/java/assets/image-20230524161335785-1684916019139-3.png b/apps/vscode/java/assets/image-20230524161335785-1684916019139-3.png new file mode 100644 index 0000000..278ae06 Binary files /dev/null and b/apps/vscode/java/assets/image-20230524161335785-1684916019139-3.png differ diff --git a/apps/vscode/java/assets/image-20230524161335785.png b/apps/vscode/java/assets/image-20230524161335785.png new file mode 100644 index 0000000..278ae06 Binary files /dev/null and b/apps/vscode/java/assets/image-20230524161335785.png differ diff --git a/apps/vscode/java/assets/image-20230524161552986.png b/apps/vscode/java/assets/image-20230524161552986.png new file mode 100644 index 0000000..f1ab279 Binary files /dev/null and b/apps/vscode/java/assets/image-20230524161552986.png differ diff --git a/apps/vscode/java/assets/image-20230524161857948.png b/apps/vscode/java/assets/image-20230524161857948.png new file mode 100644 index 0000000..faf519f Binary files /dev/null and b/apps/vscode/java/assets/image-20230524161857948.png differ diff --git a/apps/vscode/java/vscode 开发JavaSpringBoot项目.md b/apps/vscode/java/vscode 开发JavaSpringBoot项目.md new file mode 100644 index 0000000..c0bf4f6 --- /dev/null +++ b/apps/vscode/java/vscode 开发JavaSpringBoot项目.md @@ -0,0 +1,53 @@ +# vscode 开发Java SpringBoot项目 + +**背景** + +因为公司电脑配置不高、所以想着能不能使用vscode来进行开发,经过我的一番摸索,成功实现了使用vscode来开发SpringBoot项目 + +**前置准备** + +自行百度安装jdk和maven + +**插件安装** + +安装`Java Extension Pack` 和 `Spring Boot Extension Pack + +这两个插件会以来很多其他扩展包所以安装时间会久一些,需要耐心等待一下 + +![image-20230524161135118](./assets/image-20230524161135118.png) + +![image-20230524161111146](./assets/image-20230524161111146-1684915873721-1.png) + +**配置JDK和Maven** + +首先安装 JDK、Maven,然后打开`设置`,搜索`maven`,点击`在settings.json中编辑`,如下图: + +![image-20230524161335785](./assets/image-20230524161335785-1684916019139-3.png) +添加如下配置,主要是 JDK 和 Maven 相关的配置。 + +```json +{ + "java.jdt.ls.java.home": "F:\\apps\\Scoop\\apps\\openjdk17\\current", + "java.configuration.maven.userSettings": "F:\\apps\\Scoop\\apps\\maven\\current\\conf\\settings.xml", + "maven.executable.path": "F:\\apps\\Scoop\\apps\\maven\\current\\bin\\mvn.cmd", + "maven.terminal.useJavaHome": true, + "maven.terminal.customEnv": [ + { + "environmentVariable": "JAVA_HOME", + "value": "F:\\apps\\Scoop\\apps\\maven\\current\\conf\\settings.xml" + } + ], +} +``` + +效果如下 + +![image-20230524161552986](./assets/image-20230524161552986.png) + +**运行项目** + +将项目添加到工作空间,找到启动类右键运行即可。 + +打开项目点击文件->打开文件夹 选择打开的项目即可 + +![image-20230524161857948](./assets/image-20230524161857948.png) \ No newline at end of file diff --git a/java/spring/aop/aop/AOP动态代理规则.md b/java/spring/aop/aop/AOP动态代理规则.md new file mode 100644 index 0000000..c8d060b --- /dev/null +++ b/java/spring/aop/aop/AOP动态代理规则.md @@ -0,0 +1,23 @@ +# AOP动态代理规则 + +## 1.AOP的实现方式 + +AOP有两种实现方式、一种是使用的JDK动态代理、一种是CGLIB动态代理 + +## 2.开启动态代理的方式 + +2.1 Spring项目 + +在Spring项目的xml配置文件中添加``开启动态代理 + +2.2 SpringBoot项目 + +直接在启动类上添加`@EnableAspectJAutoProxy`注解 + +## 3.指定使用那种动态代理 + +不管是xml的标签还是注解都有一个属性`proxy-target-class`这个属性默认是false,在这种情况下当一个类有接口的时候,那么spring默认使用的是JDK动态代理,如果当前类没有接口的时候,那么spring会默认使用CGLIB动态代理,如果一个类有接口的时候,还想要使用CGLIB动态代理,修改`proxy-target-class`属性为`true` + +xml:` ` + +注解:`@EnableAspectJAutoProxy(proxyTargetClass = true)` \ No newline at end of file