diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..887c073b9fef280946ac9b5078c3ee9a6e98e376 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "李孟坤I(模块9作业)/code/dubbo-resource/dubbo"] + path = 李孟坤I(模块9作业)/code/dubbo-resource/dubbo + url = https://github.com/apache/dubbo.git diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/compiler.xml" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/compiler.xml" new file mode 100644 index 0000000000000000000000000000000000000000..6836d451cb7f60b7d365a63d5f5560ccbe7850b0 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/compiler.xml" @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/encodings.xml" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/encodings.xml" new file mode 100644 index 0000000000000000000000000000000000000000..63e900193296f8ed911a1b9f5b051cf908099431 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/encodings.xml" @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/misc.xml" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/misc.xml" new file mode 100644 index 0000000000000000000000000000000000000000..32d5f87c3b608ba34a14c1ef0c3102054ce3f12e --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/misc.xml" @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/uiDesigner.xml" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/uiDesigner.xml" new file mode 100644 index 0000000000000000000000000000000000000000..e96534fb27b68192f27f985d3879e173ec77adb8 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/uiDesigner.xml" @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/workspace.xml" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/workspace.xml" new file mode 100644 index 0000000000000000000000000000000000000000..a6bde235db725bdbaeedf44e14424252c18dabfa --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/.idea/workspace.xml" @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1621754137897 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/src/main/java/com/zimu/controller/MyController.java + 12 + + + file://$PROJECT_DIR$/src/main/java/com/zimu/config/MyWebApplicationInitializer.java + 19 + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/myspringboot.iml" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/myspringboot.iml" new file mode 100644 index 0000000000000000000000000000000000000000..78b2cc53b203f0b97534bb1184cdc7b474339fb4 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/myspringboot.iml" @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/pom.xml" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/pom.xml" new file mode 100644 index 0000000000000000000000000000000000000000..08c3f3a56e30b6d5ed1c695d1929ddbce51e73e2 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/pom.xml" @@ -0,0 +1,59 @@ + + + + 4.0.0 + + com.zimu + myspringboot + 1.0-SNAPSHOT + war + + myspringboot Maven Webapp + + http://www.example.com + + + UTF-8 + 1.8 + 1.8 + + + + + org.springframework + spring-web + 5.0.8.RELEASE + + + org.apache.tomcat.embed + tomcat-embed-core + 8.5.32 + + + org.springframework + spring-context + 5.0.8.RELEASE + + + org.springframework + spring-webmvc + 5.0.8.RELEASE + + + junit + junit + 4.11 + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/SpringApplication.java" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/SpringApplication.java" new file mode 100644 index 0000000000000000000000000000000000000000..be97319e6150ca8adab453663c99f056ef0b1054 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/SpringApplication.java" @@ -0,0 +1,31 @@ +package com.zimu; + +import org.apache.catalina.LifecycleException; +import org.apache.catalina.startup.Tomcat; + +import javax.servlet.ServletException; +import javax.swing.*; + +/** + * Created by 梓沐 on 2021/5/23. + */ +public class SpringApplication { + public static void main(String[] args) { + SpringApplication.run(); + } + + private static void run() { + Tomcat tomcat = new Tomcat(); + tomcat.setPort(8000); + try { + //设置项目文件路径 + tomcat.addWebapp("/","D:\\"); + //启动tomcat + tomcat.start(); + //监听关闭端口。阻塞式,没有这一局。方法执行完会直接结束 + tomcat.getServer().await(); + }catch (LifecycleException | ServletException e){ + e.printStackTrace(); + } + } +} diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/config/AppConfig.java" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/config/AppConfig.java" new file mode 100644 index 0000000000000000000000000000000000000000..d9d842291f9580e1bd371656bdab37cc536375ba --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/config/AppConfig.java" @@ -0,0 +1,14 @@ +package com.zimu.config; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +/** + * Created by 梓沐 on 2021/5/23. + */ +@Configuration +@ComponentScan("com.zimu") +public class AppConfig { + + +} diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/config/MyWebApplicationInitializer.java" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/config/MyWebApplicationInitializer.java" new file mode 100644 index 0000000000000000000000000000000000000000..b3e635092e7ec7bd81aecc2e15d5908decd93cb4 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/config/MyWebApplicationInitializer.java" @@ -0,0 +1,28 @@ +package com.zimu.config; + +import org.springframework.web.WebApplicationInitializer; +import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; +import org.springframework.web.servlet.DispatcherServlet; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRegistration; + +/** + * Created by 梓沐 on 2021/5/23. + */ +//SpringServletContainerInitializer在Servlet启动的时候,会自动探测WebApplicationInitializer下的实现类并执行对应的onStartup方法 +public class MyWebApplicationInitializer implements WebApplicationInitializer { + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + System.out.println("调用MyWebApplicationInitializer了"); + //通过注解的方式初始化spring的上下文 + AnnotationConfigWebApplicationContext annotationConfigWebApplicationContext = new AnnotationConfigWebApplicationContext(); + annotationConfigWebApplicationContext.register(AppConfig.class); + annotationConfigWebApplicationContext.refresh(); + DispatcherServlet dispatcherServlet = new DispatcherServlet(annotationConfigWebApplicationContext); + ServletRegistration.Dynamic registration = servletContext.addServlet("/app", dispatcherServlet); + registration.setLoadOnStartup(1); + registration.addMapping("/app/*"); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/controller/MyController.java" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/controller/MyController.java" new file mode 100644 index 0000000000000000000000000000000000000000..5822e277c4f2454afb10ba843a7b230d6d14ac94 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/src/main/java/com/zimu/controller/MyController.java" @@ -0,0 +1,16 @@ +package com.zimu.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by 梓沐 on 2021/5/23. + */ +@RestController +public class MyController { + @RequestMapping("/test") + public String testHandler(){ + System.out.println("test"); + return "test"; + } +} diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/SpringApplication.class" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/SpringApplication.class" new file mode 100644 index 0000000000000000000000000000000000000000..d4c92a27e83cab1b9be63cd6d5f0bc57b6b0a4f3 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/SpringApplication.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/config/AppConfig.class" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/config/AppConfig.class" new file mode 100644 index 0000000000000000000000000000000000000000..b134ba6605d4930f8c6d5e2b95057229752c501c Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/config/AppConfig.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/config/MyWebApplicationInitializer.class" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/config/MyWebApplicationInitializer.class" new file mode 100644 index 0000000000000000000000000000000000000000..e786c65b94e489ed02d9f00064b12ef9d5a3b0a5 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/config/MyWebApplicationInitializer.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/controller/MyController.class" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/controller/MyController.class" new file mode 100644 index 0000000000000000000000000000000000000000..7274ea0eed489a14d93eafe31d8d0c55d5d88893 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/myspringboot/target/classes/com/zimu/controller/MyController.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/20210523_165943.mp4" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/20210523_165943.mp4" new file mode 100644 index 0000000000000000000000000000000000000000..075074da5c1c00935b6f3ca6ee6dc79a97a7c810 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/20210523_165943.mp4" differ diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/SpringBoot.pdf" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/SpringBoot.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..02d93ae7df1e5a21a9b7511184b6536dd07bf67e Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/SpringBoot.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/SpringBoot\346\272\220\347\240\201\345\210\206\346\236\220.pdf" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/SpringBoot\346\272\220\347\240\201\345\210\206\346\236\220.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..cc51da7a77eb34de35cf6590936810eaa0c3b9ef Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/SpringBoot\346\272\220\347\240\201\345\210\206\346\236\220.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/SpringBoot\351\203\250\347\275\262\344\270\216\347\233\221\346\216\247.pdf" "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/SpringBoot\351\203\250\347\275\262\344\270\216\347\233\221\346\216\247.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..e59fddfb3f0622ff1449b454f6c57351da544e6b Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/SpringBoot\351\203\250\347\275\262\344\270\216\347\233\221\346\216\247.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.gitignore" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.gitignore" new file mode 100644 index 0000000000000000000000000000000000000000..549e00a2a96fa9d7c5dbc9859664a78d980158c2 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.gitignore" @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.mvn/wrapper/MavenWrapperDownloader.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.mvn/wrapper/MavenWrapperDownloader.java" new file mode 100644 index 0000000000000000000000000000000000000000..a45eb6ba269cd38f8965cef786729790945d9537 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.mvn/wrapper/MavenWrapperDownloader.java" @@ -0,0 +1,118 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if (mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if (mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.mvn/wrapper/maven-wrapper.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.mvn/wrapper/maven-wrapper.jar" new file mode 100644 index 0000000000000000000000000000000000000000..2cc7d4a55c0cd0092912bf49ae38b3a9e3fd0054 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.mvn/wrapper/maven-wrapper.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.mvn/wrapper/maven-wrapper.properties" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.mvn/wrapper/maven-wrapper.properties" new file mode 100644 index 0000000000000000000000000000000000000000..ffdc10e59f87823d5abb635aa2e37bf281698e83 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/.mvn/wrapper/maven-wrapper.properties" @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/mvnw" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/mvnw" new file mode 100644 index 0000000000000000000000000000000000000000..a16b5431b4c3cab50323a3f558003fd0abd87dad --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/mvnw" @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/mvnw.cmd" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/mvnw.cmd" new file mode 100644 index 0000000000000000000000000000000000000000..c8d43372c986d97911cdc21bd87e0cbe3d83bdda --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/mvnw.cmd" @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/pom.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/pom.xml" new file mode 100644 index 0000000000000000000000000000000000000000..e8d1b3343a5996fff9b242996623f179802c4614 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/pom.xml" @@ -0,0 +1,15 @@ + + + + persist_rpc + com.zimu + 0.0.1-SNAPSHOT + + 4.0.0 + + netty_server + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/handler/NettyServerHandler1.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/handler/NettyServerHandler1.java" new file mode 100644 index 0000000000000000000000000000000000000000..d50590bb8c7c78574cd96cc219479a62f640a120 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/handler/NettyServerHandler1.java" @@ -0,0 +1,84 @@ +package com.zimu.handler; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandler; +import io.netty.util.CharsetUtil; + +/** + * 自定义服务端通道入站handler + * Created by 梓沐 on 2021/6/29. + */ +public class NettyServerHandler1 implements ChannelInboundHandler { + + /** + * 通道读取事件 + * @param channelHandlerContext + * @param o + * @throws Exception + */ + @Override + public void channelRead(ChannelHandlerContext channelHandlerContext, Object o) throws Exception { + ByteBuf byteBuf = (ByteBuf) o; + System.out.println("客户端发来消息" + byteBuf.toString(CharsetUtil.UTF_8)); + + } + + /** + * 读取完毕事件 + * @param channelHandlerContext + * @throws Exception + */ + @Override + public void channelReadComplete(ChannelHandlerContext channelHandlerContext) throws Exception { + channelHandlerContext.writeAndFlush(Unpooled.copiedBuffer("{result:1}", CharsetUtil.UTF_8)); + } + + @Override + public void exceptionCaught(ChannelHandlerContext channelHandlerContext, Throwable throwable) throws Exception { + throwable.printStackTrace(); + channelHandlerContext.close(); + } + + @Override + public void channelRegistered(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void channelUnregistered(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void channelActive(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void channelInactive(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + + @Override + public void userEventTriggered(ChannelHandlerContext channelHandlerContext, Object o) throws Exception { + + } + + @Override + public void channelWritabilityChanged(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void handlerAdded(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void handlerRemoved(ChannelHandlerContext channelHandlerContext) throws Exception { + + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/handler/NettyServerHandler2.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/handler/NettyServerHandler2.java" new file mode 100644 index 0000000000000000000000000000000000000000..247428bbe8b2b5700bb110d462efd09fd99d75ea --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/handler/NettyServerHandler2.java" @@ -0,0 +1,84 @@ +package com.zimu.handler; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandler; +import io.netty.util.CharsetUtil; + +/** + * 自定义服务端通道入站handler + * Created by 梓沐 on 2021/6/29. + */ +public class NettyServerHandler2 implements ChannelInboundHandler { + + /** + * 通道读取事件 + * @param channelHandlerContext + * @param o + * @throws Exception + */ + @Override + public void channelRead(ChannelHandlerContext channelHandlerContext, Object o) throws Exception { + ByteBuf byteBuf = (ByteBuf) o; + System.out.println("客户端发来消息" + byteBuf.toString(CharsetUtil.UTF_8)); + + } + + /** + * 读取完毕事件 + * @param channelHandlerContext + * @throws Exception + */ + @Override + public void channelReadComplete(ChannelHandlerContext channelHandlerContext) throws Exception { + channelHandlerContext.writeAndFlush(Unpooled.copiedBuffer("{result:2}", CharsetUtil.UTF_8)); + } + + @Override + public void exceptionCaught(ChannelHandlerContext channelHandlerContext, Throwable throwable) throws Exception { + throwable.printStackTrace(); + channelHandlerContext.close(); + } + + @Override + public void channelRegistered(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void channelUnregistered(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void channelActive(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void channelInactive(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + + @Override + public void userEventTriggered(ChannelHandlerContext channelHandlerContext, Object o) throws Exception { + + } + + @Override + public void channelWritabilityChanged(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void handlerAdded(ChannelHandlerContext channelHandlerContext) throws Exception { + + } + + @Override + public void handlerRemoved(ChannelHandlerContext channelHandlerContext) throws Exception { + + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/server/NettyServer1.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/server/NettyServer1.java" new file mode 100644 index 0000000000000000000000000000000000000000..fe980149f0a4c2121e77d25d605130a2be0e88d8 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/server/NettyServer1.java" @@ -0,0 +1,63 @@ +package com.zimu.server; + +import com.zimu.handler.NettyServerHandler1; +import com.zimu.handler.NettyServerHandler2; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.*; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.handler.timeout.IdleStateHandler; +import org.I0Itec.zkclient.ZkClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.concurrent.TimeUnit; + +/** + * Netty服务端 + * Created by 梓沐 on 2021/6/29. + */ +public class NettyServer1 { + private ZkClient zkClient; + public static void main(String[] args) throws InterruptedException { + //1. 创建bossGroup线程组: 处理网络事件--连接事件 + EventLoopGroup bossGroup = new NioEventLoopGroup(1); + //2. 创建workerGroup线程组: 处理网络事件--读写事件 + EventLoopGroup workerGroup = new NioEventLoopGroup(); + //3. 创建服务端启动助手 + ServerBootstrap bootstrap = new ServerBootstrap(); + //4. 设置bossGroup线程组和workerGroup线程组 + bootstrap.group(bossGroup,workerGroup) + .channel(NioServerSocketChannel.class) //5. 设置服务端通道实现为NIO + .option(ChannelOption.SO_BACKLOG,128) //6. 参数设置 + .childOption(ChannelOption.SO_KEEPALIVE,Boolean.TRUE) + .childHandler(new ChannelInitializer() { //7. 创建一个通道初始化对象 + @Override + protected void initChannel(SocketChannel socketChannel) throws Exception { + //8. 向pipeline中添加自定义业务处理handler + // 心跳检测 + socketChannel.pipeline().addLast(new IdleStateHandler(0, 0, 9, TimeUnit.SECONDS)); + socketChannel.pipeline().addLast(new NettyServerHandler1()); + } + }); + //9. 启动服务端并绑定端口,同时将异步改为同步 + ChannelFuture future = bootstrap.bind(8888).sync(); + ZkClient zkClient = new ZkClient("106.13.200.230:2182"); + zkClient.createEphemeral("/rpc/server1",8888); + future.addListener(new ChannelFutureListener() { + @Override public void operationComplete(ChannelFuture future) throws Exception { + if (future.isSuccess()) { + System.out.println("端口绑定成功!"); + } else { + System.out.println("端口绑定失败!"); + } + } + }); + System.out.println("Netty服务端已启动"); + //10. 关闭通道和关闭连接池 + future.channel().closeFuture().sync(); + bossGroup.shutdownGracefully(); + workerGroup.shutdownGracefully(); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/server/NettyServer2.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/server/NettyServer2.java" new file mode 100644 index 0000000000000000000000000000000000000000..0dad60c397878aeb28d8066864e332b40dc979f5 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/netty_server/src/main/java/com/zimu/server/NettyServer2.java" @@ -0,0 +1,60 @@ +package com.zimu.server; + +import com.zimu.handler.NettyServerHandler1; +import com.zimu.handler.NettyServerHandler2; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.*; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.handler.timeout.IdleStateHandler; +import org.I0Itec.zkclient.ZkClient; + +import java.util.concurrent.TimeUnit; + +/** + * Netty服务端 + * Created by 梓沐 on 2021/6/29. + */ +public class NettyServer2 { + public static void main(String[] args) throws InterruptedException { + //1. 创建bossGroup线程组: 处理网络事件--连接事件 + EventLoopGroup bossGroup = new NioEventLoopGroup(1); + //2. 创建workerGroup线程组: 处理网络事件--读写事件 + EventLoopGroup workerGroup = new NioEventLoopGroup(); + //3. 创建服务端启动助手 + ServerBootstrap bootstrap = new ServerBootstrap(); + //4. 设置bossGroup线程组和workerGroup线程组 + bootstrap.group(bossGroup,workerGroup) + .channel(NioServerSocketChannel.class) //5. 设置服务端通道实现为NIO + .option(ChannelOption.SO_BACKLOG,128) //6. 参数设置 + .childOption(ChannelOption.SO_KEEPALIVE,Boolean.TRUE) + .childHandler(new ChannelInitializer() { //7. 创建一个通道初始化对象 + @Override + protected void initChannel(SocketChannel socketChannel) throws Exception { + //8. 向pipeline中添加自定义业务处理handler + // 心跳检测 + socketChannel.pipeline().addLast(new IdleStateHandler(0, 0, 9, TimeUnit.SECONDS)); + socketChannel.pipeline().addLast(new NettyServerHandler2()); + } + }); + //9. 启动服务端并绑定端口,同时将异步改为同步 + ChannelFuture future = bootstrap.bind(8889).sync(); + ZkClient zkClient = new ZkClient("106.13.200.230:2182"); + zkClient.createEphemeral("/rpc/server2",8889); + future.addListener(new ChannelFutureListener() { + @Override public void operationComplete(ChannelFuture future) throws Exception { + if (future.isSuccess()) { + System.out.println("端口绑定成功!"); + } else { + System.out.println("端口绑定失败!"); + } + } + }); + System.out.println("Netty服务端已启动"); + //10. 关闭通道和关闭连接池 + future.channel().closeFuture().sync(); + bossGroup.shutdownGracefully(); + workerGroup.shutdownGracefully(); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/pom.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/pom.xml" new file mode 100644 index 0000000000000000000000000000000000000000..8ed0b9213e78d66b4a4e1f1adf57b78d2bd0f390 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/pom.xml" @@ -0,0 +1,71 @@ + + + 4.0.0 + pom + + rpc_consumer + rpc_conmmon + netty_server + zookeeper_test + zkClient + + + org.springframework.boot + spring-boot-starter-parent + 2.5.4 + + + com.zimu + persist_rpc + 0.0.1-SNAPSHOT + persist_rpc + Demo project for Spring Boot + + 11 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + io.netty + netty-all + + + + com.alibaba + fastjson + 1.2.74 + + + + org.projectlombok + lombok + 1.18.16 + + + com.101tec + zkclient + 0.2 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/pom.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/pom.xml" new file mode 100644 index 0000000000000000000000000000000000000000..6b9991b55748d3b77c788e754280236421d4deed --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/pom.xml" @@ -0,0 +1,15 @@ + + + + persist_rpc + com.zimu + 0.0.1-SNAPSHOT + + 4.0.0 + + rpc_conmmon + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/api/IUserService.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/api/IUserService.java" new file mode 100644 index 0000000000000000000000000000000000000000..335d735f2adb23bb35756f284d513b5f18e6edad --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/api/IUserService.java" @@ -0,0 +1,17 @@ +package conm.zimu.api; + + +import conm.zimu.pojo.User; + +/** + * 用户服务 + */ +public interface IUserService { + /** + * 根据ID查询用户 + * + * @param id + * @return + */ + User getById(int id); +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/conmmon/RpcRequest.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/conmmon/RpcRequest.java" new file mode 100644 index 0000000000000000000000000000000000000000..d6b9cc4dca3480347564198163cfb93eae21efe0 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/conmmon/RpcRequest.java" @@ -0,0 +1,34 @@ +package conm.zimu.conmmon; + +import lombok.Data; + +import java.util.Arrays; + +/** + * 封装的请求对象 + */ +@Data +public class RpcRequest { + + /** + * 请求对象的ID + */ + private String requestId; + /** + * 类名 + */ + private String className; + /** + * 方法名 + */ + private String methodName; + /** + * 参数类型 + */ + private Class[] parameterTypes; + /** + * 入参 + */ + private Object[] parameters; + +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/conmmon/RpcResponse.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/conmmon/RpcResponse.java" new file mode 100644 index 0000000000000000000000000000000000000000..cb4cbaa61098f90d9d0043588b3b7e9631afcd4e --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/conmmon/RpcResponse.java" @@ -0,0 +1,49 @@ +package conm.zimu.conmmon; + +import lombok.Data; + +/** + * 封装的响应对象 + */ +@Data +public class RpcResponse { + + /** + * 响应ID + */ + private String requestId; + + /** + * 错误信息 + */ + private String error; + + /** + * 返回的结果 + */ + private Object result; + + public String getRequestId() { + return requestId; + } + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + + public Object getResult() { + return result; + } + + public void setResult(Object result) { + this.result = result; + } +} \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/pojo/User.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/pojo/User.java" new file mode 100644 index 0000000000000000000000000000000000000000..78feea5a928bbf217297b93693328057c889011a --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_conmmon/src/main/java/conm/zimu/pojo/User.java" @@ -0,0 +1,9 @@ +package conm.zimu.pojo; + +import lombok.Data; + +@Data +public class User { + private int id; + private String name; +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/pom.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/pom.xml" new file mode 100644 index 0000000000000000000000000000000000000000..d7394a499403a281d52b7cac6c7eb1e1edfc220d --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/pom.xml" @@ -0,0 +1,23 @@ + + + + persist_rpc + com.zimu + 0.0.1-SNAPSHOT + + 4.0.0 + + rpc_consumer + + + com.zimu + rpc_conmmon + 0.0.1-SNAPSHOT + compile + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/PersistRpcApplication.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/PersistRpcApplication.java" new file mode 100644 index 0000000000000000000000000000000000000000..b3f732f812bf4920bd2bb368109b170178583762 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/PersistRpcApplication.java" @@ -0,0 +1,18 @@ +package com.zimu; + +import com.zimu.proxy.RpcClientProxy; +import com.zimu.zkClient.ZkClient; +import conm.zimu.api.IUserService; +import conm.zimu.pojo.User; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class PersistRpcApplication{ + + public static void main(String[] args) { + SpringApplication.run(PersistRpcApplication.class, args); + ZkClient.watcher(); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/client/RpcClient.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/client/RpcClient.java" new file mode 100644 index 0000000000000000000000000000000000000000..dad21d73b1ef3b7aa0f2712d52cfacc9246dfdea --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/client/RpcClient.java" @@ -0,0 +1,101 @@ +package com.zimu.client; + +import com.zimu.handler.RpcClientHandler; +import io.netty.bootstrap.Bootstrap; +import io.netty.channel.*; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.handler.codec.string.StringDecoder; +import io.netty.handler.codec.string.StringEncoder; +import io.netty.handler.timeout.IdleStateHandler; + +import java.util.concurrent.*; + +/** + * 客户端 + * 1.连接Netty服务端 + * 2.提供给调用者主动关闭资源的方法 + * 3.提供消息发送的方法 + */ +public class RpcClient { + + private EventLoopGroup group; + + private Channel channel; + + private String ip; + + private int port; + + private RpcClientHandler rpcClientHandler = new RpcClientHandler(); + + private ExecutorService executorService = Executors.newCachedThreadPool(); + + public RpcClient(String ip, int port) { + this.ip = ip; + this.port = port; + initClient(); + } + + /** + * 初始化方法-连接Netty服务端 + */ + public void initClient() { + try { + //1.创建线程组 + group = new NioEventLoopGroup(); + //2.创建启动助手 + Bootstrap bootstrap = new Bootstrap(); + //3.设置参数 + bootstrap.group(group) + .channel(NioSocketChannel.class) + .option(ChannelOption.SO_KEEPALIVE, Boolean.TRUE) + .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 3000) + .handler(new ChannelInitializer() { + @Override + protected void initChannel(SocketChannel channel) throws Exception { + ChannelPipeline pipeline = channel.pipeline(); + // 心跳检测 + pipeline.addLast(new IdleStateHandler(0, 0, 3, TimeUnit.SECONDS)); + //String类型编解码器 + pipeline.addLast(new StringDecoder()); + pipeline.addLast(new StringEncoder()); + //添加客户端处理类 + pipeline.addLast(rpcClientHandler); + } + }); + //4.连接Netty服务端 + channel = bootstrap.connect(ip, port).sync().channel(); + } catch (Exception exception) { + exception.printStackTrace(); + if (channel != null) { + channel.close(); + } + if (group != null) { + group.shutdownGracefully(); + } + } + } + + /** + * 提供给调用者主动关闭资源的方法 + */ + public void close() { + if (channel != null) { + channel.close(); + } + if (group != null) { + group.shutdownGracefully(); + } + } + + /** + * 提供消息发送的方法 + */ + public Object send(String msg) throws ExecutionException, InterruptedException { + rpcClientHandler.setRequestMsg(msg); + Future submit = executorService.submit(rpcClientHandler); + return submit.get(); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/controller/UserController.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/controller/UserController.java" new file mode 100644 index 0000000000000000000000000000000000000000..44e2b43d4a8e6281f126429a3d02d33fb46ca3a6 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/controller/UserController.java" @@ -0,0 +1,25 @@ +package com.zimu.controller; + +import com.zimu.proxy.RpcClientProxy; +import conm.zimu.api.IUserService; +import conm.zimu.pojo.User; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created by 梓沐 on 2021/8/22. + */ +@RestController +@RequestMapping("/rpc") +public class UserController { + @Autowired + private RpcClientProxy rpcClientProxy; + @RequestMapping("/getUserById") + public User getUserById(Integer id){ + IUserService userService = (IUserService) rpcClientProxy.createProxy(IUserService.class); + System.out.println(userService.getById(1)); + return userService.getById(1); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/handler/RpcClientHandler.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/handler/RpcClientHandler.java" new file mode 100644 index 0000000000000000000000000000000000000000..61c8646c8a400aee7fa73c590b64064dca3ecfd1 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/handler/RpcClientHandler.java" @@ -0,0 +1,65 @@ +package com.zimu.handler; + +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; + +import java.util.concurrent.Callable; + +/** + * 客户端处理类 + * 1.发送消息 + * 2.接收消息 + */ +public class RpcClientHandler extends SimpleChannelInboundHandler implements Callable { + + ChannelHandlerContext context; + //发送的消息 + String requestMsg; + + //服务端的消息 + String responseMsg; + + public void setRequestMsg(String requestMsg) { + this.requestMsg = requestMsg; + } + + /** + * 通道连接就绪事件 + * + * @param ctx + * @throws Exception + */ + @Override + public void channelActive(ChannelHandlerContext ctx) throws Exception { + context = ctx; + } + + /** + * 通道读取就绪事件 + * + * @param channelHandlerContext + * @param msg + * @throws Exception + */ + @Override + protected synchronized void channelRead0(ChannelHandlerContext channelHandlerContext, String msg) throws Exception { + responseMsg = msg; + //唤醒等待的线程 + notify(); + } + + /** + * 发送消息到服务端 + * + * @return + * @throws Exception + */ + @Override + public synchronized Object call() throws Exception { + //消息发送 + context.writeAndFlush(requestMsg); + //线程等待 + wait(); + return responseMsg; + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/proxy/RpcClientProxy.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/proxy/RpcClientProxy.java" new file mode 100644 index 0000000000000000000000000000000000000000..93336770b5aff1c7199cd6ebde2b550fbb4146b0 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/proxy/RpcClientProxy.java" @@ -0,0 +1,65 @@ +package com.zimu.proxy; + +import com.alibaba.fastjson.JSON; +import com.zimu.client.RpcClient; +import com.zimu.zkClient.ZkClient; +import conm.zimu.conmmon.RpcRequest; +import conm.zimu.conmmon.RpcResponse; +import org.I0Itec.zkclient.IZkChildListener; +import org.springframework.stereotype.Component; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.util.List; +import java.util.UUID; + + + + +/** + * 客户端代理类-创建代理对象 + * 1.封装request请求对象 + * 2.创建RpcClient对象 + * 3.发送消息 + * 4.返回结果 + */ +@Component +public class RpcClientProxy { + public static Object createProxy(Class serviceClass) { + return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), + new Class[]{serviceClass}, new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + //1.封装request请求对象 + RpcRequest rpcRequest = new RpcRequest(); + rpcRequest.setRequestId(UUID.randomUUID().toString()); + rpcRequest.setClassName(method.getDeclaringClass().getName()); + rpcRequest.setMethodName(method.getName()); + rpcRequest.setParameterTypes(method.getParameterTypes()); + rpcRequest.setParameters(args); + //2.创建RpcClient对象 + for (Integer value : ZkClient.ports.values()) { + RpcClient rpcClient = new RpcClient("127.0.0.1", value); + try { + //3.发送消息 + Object responseMsg = rpcClient.send(JSON.toJSONString(rpcRequest)); + RpcResponse rpcResponse = JSON.parseObject(responseMsg.toString(), RpcResponse.class); + if (rpcResponse.getError() != null) { + throw new RuntimeException(rpcResponse.getError()); + } + //4.返回结果 + Object result = rpcResponse.getResult(); + String name = "{name:" + result + "}"; + return JSON.parseObject(name, method.getReturnType()); + } catch (Exception e) { + throw e; + } finally { + rpcClient.close(); + } + } + return null; + } + }); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/zkClient/ZkClient.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/zkClient/ZkClient.java" new file mode 100644 index 0000000000000000000000000000000000000000..35d76f26e2bb3b147bb54a52842f0b0274cbd989 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/java/com/zimu/zkClient/ZkClient.java" @@ -0,0 +1,35 @@ +package com.zimu.zkClient; + +import org.I0Itec.zkclient.IZkChildListener; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +/** + * Created by 梓沐 on 2021/8/23. + */ +public class ZkClient{ + public static HashMap ports = new HashMap<>(); + public static void watcher(){ + org.I0Itec.zkclient.ZkClient zkClient = new org.I0Itec.zkclient.ZkClient("106.13.200.230:2182"); + List children = zkClient.getChildren("/rpc"); + for (String child : children) { + ports.put(child,Integer.valueOf(zkClient.readData("/rpc/" + child))); + } + zkClient.subscribeChildChanges("/rpc", new IZkChildListener() { + public void handleChildChange(String parentPath, List + currentChilds) throws Exception { + List children1 = zkClient.getChildren(parentPath); + if(children1.size() > 0){ + ports.clear(); + for (String s : children1) { + ports.put(s,Integer.valueOf(zkClient.readData("/rpc/" + s))); + } + } + + } + }); + } +} + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/resources/application.properties" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/resources/application.properties" new file mode 100644 index 0000000000000000000000000000000000000000..8d51d0c619c284847b0f15a0d444c7b5c3925d9a --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/rpc_consumer/src/main/resources/application.properties" @@ -0,0 +1 @@ +server.port=8082 \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/zkClient/pom.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/zkClient/pom.xml" new file mode 100644 index 0000000000000000000000000000000000000000..88e9b2259d6de5c835aefff1d436b5ded4de9059 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/zkClient/pom.xml" @@ -0,0 +1,15 @@ + + + + persist_rpc + com.zimu + 0.0.1-SNAPSHOT + + 4.0.0 + + zkClient + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/zkClient/src/main/java/com/zimu/zkClient/ZkClientApplication.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/zkClient/src/main/java/com/zimu/zkClient/ZkClientApplication.java" new file mode 100644 index 0000000000000000000000000000000000000000..cbb4966f06eb05b139ad889944252afe10c93199 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/persist_Myrpc/zkClient/src/main/java/com/zimu/zkClient/ZkClientApplication.java" @@ -0,0 +1,17 @@ +package com.zimu.zkClient; + +import org.I0Itec.zkclient.ZkClient; + +import java.util.List; + +/** + * Created by 梓沐 on 2021/8/23. + */ +public class ZkClientApplication { + public static void main(String[] args) { + ZkClient zkClient = new ZkClient("106.13.200.230:2182"); +// zkClient.createPersistent("/rpc"); + List children = zkClient.getChildren("/rpc"); + System.out.println(children); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/compiler.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/compiler.xml" new file mode 100644 index 0000000000000000000000000000000000000000..31a0f757f73faf2c9da45d64a9e00aebbda7ed11 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/compiler.xml" @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/encodings.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/encodings.xml" new file mode 100644 index 0000000000000000000000000000000000000000..aa00ffab7828f4818589659c804ec2cfd99baed3 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/encodings.xml" @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/misc.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/misc.xml" new file mode 100644 index 0000000000000000000000000000000000000000..32d5f87c3b608ba34a14c1ef0c3102054ce3f12e --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/misc.xml" @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/workspace.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/workspace.xml" new file mode 100644 index 0000000000000000000000000000000000000000..9b9e9e7fbf3b5394716ff9541922186b74389a3e --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/.idea/workspace.xml" @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1628687908587 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/pom.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/pom.xml" new file mode 100644 index 0000000000000000000000000000000000000000..161c55c523c6a08ed17ab0c2406783cd46fa4557 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/pom.xml" @@ -0,0 +1,82 @@ + + + + 4.0.0 + + com.zimu + zookeeper-api + 1.0-SNAPSHOT + war + + zookeeper-api Maven Webapp + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + org.apache.zookeeper + zookeeper + 3.4.14 + + + com.101tec + zkclient + 0.2 + + + org.apache.curator + curator-framework + 2.12.0 + + + + + zookeeper-api + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-war-plugin + 3.2.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/java/com/zimu/curayor/Curator_API.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/java/com/zimu/curayor/Curator_API.java" new file mode 100644 index 0000000000000000000000000000000000000000..720dfd1566b260747f1a990f0d74d9ad08223e03 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/java/com/zimu/curayor/Curator_API.java" @@ -0,0 +1,147 @@ +package com.zimu.curayor; + +import org.apache.curator.RetryPolicy; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.retry.ExponentialBackoffRetry; + +/** + * Created by 梓沐 on 2021/8/15. + * + * curator是Netflix公司开源的⼀套Zookeeper客户端框架,和ZKClient⼀样,Curator解决了很多 + * Zookeeper客户端⾮常底层的细节开发⼯作,包括连接重连,反复注册Watcher和 + * NodeExistsException异常等,是最流⾏的Zookeeper客户端之⼀。从编码⻛格上来讲,它提供了基于 + * Fluent的编程⻛格⽀持 + */ +public class Curator_API { + public static void main(String[] args) { + /** + * Curator的创建会话⽅式与原⽣的API和ZkClient的创建⽅式区别很⼤。Curator创建客户端是通过 + * CuratorFrameworkFactory⼯⼚类来实现的 + * + * 使⽤CuratorFramework这个⼯⼚类的两个静态⽅法来创建⼀个客户端 + * + * + * 其中参数RetryPolicy提供重试策略的接⼝,可以让⽤户实现⾃定义的重试策略,默认提供了以下实现, + * 分别为ExponentialBackoffRetry(基于backoff的重连策略)、RetryNTimes(重连N次策略)、 + * RetryForever(永远重试策略) + * + * + * public static CuratorFramework newClient(String connectString, RetryPolicy retryPolicy) + * connectString:zk的server地址,多个server之间使⽤英⽂逗号分隔开 + * connectionTimeoutMs:连接超时时间,如上是30s,默认是15s + * sessionTimeoutMs:会话超时时间,如上是50s,默认是60s + * retryPolicy:失败重试策略 + * + * ExponentialBackoffRetry:构造器含有三个参数 ExponentialBackoffRetry(int + * baseSleepTimeMs, int maxRetries, int maxSleepMs) + * baseSleepTimeMs:初始的sleep时间,⽤于计算之后的每次重试的sleep时间, + * 计算公式:当前sleep时间=baseSleepTimeMs*Math.max(1, + * random.nextInt(1<<(retryCount+1))) + * maxRetries:最⼤重试次数 + * maxSleepMs:最⼤sleep时间,如果上述的当前sleep计算出来⽐这个⼤,那么sleep⽤ + * 这个时间,默认的最⼤时间是Integer.MAX_VALUE毫秒。 + * 其他,查看org.apache.curator.RetryPolicy接⼝的实现类 + * start():完成会话的创建 + * public static CuratorFramework newClient(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, RetryPolicy retryPolicy) + * + * 客户端创建之后使用start方法来启动回话 + */ + + RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3); + CuratorFramework client = + CuratorFrameworkFactory.newClient("127.0.0.1:2181", 5000, 3000, retryPolicy); + client.start(); + /** + * 使用fluent风格如下 + * + * 需要注意的是session2会话含有隔离命名空间,即客户端对Zookeeper上数据节点的任何操作都是相 + * 对/base⽬录进⾏的,这有利于实现不同的Zookeeper的业务之间的隔离 + */ +// CuratorFramework client1 = CuratorFrameworkFactory.builder() +// .connectString("127.0.0.1:2181") //server地址 +// .sessionTimeoutMs(5000) // 会话超时时间 +// .connectionTimeoutMs(3000) // 连接超时时间 +// .retryPolicy(retryPolicy) // 重试策略 +// .namespace("base") // ᇿ⽴命名空间/base +// .build(); // +// client1.start(); +// System.out.println("Zookeeper session2 established. "); + + + /** + * curator提供了⼀系列Fluent⻛格的接⼝,通过使⽤Fluent编程⻛格的接⼝,开发⼈员可以进⾏⾃由组合 + * 来完成各种类型节点的创建。 + */ + /** + * 创建⼀个初始内容为空的节点 + * client.create().forPath(path); + */ + /** + * Curator默认创建的是持久节点 + * client.create().forPath(path,"我是内容".getBytes()); + */ + /** + * + * creatingParentsIfNeeded这个接⼝⾮常有⽤,在使⽤ZooKeeper 的过程中,开发⼈员经常会碰到 + * NoNodeException 异常,其中⼀个可能的原因就是试图对⼀个不存在的⽗节点创建⼦节点。因此,开 + * 发⼈员不得不在每次创建节点之前,都判断⼀下该⽗节点是否存在——这个处理通常⽐较麻烦。在使⽤ + * Curator 之后,通过调⽤creatingParentsIfNeeded 接⼝,Curator 就能够⾃动地递归创建所有需要的 + * ⽗节点。 + * + * + * + * 递归创建⽗节点,并选择节点类型 + * client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPa + * th(path); + */ + + /** + * 删除⼀个⼦节点 + * client.delete().forPath(path); + */ + + /** + * 删除节点并递归删除其⼦节点 + * client.delete().deletingChildrenIfNeeded().forPath(path); + */ + + /** + * + * 如果此版本已经不存在,则删除异常,异常信息如下。 + * org.apache.zookeeper.KeeperException$BadVersionException: KeeperErrorCode = BadVersion for + * + * 指定版本进⾏删除 + * client.delete().withVersion(1).forPath(path); + */ + + /** + * + * 只要客户端会话有效,那么Curator会在后台持续进⾏删除操作,直到节点删除成功。⽐如遇到⼀些⽹ + * 络异常的情况,此guaranteed的强制删除就会很有效果。 + * 强制保证删除⼀个节点 + * client.delete().guaranteed().forPath(path); + */ + + /** + * 获取节点数据内容API相当简单,同时Curator提供了传⼊⼀个Stat变量的⽅式来存储服务器端返回的最 + * 新的节点状态信息 + * + * // 普通查询 + * client.getData().forPath(path); + * // 包含状态查询 + * Stat stat = new Stat(); + * client.getData().storingStatIn(stat).forPath(path); + */ + + /** + * 更新数据,如果未传⼊version参数,那么更新当前最新版本,如果传⼊version则更新指定version,如 + * 果version已经变更,则抛出异常。 + * + * // 普通更新 + * client.setData().forPath(path,"新内容".getBytes()); + * // 指定版本更新 + * client.setData().withVersion(1).forPath(path); + */ + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/java/com/zimu/zkClient/ZKClient_API.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/java/com/zimu/zkClient/ZKClient_API.java" new file mode 100644 index 0000000000000000000000000000000000000000..db655e730206e383d5e226331c6fb4a2f307dbe9 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/java/com/zimu/zkClient/ZKClient_API.java" @@ -0,0 +1,96 @@ +package com.zimu.zkClient; + +import com.zimu.zookeeper.CreateNote; +import org.I0Itec.zkclient.IZkChildListener; +import org.I0Itec.zkclient.IZkDataListener; +import org.I0Itec.zkclient.ZkClient; + +import java.util.List; + +/** + * Created by 梓沐 on 2021/8/12. + * ZkClient是Github上⼀个开源的zookeeper客户端,在Zookeeper原⽣API接⼝之上进⾏了包装,是⼀个 + * 更易⽤的Zookeeper客户端,同时,zkClient在内部还实现了诸如Session超时重连、Watcher反复注册 + * 等功能接下来,还是从创建会话、创建节点、读取数据、更新数据、删除节点等⽅⾯来介绍如何使⽤zkClient + * 这个zookeeper客户端 + */ +public class ZKClient_API { + public static void main(String[] args) throws InterruptedException { + /** + * 创建⼀个zkClient实例来进⾏连接 + * 注意:zkClient通过对zookeeperAPI内部包装,将这个异步的会话创建过程同步化了 + */ + ZkClient zkClient = new ZkClient("106.13.200.230:2182"); + //createParents的值设置为true,可以递归先创建父节点再创建子节点 +// zkClient.createPersistent("/zimu-persistent/zimu-c1",true); +// //删除子节点,ZkClient可直接删除带⼦节点的⽗节点,因为其底层先删除其所有⼦节点,然后再删除⽗节点 +// zkClient.deleteRecursive("/zimu-persistent/zimu-c1"); +// //获取子节点 +// List children = zkClient.getChildren("/zimu-persistent"); +// System.out.println(children); +// +//// //注册监听事件 +// /** +// * 客户端可以对⼀个不存在的节点进⾏⼦节点变更的监听。 +// * ⼀旦客户端对⼀个节点注册了⼦节点列表变更监听之后,那么当该节点的⼦节点列表发⽣变更时,服务 +// * 端都会通知客户端,并将最新的⼦节点列表发送给客户端 +// *  该节点本身的创建或删除也会通知到客户端。 +// */ +// zkClient.subscribeChildChanges("/zimu-persistent", new IZkChildListener() { +// public void handleChildChange(String parentPath, List +// currentChilds) throws Exception { +// System.out.println(parentPath + " 's child changed, currentChilds:" + currentChilds); +// } +// }); +// zkClient.createPersistent("/zimu-persistent"); +// Thread.sleep(1000); +// zkClient.createPersistent("/zimu-persistent/c1"); +// Thread.sleep(1000); +// zkClient.delete("/zimu-persistent/c1"); +// Thread.sleep(1000); +// zkClient.delete("/zimu-persistent"); +// Thread.sleep(Integer.MAX_VALUE); + + //判断节点是否存在 +// boolean exists = zkClient.exists("/zimu-persistent1"); +// System.out.println(exists); +// if (!exists){ +// zkClient.createEphemeral("/zimu-persistent1", "123"); +// } else{ +// List children = zkClient.getChildren("/zimu-persistent1"); +// System.out.println(children); +// zkClient.delete("/zimu-persistent1/zimu-c1"); +// zkClient.createEphemeral("/zimu-persistent1", "123"); +// } +// +// //注册监听 +// zkClient.subscribeDataChanges("/zimu-persistent1", new IZkDataListener() { +// public void handleDataChange(String path, Object data) throws +// Exception { +// System.out.println(path+"该节点内容被更新,更新后的内容"+data); +// } +// public void handleDataDeleted(String s) throws Exception { +// System.out.println(s+" 该节点被删除"); +// } +// }); +// //获取节点内容 +// Object o = zkClient.readData("/zimu-persistent1"); +// System.out.println(o); +// //更新 +// zkClient.writeData("/zimu-persistent1","4567"); +// Thread.sleep(1000); +// //删除 +// zkClient.delete("/zimu-persistent1"); +// Thread.sleep(1000); + boolean exists = zkClient.exists("/zimu-persistent"); + System.out.println(exists); + if(exists){ + List children = zkClient.getChildren("/zimu-persistent"); + System.out.println(children); + boolean delete = zkClient.delete("/zimu-persistent"); + System.out.println(delete); + boolean exists1 = zkClient.exists("/zimu-persistent"); + System.out.println(exists1); + } + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/java/com/zimu/zookeeper/CreateNote.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/java/com/zimu/zookeeper/CreateNote.java" new file mode 100644 index 0000000000000000000000000000000000000000..91b1db6a3359666e282fca5cb2ab4837201f58e1 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/java/com/zimu/zookeeper/CreateNote.java" @@ -0,0 +1,131 @@ +package com.zimu.zookeeper; + +import org.apache.zookeeper.*; +import org.apache.zookeeper.data.Stat; + +import java.io.IOException; +import java.util.List; + +/** + * Created by 梓沐 on 2021/8/11. + */ +public class CreateNote implements Watcher { + private static ZooKeeper zooKeeper; + public static void main(String[] args) throws IOException, InterruptedException { + /** + * 客户端可以通过创建⼀个zk实例来连接zk服务器 + * new Zookeeper(connectString,sesssionTimeOut,Wather) + * connectString: 连接地址:IP:端⼝ + * sesssionTimeOut:会话超时时间:单位毫秒 + * Wather:监听器(当特定事件触发监听时,zk会通过watcher通知到客户端) + */ + zooKeeper = new ZooKeeper("106.13.200.230:2182", 5000, new CreateNote()); + /** + * 注意,ZooKeeper 客户端和服务端会话的建⽴是⼀个异步的过程,也就是说在程序中,构造⽅法会在处 + * 理完客户端初始化⼯作后⽴即返回,在⼤多数情况下,此时并没有真正建⽴好⼀个可⽤的会话,在会话 + * 的⽣命周期中处于“CONNECTING”的状态。 当该会话真正创建完毕后ZooKeeper服务端会向会话对应 + * 的客户端发送⼀个事件通知,以告知客户端,客户端只有在获取这个通知之后,才算真正建⽴了会话。 + */ + System.out.println(zooKeeper.getState()); + Thread.sleep(Integer.MAX_VALUE); + } + + @Override + public void process(WatchedEvent watchedEvent) { + //当连接创建了,服务端发送给客户端SyncConnected事件 + if(watchedEvent.getState() == Event.KeeperState.SyncConnected){ + try { + //createNoteSync(); +// getNodeData(); +// getChildls(); +// updateNodeSync(); + deleteNodeSync(); + } catch (KeeperException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + private void deleteNodeSync() throws KeeperException, InterruptedException + { + /** + * zooKeeper.exists(path,watch) :判断节点是否存在 + * zookeeper.delete(path,version) : 删除节点 + */ + + Stat exists = zooKeeper.exists("/zimu-persistent/zimu-children", false); + System.out.println(exists == null ? "该节点不存在":"该节点存在"); + if(exists == null){ + zooKeeper.create("/zimu-persistent/zimu-children", "持久性节点".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); + } + Stat exists1 = zooKeeper.exists("/zimu-persistent/zimu-children", false); + System.out.println(exists1); + zooKeeper.delete("/zimu-persistent/zimu-children",-1); + Stat exists2 = zooKeeper.exists("/zimu-persistent/zimu-children", false); + System.out.println(exists2 == null ? "该节点不存在":"该节点存在"); + } + private void updateNodeSync() throws Exception { + + /** + * path:路径 + * data:要修改的内容 byte[] + * version:为-1,表示对最新版本的数据进⾏修改 + * zooKeeper.setData(path, data,version); + */ + byte[] data = zooKeeper.getData("/zimu-persistent", false, null); + System.out.println("修改前的值:"+new String(data)); + //修改 stat:状态信息对象 -1:最新版本 + Stat stat = zooKeeper.setData("/zimu-persistent", "客户端修改内容".getBytes(), -1); + System.out.println(stat); + byte[] data2 = zooKeeper.getData("/zimu-persistent", false, null); + System.out.println("修改后的值:"+new String(data2)); + } + /** + * path:路径 + * watch:是否要启动监听,当⼦节点列表发⽣变化,会触发监听 + * zooKeeper.getChildren(path, watch); + */ + private void getChildls() throws KeeperException, InterruptedException { + List children = zooKeeper.getChildren("/zimu-persistent", true); + System.out.println(children); + } + + /** + * path : 获取数据的路径 + * watch : 是否开启监听 + * stat : 节点状态信息 + * null: 表示获取最新版本的数据 + * zk.getData(path, watch, stat); + */ + private void getNodeData() throws KeeperException, InterruptedException { + byte[] data = zooKeeper.getData("/zimu-persistent", true, null); + System.out.println(new String(data)); + } + + /** + * path :节点创建的路径 + * data[] :节点创建要保存的数据,是个byte类型的 + * acl :节点创建的权限信息(4种类型) + * ANYONE_ID_UNSAFE : 表示任何⼈ + * AUTH_IDS :此ID仅可⽤于设置ACL。它将被客户机验证的ID替换。 + * OPEN_ACL_UNSAFE :这是⼀个完全开放的ACL(常⽤)-->world:anyone + * CREATOR_ALL_ACL :此ACL授予创建者身份验证ID的所有权限 + * createMode :创建节点的类型(4种类型) + * PERSISTENT:持久节点 + * PERSISTENT_SEQUENTIAL:持久顺序节点 + * EPHEMERAL:临时节点 + * EPHEMERAL_SEQUENTIAL:临时顺序节点 + * String node = zookeeper.create(path,data,acl,createMode); + */ + private void createNoteSync() throws KeeperException, InterruptedException { + String persistent = zooKeeper.create("/zimu-persistent", "持久性节点".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); + String ephemeral = zooKeeper.create("/zimu-ephemeral", "临时性节点".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL); + String persistent_sequential = zooKeeper.create("/zimu-persistent_sequential", "持久性顺序节点".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL); + System.out.println(persistent); + System.out.println(ephemeral); + System.out.println(persistent_sequential); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/webapp/WEB-INF/web.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/webapp/WEB-INF/web.xml" new file mode 100644 index 0000000000000000000000000000000000000000..9f88c1f9632445500e3b3688fe477b860f77d8f2 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/webapp/WEB-INF/web.xml" @@ -0,0 +1,7 @@ + + + + Archetype Created Web Application + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/webapp/index.jsp" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/webapp/index.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..c38169bb958579c635a5c09ee2f379cc5956c0c2 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/src/main/webapp/index.jsp" @@ -0,0 +1,5 @@ + + +

Hello World!

+ + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/target/classes/com/zimu/zkClient/ZKClient_API.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/target/classes/com/zimu/zkClient/ZKClient_API.class" new file mode 100644 index 0000000000000000000000000000000000000000..beb6e5a498e3ed9edfdef35651af7984de9d89bf Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/target/classes/com/zimu/zkClient/ZKClient_API.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/target/classes/com/zimu/zookeeper/CreateNote.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/target/classes/com/zimu/zookeeper/CreateNote.class" new file mode 100644 index 0000000000000000000000000000000000000000..2711b51b4a3b8ceab91ffaf9e7f75f220bba9e75 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/target/classes/com/zimu/zookeeper/CreateNote.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/zookeeper-api.iml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/zookeeper-api.iml" new file mode 100644 index 0000000000000000000000000000000000000000..78b2cc53b203f0b97534bb1184cdc7b474339fb4 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/code/zookeeper-api/zookeeper-api.iml" @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/Zookeepe.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/Zookeepe.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..29e7809965b79bd5bf542ba29c670d1196ccc5b9 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2278\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/Zookeepe.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/compiler.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/compiler.xml" new file mode 100644 index 0000000000000000000000000000000000000000..ddfb99604eb8102582edb23b7091feb91c591e99 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/compiler.xml" @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/misc.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/misc.xml" new file mode 100644 index 0000000000000000000000000000000000000000..d24ea8e7debb4071df92884f676aca977525fde9 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/misc.xml" @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/modules.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/modules.xml" new file mode 100644 index 0000000000000000000000000000000000000000..47136a39680b727972608371018ff2ce79bdf757 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/modules.xml" @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/uiDesigner.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/uiDesigner.xml" new file mode 100644 index 0000000000000000000000000000000000000000..e96534fb27b68192f27f985d3879e173ec77adb8 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/uiDesigner.xml" @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/workspace.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/workspace.xml" new file mode 100644 index 0000000000000000000000000000000000000000..9b3584ae667051259e927053c11763bc3ff4c8cb --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\2279\344\275\234\344\270\232)/code/demo-dubbo-base/.idea/workspace.xml" @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + 1624540182393 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/src/main/java/com/zimu/login/controller/LoginController.java + 15 + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/HELP.md" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/HELP.md" new file mode 100644 index 0000000000000000000000000000000000000000..5626a111dac0a13d1bcad8b17d814b10f14c0c82 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/HELP.md" @@ -0,0 +1,17 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.5.1/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.5.1/maven-plugin/reference/html/#build-image) +* [Spring Web](https://docs.spring.io/spring-boot/docs/2.5.1/reference/htmlsingle/#boot-features-developing-web-applications) + +### Guides +The following guides illustrate how to use some features concretely: + +* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) +* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) +* [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/login.iml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/login.iml" new file mode 100644 index 0000000000000000000000000000000000000000..00cba0a88de533965a62134580f693e3a1ba5fd6 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/login.iml" @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/LoginProject.war" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/LoginProject.war" new file mode 100644 index 0000000000000000000000000000000000000000..c753d38c443f3ed69ae983880c5432782f750893 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/LoginProject.war" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/application.properties" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/application.properties" new file mode 100644 index 0000000000000000000000000000000000000000..ec1c9863f235e6a9bc62b119ce9905fdadb5840e --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/application.properties" @@ -0,0 +1,13 @@ +server.servlet.encoding.force-response=true + +#jsp ֧�� +spring.mvc.view.suffix=.jsp +spring.mvc.view.prefix=/WEB-INF/jsp/ + +#�ر�Ĭ��ģ������ +spring.thymeleaf.cache=false +spring.thymeleaf.enabled=false + +spring.redis.database=0 +spring.redis.host=127.0.0.1 +spring.redis.port=6379 diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/LoginApplication.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/LoginApplication.class" new file mode 100644 index 0000000000000000000000000000000000000000..2ba1322098d003ffc6ab86578aea4ec71b1e8c9d Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/LoginApplication.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/controller/LoginController.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/controller/LoginController.class" new file mode 100644 index 0000000000000000000000000000000000000000..ca84cf0e3f0f69c4fd6bfd9802a45796d7f3dfd7 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/controller/LoginController.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/controller/ResultController.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/controller/ResultController.class" new file mode 100644 index 0000000000000000000000000000000000000000..fb5500f4ed0c6bd96d655c0def90bcdde94bf3ef Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/controller/ResultController.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/interceptor/MyWebAppConfigurer.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/interceptor/MyWebAppConfigurer.class" new file mode 100644 index 0000000000000000000000000000000000000000..3bd5c3977f7c5c2e3d7fe63df1bc60d6bf010d93 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/interceptor/MyWebAppConfigurer.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/interceptor/RequestInterceptor.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/interceptor/RequestInterceptor.class" new file mode 100644 index 0000000000000000000000000000000000000000..10f790127109b20f2b23eeb21ec543db23b5862d Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/classes/com/zimu/login/interceptor/RequestInterceptor.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/application.properties" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/application.properties" new file mode 100644 index 0000000000000000000000000000000000000000..ec1c9863f235e6a9bc62b119ce9905fdadb5840e --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/application.properties" @@ -0,0 +1,13 @@ +server.servlet.encoding.force-response=true + +#jsp ֧�� +spring.mvc.view.suffix=.jsp +spring.mvc.view.prefix=/WEB-INF/jsp/ + +#�ر�Ĭ��ģ������ +spring.thymeleaf.cache=false +spring.thymeleaf.enabled=false + +spring.redis.database=0 +spring.redis.host=127.0.0.1 +spring.redis.port=6379 diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/LoginApplication.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/LoginApplication.class" new file mode 100644 index 0000000000000000000000000000000000000000..2ba1322098d003ffc6ab86578aea4ec71b1e8c9d Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/LoginApplication.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/controller/LoginController.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/controller/LoginController.class" new file mode 100644 index 0000000000000000000000000000000000000000..ca84cf0e3f0f69c4fd6bfd9802a45796d7f3dfd7 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/controller/LoginController.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/controller/ResultController.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/controller/ResultController.class" new file mode 100644 index 0000000000000000000000000000000000000000..fb5500f4ed0c6bd96d655c0def90bcdde94bf3ef Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/controller/ResultController.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/interceptor/MyWebAppConfigurer.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/interceptor/MyWebAppConfigurer.class" new file mode 100644 index 0000000000000000000000000000000000000000..3bd5c3977f7c5c2e3d7fe63df1bc60d6bf010d93 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/interceptor/MyWebAppConfigurer.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/interceptor/RequestInterceptor.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/interceptor/RequestInterceptor.class" new file mode 100644 index 0000000000000000000000000000000000000000..9ccc45d1d919efbcbd361de35924fea200257206 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/classes/com/zimu/login/interceptor/RequestInterceptor.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/jsp/login.jsp" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/jsp/login.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..475b55a0bf35b36f307e69d66d4ad1b4076e6ad6 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/jsp/login.jsp" @@ -0,0 +1,39 @@ +<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + + + 系统登录 + + + + +

我是服务器:${pageContext.request.localPort}

+

当前sessionId:${pageContext.session.id}

+
+
+ + + + + + + + + +
用户名:
密码:
+ +
+
+ + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/jsp/result.jsp" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/jsp/result.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..31524abd2197cb244f7155ba98a256372b144774 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/jsp/result.jsp" @@ -0,0 +1,12 @@ +<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + + + + +

欢迎登录xxx系统!


+

我是服务器:${pageContext.request.localPort}

+

当前sessionId:${pageContext.session.id}

+ + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-annotations-2.12.3.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-annotations-2.12.3.jar" new file mode 100644 index 0000000000000000000000000000000000000000..fd71f66d074ec0be274ee44c4d79ac90aa14b01d Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-annotations-2.12.3.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-core-2.12.3.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-core-2.12.3.jar" new file mode 100644 index 0000000000000000000000000000000000000000..3062f8fb1cd639359e0c3713fc8c7f56ede0fec0 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-core-2.12.3.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-databind-2.12.3.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-databind-2.12.3.jar" new file mode 100644 index 0000000000000000000000000000000000000000..47efedfc950538156d33d191cf83e8e897de9498 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-databind-2.12.3.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-datatype-jdk8-2.12.3.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-datatype-jdk8-2.12.3.jar" new file mode 100644 index 0000000000000000000000000000000000000000..82d9ee6f7553644fec857f868e145a32f3053482 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-datatype-jdk8-2.12.3.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-datatype-jsr310-2.12.3.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-datatype-jsr310-2.12.3.jar" new file mode 100644 index 0000000000000000000000000000000000000000..ca835d99182977bf80d71b29d8684d015382c6d6 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-datatype-jsr310-2.12.3.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-module-parameter-names-2.12.3.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-module-parameter-names-2.12.3.jar" new file mode 100644 index 0000000000000000000000000000000000000000..a33d273477ac80d4dcbb2958768211f9f36200b2 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jackson-module-parameter-names-2.12.3.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jakarta.annotation-api-1.3.5.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jakarta.annotation-api-1.3.5.jar" new file mode 100644 index 0000000000000000000000000000000000000000..606d992eb235afffc3284caf6a2f97939e8a1682 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jakarta.annotation-api-1.3.5.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jstl-1.2.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jstl-1.2.jar" new file mode 100644 index 0000000000000000000000000000000000000000..0fd275e94660402f80f01505d28b90a23f7e0209 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jstl-1.2.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jul-to-slf4j-1.7.30.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jul-to-slf4j-1.7.30.jar" new file mode 100644 index 0000000000000000000000000000000000000000..7dea58b2b3e5bc54d3b062d777414bcd2b1966bc Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/jul-to-slf4j-1.7.30.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/lettuce-core-6.1.2.RELEASE.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/lettuce-core-6.1.2.RELEASE.jar" new file mode 100644 index 0000000000000000000000000000000000000000..a30853c0578fc9ae969933e3b7c904fe710dbfd3 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/lettuce-core-6.1.2.RELEASE.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/log4j-api-2.14.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/log4j-api-2.14.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..52a9aeeb67a4a7c3d3ae9027d80e863f45db815a Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/log4j-api-2.14.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/log4j-to-slf4j-2.14.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/log4j-to-slf4j-2.14.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..47480969822981ec6b12ebffa0317ba998a0d6fb Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/log4j-to-slf4j-2.14.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/logback-classic-1.2.3.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/logback-classic-1.2.3.jar" new file mode 100644 index 0000000000000000000000000000000000000000..bed00c0a58a0a6e8aa5f1009320a3ff885cecea7 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/logback-classic-1.2.3.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/logback-core-1.2.3.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/logback-core-1.2.3.jar" new file mode 100644 index 0000000000000000000000000000000000000000..487b3956adea508a750a4325d5bc7f59e2142861 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/logback-core-1.2.3.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-buffer-4.1.65.Final.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-buffer-4.1.65.Final.jar" new file mode 100644 index 0000000000000000000000000000000000000000..61f9e8a5ff14398f68a072e44d3043c6afd7beac Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-buffer-4.1.65.Final.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-codec-4.1.65.Final.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-codec-4.1.65.Final.jar" new file mode 100644 index 0000000000000000000000000000000000000000..37daf99bf24a012a9e6510feef354f7dada98c13 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-codec-4.1.65.Final.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-common-4.1.65.Final.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-common-4.1.65.Final.jar" new file mode 100644 index 0000000000000000000000000000000000000000..6cb74f939becefdc95878d495a9d685ca3275a91 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-common-4.1.65.Final.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-handler-4.1.65.Final.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-handler-4.1.65.Final.jar" new file mode 100644 index 0000000000000000000000000000000000000000..534ff54516e129b9f7774617f1630836f39c1056 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-handler-4.1.65.Final.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-resolver-4.1.65.Final.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-resolver-4.1.65.Final.jar" new file mode 100644 index 0000000000000000000000000000000000000000..1be107e313e3a78164237be442abf83a888d27cf Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-resolver-4.1.65.Final.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-transport-4.1.65.Final.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-transport-4.1.65.Final.jar" new file mode 100644 index 0000000000000000000000000000000000000000..aede1907eefe72226263b93ea375b5e37c622389 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/netty-transport-4.1.65.Final.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/reactive-streams-1.0.3.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/reactive-streams-1.0.3.jar" new file mode 100644 index 0000000000000000000000000000000000000000..b9b487caa3af3a32860dc1e0d68b84da62361b68 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/reactive-streams-1.0.3.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/reactor-core-3.4.6.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/reactor-core-3.4.6.jar" new file mode 100644 index 0000000000000000000000000000000000000000..6347e566520fbc0b8a767e34ea219ad4f6566ef4 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/reactor-core-3.4.6.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/slf4j-api-1.7.30.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/slf4j-api-1.7.30.jar" new file mode 100644 index 0000000000000000000000000000000000000000..29ac26fb8cad7ef5934377a8c269c4e521520e5c Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/slf4j-api-1.7.30.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/snakeyaml-1.28.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/snakeyaml-1.28.jar" new file mode 100644 index 0000000000000000000000000000000000000000..93ec2ff4bb78b380f3e5d18f1a6b44b22818e44b Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/snakeyaml-1.28.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-aop-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-aop-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..9858b9289d6344de6263c64525040982b6578172 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-aop-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-beans-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-beans-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..ac5e43c3d4a3620419902db121c9db4f177b7cf4 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-beans-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..d3bc9dd50dcd3f07c96b77585857429729e8acd4 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-autoconfigure-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-autoconfigure-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..2fd62a867bbed4cc829122ba95ce48d6c2b6977b Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-autoconfigure-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..ca53550b5ed10baee3ed5ce532d916d1cbd449c6 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-data-redis-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-data-redis-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..32d8eed2ef034e08f5cf6375ac7374a1f31950eb Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-data-redis-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-json-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-json-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..1c8fc9440d58b669d6e186cca7dfd5d8d2af4343 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-json-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-logging-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-logging-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..638053235cdd3de5dbcf0a0342ed5915b2d5cd22 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-logging-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-web-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-web-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..c0cc25a9d2c849c9d07d882f775702c37e45c6e5 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-boot-starter-web-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-context-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-context-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..7e76abdfe4249992e8a067cd4a9a2137283d6f68 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-context-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-context-support-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-context-support-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..ac8e73dddae7433079a3a2a71fd5004d2cb70a8e Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-context-support-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-core-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-core-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..c87fb32c25b97d4d877b64f49121106c3223ff34 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-core-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-data-commons-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-data-commons-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..1b67e0a590d73ef64921243a8edeed6e987cbb9e Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-data-commons-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-data-keyvalue-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-data-keyvalue-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..ef597439efc28c4c7d9daafe869493c76dc7ac56 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-data-keyvalue-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-data-redis-2.5.1.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-data-redis-2.5.1.jar" new file mode 100644 index 0000000000000000000000000000000000000000..2530907f0ddac1d2245c7758e216269e89cbd69a Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-data-redis-2.5.1.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-expression-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-expression-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..bd0205b61233ba62700f0294da8f899dcc06cba1 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-expression-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-jcl-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-jcl-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..f283434f3cddb8b405772e3d88b403195ed39bb8 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-jcl-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-oxm-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-oxm-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..6e1a44cc7b493ccf0adb351c7d37e56a8d51e0b4 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-oxm-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-session-core-2.5.0.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-session-core-2.5.0.jar" new file mode 100644 index 0000000000000000000000000000000000000000..00adbac782e3e6fbe1e3278e431243fddd654b5a Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-session-core-2.5.0.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-session-data-redis-2.5.0.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-session-data-redis-2.5.0.jar" new file mode 100644 index 0000000000000000000000000000000000000000..bbc0a3eb4e4fc98273d5f91dc0f5449ef05b4aac Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-session-data-redis-2.5.0.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-tx-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-tx-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..5d99f6c42716246eba9ce1724ed7be12d4520e8e Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-tx-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-web-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-web-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..6cc11680316bee22424219477c984ad8865566fe Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-web-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-webmvc-5.3.8.jar" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-webmvc-5.3.8.jar" new file mode 100644 index 0000000000000000000000000000000000000000..d605ab8e8ce9bea41457b26a41350f4c50e7acda Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/WEB-INF/lib/spring-webmvc-5.3.8.jar" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/web.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/web.xml" new file mode 100644 index 0000000000000000000000000000000000000000..d80081d1318531b6c30eaf0d748bf80a0b2e042a --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/login-0.0.1-SNAPSHOT/web.xml" @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/maven-archiver/pom.properties" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/maven-archiver/pom.properties" new file mode 100644 index 0000000000000000000000000000000000000000..5cbc2773923eaa48883998fea7dd7c777d0208dc --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/maven-archiver/pom.properties" @@ -0,0 +1,3 @@ +artifactId=login +groupId=com.zimu +version=0.0.1-SNAPSHOT diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/test-classes/com/zimu/login/LoginApplicationTests.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/test-classes/com/zimu/login/LoginApplicationTests.class" new file mode 100644 index 0000000000000000000000000000000000000000..7a84e669b596708f0065b6d1259c02e8c0af89a2 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/code/login/target/test-classes/com/zimu/login/LoginApplicationTests.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\344\270\200\350\207\264\346\200\247\345\223\210\345\270\214\347\256\227\346\263\225.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\344\270\200\350\207\264\346\200\247\345\223\210\345\270\214\347\256\227\346\263\225.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..cc9aef80fb6a2c6ff177717b1d80890bb6753b00 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\344\270\200\350\207\264\346\200\247\345\223\210\345\270\214\347\256\227\346\263\225.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217ID\350\247\243\345\206\263\346\226\271\346\241\210.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217ID\350\247\243\345\206\263\346\226\271\346\241\210.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..48afe8629190dc179a4980d167928a35d85319ce Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217ID\350\247\243\345\206\263\346\226\271\346\241\210.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\350\260\203\345\272\246\351\227\256\351\242\230.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\350\260\203\345\272\246\351\227\256\351\242\230.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..66afe6252de89cbdad99208025b8926e0dd7c4ce Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\344\272\224\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\350\260\203\345\272\246\351\227\256\351\242\230.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/.idea/compiler.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/.idea/compiler.xml" new file mode 100644 index 0000000000000000000000000000000000000000..c199043ebbe85b84758809ba05ebf82309945e59 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/.idea/compiler.xml" @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/.idea/misc.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/.idea/misc.xml" new file mode 100644 index 0000000000000000000000000000000000000000..d24ea8e7debb4071df92884f676aca977525fde9 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/.idea/misc.xml" @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/.idea/workspace.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/.idea/workspace.xml" new file mode 100644 index 0000000000000000000000000000000000000000..3502509694061cb623eaa668046978ec01abc612 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/.idea/workspace.xml" @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1624700441089 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/RPC.iml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/RPC.iml" new file mode 100644 index 0000000000000000000000000000000000000000..78b2cc53b203f0b97534bb1184cdc7b474339fb4 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/RPC.iml" @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/pom.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/pom.xml" new file mode 100644 index 0000000000000000000000000000000000000000..5a65ea466d904799f0ce758327c1b9d9aa557058 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/pom.xml" @@ -0,0 +1,12 @@ + + + 4.0.0 + + com.zimu + RPC + 1.0-SNAPSHOT + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/src/main/java/com/zi/mu/BufferCreate.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/src/main/java/com/zi/mu/BufferCreate.java" new file mode 100644 index 0000000000000000000000000000000000000000..948da477b5b556c480e7e9ea2d88ed1e74c61455 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/src/main/java/com/zi/mu/BufferCreate.java" @@ -0,0 +1,25 @@ +package com.zi.mu; + +import java.nio.ByteBuffer; + +/** + * Created by 梓沐 on 2021/6/26. + */ +public class BufferCreate { + public static void main(String[] args) { + //创建指定长度的缓存区 + ByteBuffer byteBuffer = ByteBuffer.allocate(5); + for (int i = 0; i < 5; i++) { + System.out.println(byteBuffer.get()); + } + //上面已经将缓冲数组中的值取完了,因此会越界 +// System.out.println(byteBuffer.get()); + //创建指定内容的缓冲区 + ByteBuffer wrap = ByteBuffer.wrap("媳妇儿,hello".getBytes()); + for (int i = 0; i < 15; i++) { + System.out.println(wrap.get()); + } + //上面已经将缓冲数组中的值取完了,因此会越界 + System.out.println(wrap.get()); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/target/classes/com/zi/mu/BufferCreate.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/target/classes/com/zi/mu/BufferCreate.class" new file mode 100644 index 0000000000000000000000000000000000000000..3acd54f5033f890b5157ac1942f841f524244f66 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/code/RPC/target/classes/com/zi/mu/BufferCreate.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\344\270\200\350\207\264\346\200\247\345\215\217\350\256\256.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\344\270\200\350\207\264\346\200\247\345\215\217\350\256\256.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..b9dcf2dc9edf5106e4f7666ac0d132e422881071 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\344\270\200\350\207\264\346\200\247\345\215\217\350\256\256.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\347\220\206\350\256\272\343\200\201\346\236\266\346\236\204\350\256\276\350\256\241\357\274\210\350\207\252\345\256\232\344\271\211RPC\357\274\211.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\347\220\206\350\256\272\343\200\201\346\236\266\346\236\204\350\256\276\350\256\241\357\274\210\350\207\252\345\256\232\344\271\211RPC\357\274\211.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..8cba34315642afe8500fcdd724d6e22df8c581cf Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\347\220\206\350\256\272\343\200\201\346\236\266\346\236\204\350\256\276\350\256\241\357\274\210\350\207\252\345\256\232\344\271\211RPC\357\274\211.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\347\220\206\350\256\272\344\270\216\345\210\206\345\270\203\345\274\217\346\236\266\346\236\204\347\220\206\350\256\272.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\347\220\206\350\256\272\344\270\216\345\210\206\345\270\203\345\274\217\346\236\266\346\236\204\347\220\206\350\256\272.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..9284e0d7fc065a9c2880eba9e676b9e3f41c0d02 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\205\255\344\275\234\344\270\232)/\347\256\200\347\255\224\351\242\230/\345\210\206\345\270\203\345\274\217\347\220\206\350\256\272\344\270\216\345\210\206\345\270\203\345\274\217\346\236\266\346\236\204\347\220\206\350\256\272.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/compiler.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/compiler.xml" new file mode 100644 index 0000000000000000000000000000000000000000..cd20a167fb073cb7f506db60ef103d090a8ac271 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/compiler.xml" @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml" new file mode 100644 index 0000000000000000000000000000000000000000..34757835be13f93e4f57df51fc368f98903ee981 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml" @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/libraries/Maven__jaxen_jaxen_1_1_6.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/libraries/Maven__jaxen_jaxen_1_1_6.xml" new file mode 100644 index 0000000000000000000000000000000000000000..e007203a48cc7d66323c67c80271362b4b77bf76 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/libraries/Maven__jaxen_jaxen_1_1_6.xml" @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/libraries/Maven__xml_apis_xml_apis_1_0_b2.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/libraries/Maven__xml_apis_xml_apis_1_0_b2.xml" new file mode 100644 index 0000000000000000000000000000000000000000..7f8326575fdeb8dc94f4c67e885c06498a0686bc --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/libraries/Maven__xml_apis_xml_apis_1_0_b2.xml" @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/misc.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/misc.xml" new file mode 100644 index 0000000000000000000000000000000000000000..cc68b1dff6d7fc93651bd4b516a22cbe8567f7d3 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/misc.xml" @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/modules.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/modules.xml" new file mode 100644 index 0000000000000000000000000000000000000000..0e920ba7cff7cf3fe9cf3cacab2080e76a524c9e --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/modules.xml" @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/workspace.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/workspace.xml" new file mode 100644 index 0000000000000000000000000000000000000000..b7ddc1bfe0358fcd4fdb57536e6ac50ed198dce2 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/.idea/workspace.xml" @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1622557758969 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/src/main/java/com/zimu/RequestProcessor.java + 26 + + + file://$PROJECT_DIR$/src/main/java/com/zimu/RequestProcessor.java + 30 + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/Minicat.iml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/Minicat.iml" new file mode 100644 index 0000000000000000000000000000000000000000..439d2094f8111b16d2ac6ee4b7e46ed7aecaccc9 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/Minicat.iml" @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/pom.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/pom.xml" new file mode 100644 index 0000000000000000000000000000000000000000..cce1c749f09abcff984edd0ef8c475ecde74c211 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/pom.xml" @@ -0,0 +1,39 @@ + + + com.lagou.edu + 1.0-SNAPSHOT + 4.0.0 + + minicat + + + dom4j + dom4j + 1.6.1 + + + jaxen + jaxen + 1.1.6 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 11 + 11 + utf-8 + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/BootStrap.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/BootStrap.java" new file mode 100644 index 0000000000000000000000000000000000000000..56ff282e3b97450a7685321feb24c253cce36ce9 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/BootStrap.java" @@ -0,0 +1,183 @@ +package com.zimu; + +import com.zimu.webappas.servlet1; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; +import org.dom4j.tree.DefaultElement; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URL; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.*; + +/** + * Created by 梓沐 on 2021/6/1. + */ +public class BootStrap { + //定义socket监听的端口号 + private Integer port = 8081; + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public static void main(String[] args) { + BootStrap bootStrap = new BootStrap(); + try { + bootStrap.start(); + } catch (IOException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 启动minicat需要的一些初始化工作 + */ + private void start() throws Exception { + loadServlet(); + + // 定义⼀个线程池 + int corePoolSize = 10; + int maximumPoolSize =50; + long keepAliveTime = 100L; + TimeUnit unit = TimeUnit.SECONDS; + BlockingQueue workQueue = new ArrayBlockingQueue<>(50); + ThreadFactory threadFactory = Executors.defaultThreadFactory(); + RejectedExecutionHandler handler = new + ThreadPoolExecutor.AbortPolicy(); + ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor( + corePoolSize, + maximumPoolSize, + keepAliveTime, + unit, + workQueue, + threadFactory, + handler + ); + + ServerSocket serverSocket = new ServerSocket(port); + while (true){ + //开启自动监听端口号 + Socket socket = serverSocket.accept(); + RequestProcessor requestProcessor = new RequestProcessor(socket, servletMap); + //线程池调用execute方法,将会执行RequestProcessor的run方法 + threadPoolExecutor.execute(requestProcessor); + } + } + + private Map servletMap = new HashMap(); + + /** + * 加载解析web.xml,初始化Servlet + */ + private void loadServlet() { + InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("web.xml"); + SAXReader saxReader = new SAXReader(); + + try { + Document document = saxReader.read(resourceAsStream); + Element rootElement = document.getRootElement(); + + List selectNodes = rootElement.selectNodes("//servlet"); + for (int i = 0; i < selectNodes.size(); i++) { + Element element = selectNodes.get(i); + // lagou + Element servletnameElement = (Element) element.selectSingleNode("servlet-name"); + String servletName = servletnameElement.getStringValue(); + // server.xml.LagouServlet + Element servletclassElement = (Element) element.selectSingleNode("servlet-class"); + String servletClass = servletclassElement.getStringValue(); + + + // 根据servlet-name的值找到url-pattern + Element servletMapping = (Element) rootElement.selectSingleNode("/web-app/servlet-mapping[servlet-name='" + servletName + "']"); + // /lagou + String urlPattern = servletMapping.selectSingleNode("url-pattern").getStringValue(); + servletMap.put(urlPattern, (HttpServlet) Class.forName(servletClass).newInstance()); + + } + //解析server.xml + processServerXml(); + + } catch (DocumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + + } + + private void processServerXml() { + InputStream serverXmlInputStream = this.getClass().getClassLoader().getResourceAsStream("server.xml"); + SAXReader saxReader = new SAXReader(); + Document read = null; + try { + read = saxReader.read(serverXmlInputStream); + Element serverXmlRootEle = read.getRootElement(); + List serviceEle = serverXmlRootEle.selectNodes("//service"); + List content = serviceEle.get(0).content(); + for (int i = 0; i < content.size(); i++) { + if(!(content.get(i) instanceof DefaultElement)){continue;} + DefaultElement defaultElement = content.get(i); + String stringName = defaultElement.getName(); + if("Connector".equals(stringName)) { + String port = defaultElement.attributeValue("port"); + this.setPort(Integer.valueOf(port)); + } + if("Engine".equals(stringName)){ + List engineEle = defaultElement.selectNodes("//Engine"); + List contentEle = engineEle.get(0).content(); + for (int j = 0; j < contentEle.size(); j++) { + if(!(contentEle.get(j) instanceof DefaultElement)){continue;} + DefaultElement ele = contentEle.get(j); + if("Host".equals(ele.getName())){ + String name = ele.attributeValue("name"); + String appBase = ele.attributeValue("appBase"); + File file = new File(appBase); + int length = file.getPath().length(); + if(file.exists() && file.isDirectory()){ + File[] files = file.listFiles(); + for (int l = 0; l < files.length; l++) { + //com/zimu/webappas/ servlet1.java + File file1 = files[l]; + String substring = file1.getPath().substring(length - 17,file1.getPath().length()-5); + String s = substring.replaceAll("\\\\", "."); + Class aClass = Class.forName(s); + servletMap.put("/app" + (l + 1), (HttpServlet) aClass.newInstance()); + } + } + } + } + } + } + } catch (DocumentException e) { + e.printStackTrace(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } + + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/HttpProtocolUtil.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/HttpProtocolUtil.java" new file mode 100644 index 0000000000000000000000000000000000000000..64c79e4b00e5777512d56bd70dce4d701de90937 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/HttpProtocolUtil.java" @@ -0,0 +1,32 @@ +package com.zimu; + +import java.sql.Blob; + +/** + * Created by 梓沐 on 2021/6/1. + * http协议工具类,主要是提供响应头信息,这里我们只提供200和404的情况 + */ +public class HttpProtocolUtil { + /** + * 为响应码200提供请求头信息 + * @return + */ + public static String getHttpHeader200(long contentLength) { + return "HTTP/1.1 200 OK \n" + + "Content-Type: text/html \n" + + "Content-Length: " + contentLength + " \n" + + "\r\n"; + } + + /** + * 为响应码404提供请求头信息(此处也包含了数据内容) + * @return + */ + public static String getHttpHeader404() { + String str404 = "

404 not found

"; + return "HTTP/1.1 404 NOT Found \n" + + "Content-Type: text/html \n" + + "Content-Length: " + str404.getBytes().length + " \n" + + "\r\n" + str404; + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/HttpServlet.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/HttpServlet.java" new file mode 100644 index 0000000000000000000000000000000000000000..1d0da677c5c51b483c0cd0227357fbd040ca425f --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/HttpServlet.java" @@ -0,0 +1,19 @@ +package com.zimu; + +public abstract class HttpServlet implements Servlet{ + + + public abstract void doGet(Request request,Response response); + + public abstract void doPost(Request request,Response response); + + + @Override + public void service(Request request, Response response) throws Exception { + if("GET".equalsIgnoreCase(request.getMethod())) { + doGet(request,response); + }else{ + doPost(request,response); + } + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/LagouServlet.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/LagouServlet.java" new file mode 100644 index 0000000000000000000000000000000000000000..6c06a2121b4f466025ba60ed9bd324764640a13c --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/LagouServlet.java" @@ -0,0 +1,42 @@ +package com.zimu; + +import java.io.IOException; + +public class LagouServlet extends HttpServlet { + @Override + public void doGet(Request request, Response response) { + + + try { + Thread.sleep(100000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + String content = "

LagouServlet get

"; + try { + response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content)); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void doPost(Request request, Response response) { + String content = "

LagouServlet post

"; + try { + response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content)); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void init() throws Exception { + + } + + @Override + public void destory() throws Exception { + + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/Request.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/Request.java" new file mode 100644 index 0000000000000000000000000000000000000000..2978f5794cdfa6bd813af69d882a169d15756edd --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/Request.java" @@ -0,0 +1,52 @@ +package com.zimu; + +import java.io.IOException; +import java.io.InputStream; + +/** + * Created by 梓沐 on 2021/6/1. + */ +public class Request { + + private String url; + + private String method; + + private InputStream inputStream; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + public Request(InputStream inputStream) throws IOException { + this.inputStream = inputStream; + int count = 0; + while (count == 0){ + count = inputStream.available(); + } + byte[] bytes = new byte[count]; + //从输入流中读取count长度并存入bytes数组中 + inputStream.read(bytes); + String str = new String(bytes); + // 获取第一行请求头信息 + String firstLineStr = str.split("\\n")[0];// GET / HTTP/1.1 + String[] split = firstLineStr.split(" "); + this.method = split[0]; + this.url = split[1]; + + System.out.println("=====>>method:" + method); + System.out.println("=====>>url:" + url); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/RequestProcessor.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/RequestProcessor.java" new file mode 100644 index 0000000000000000000000000000000000000000..8d32d53f499fdd501d7c5b443a09d57c1bbf0b98 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/RequestProcessor.java" @@ -0,0 +1,42 @@ +package com.zimu; + +import java.io.InputStream; +import java.net.Socket; +import java.util.Map; + +public class RequestProcessor extends Thread { + + private Socket socket; + private Map servletMap; + + public RequestProcessor(Socket socket, Map servletMap) { + this.socket = socket; + this.servletMap = servletMap; + } + + @Override + public void run() { + try{ + InputStream inputStream = socket.getInputStream(); + + // 封装Request对象和Response对象 + Request request = new Request(inputStream); + Response response = new Response(socket.getOutputStream()); + + // 静态资源处理 + if(request.getUrl() != null && request.getUrl().contains(".html")) { + response.outPutHtml(request.getUrl()); + }else{ + // 动态资源servlet请求 + HttpServlet httpServlet = servletMap.get(request.getUrl()); + httpServlet.service(request,response); + } + + socket.close(); + + }catch (Exception e) { + e.printStackTrace(); + } + + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/Response.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/Response.java" new file mode 100644 index 0000000000000000000000000000000000000000..5049b5aa3ba4921ec3f14d8c34bf0fbc9730720c --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/Response.java" @@ -0,0 +1,38 @@ +package com.zimu; + +import java.io.*; + +/** + * Created by 梓沐 on 2021/6/1. + * 封装Response对象,需要依赖于OutputStream + * + * 该对象需要提供核心方法,输出html + */ +public class Response { + private OutputStream outputStream; + + public Response() { + } + + public Response(OutputStream outputStream) { + this.outputStream = outputStream; + } + + public void outPutHtml(String path) throws IOException { + //获取静态资源的绝对路径 + String absoluteResourcePath = StaticResourceUtil.getAbsolutePath(path); + //输入静态资源文件 + File file = new File(absoluteResourcePath); + if(file.exists() && file.isFile()){ + //读取惊天资源文件,输出静态资源 + StaticResourceUtil.outputStaticResource(new FileInputStream(file),outputStream); + }else{ + // 输出404 + output(HttpProtocolUtil.getHttpHeader404()); + } + } + // 使用输出流输出指定字符串 + public void output(String content) throws IOException { + outputStream.write(content.getBytes()); + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/Servlet.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/Servlet.java" new file mode 100644 index 0000000000000000000000000000000000000000..02344a23c82bde7c00abcd47a3990353e934afea --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/Servlet.java" @@ -0,0 +1,10 @@ +package com.zimu; + +public interface Servlet { + + void init() throws Exception; + + void destory() throws Exception; + + void service(Request request, Response response) throws Exception; +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/StaticResourceUtil.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/StaticResourceUtil.java" new file mode 100644 index 0000000000000000000000000000000000000000..5c47ab66231c4f79255b52d12f588471496da4c4 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/StaticResourceUtil.java" @@ -0,0 +1,52 @@ +package com.zimu; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; + +/** + * Created by 梓沐 on 2021/6/1. + */ +public class StaticResourceUtil { + + public static String getAbsolutePath(String path) { + //获取classes文件的根路径 + URL resource = StaticResourceUtil.class.getResource("/"); + String absolutePath = resource.getPath(); + return absolutePath.replaceAll("\\\\", "/") + path; + } + + /** + * 读取静态资源文件输入流,通过输出流输出 + */ + public static void outputStaticResource(InputStream inputStream, OutputStream outputStream) throws IOException { + int count = 0; + while (count == 0){ + count = inputStream.available(); + } + int resourceSize = count; + // 输出http请求头 + outputStream.write(HttpProtocolUtil.getHttpHeader200(resourceSize).getBytes()); + //输出具体内容 + // 已经读取的内容长度 + int written = 0; + // 计划每次缓冲的长度 + int byteSize = 1024; + byte[] bytes = new byte[byteSize]; + + while (written < resourceSize){ + // 如果剩余未读取大小不足一个1024长度,那就按真实长度处理 + if(resourceSize - written < byteSize){ + // 剩余的文件内容长度 + byteSize = resourceSize - written; + bytes = new byte[byteSize]; + } + inputStream.read(bytes); + outputStream.write(bytes); + outputStream.flush(); + written += byteSize; + } + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/webappas/servlet1.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/webappas/servlet1.java" new file mode 100644 index 0000000000000000000000000000000000000000..45fe6c1ff291cae636eb4389cc251197a81c7edd --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/webappas/servlet1.java" @@ -0,0 +1,45 @@ +package com.zimu.webappas; + +import com.zimu.HttpProtocolUtil; +import com.zimu.HttpServlet; +import com.zimu.Request; +import com.zimu.Response; + +import java.io.IOException; + +/** + * Created by 梓沐 on 2021/6/13. + */ +public class servlet1 extends HttpServlet { + @Override + public void doGet(Request request, Response response) { + + + String content = "

servlet111111

"; + try { + response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content)); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void doPost(Request request, Response response) { + String content = "

servlet111111

"; + try { + response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content)); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void init() throws Exception { + + } + + @Override + public void destory() throws Exception { + + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/webappas/servlet2.java" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/webappas/servlet2.java" new file mode 100644 index 0000000000000000000000000000000000000000..f3fa1ddf7c9d68a35641a454f301baddc6137dd1 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/java/com/zimu/webappas/servlet2.java" @@ -0,0 +1,45 @@ +package com.zimu.webappas; + +import com.zimu.HttpProtocolUtil; +import com.zimu.HttpServlet; +import com.zimu.Request; +import com.zimu.Response; + +import java.io.IOException; + +/** + * Created by 梓沐 on 2021/6/13. + */ +public class servlet2 extends HttpServlet { + @Override + public void doGet(Request request, Response response) { + + + String content = "

servlet222222

"; + try { + response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content)); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void doPost(Request request, Response response) { + String content = "

servlet222222

"; + try { + response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content)); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void init() throws Exception { + + } + + @Override + public void destory() throws Exception { + + } +} diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/resources/index.html" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/resources/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..a7c5a081074d193cc087b88cc12752714ec60c17 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/resources/index.html" @@ -0,0 +1,10 @@ + + + + + static resouce + + +Hello Minicat-static resouce! + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/resources/server.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/resources/server.xml" new file mode 100644 index 0000000000000000000000000000000000000000..2e60ad358998b12eb65417eb72e087694fa4990c --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/resources/server.xml" @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/resources/web.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/resources/web.xml" new file mode 100644 index 0000000000000000000000000000000000000000..54a4393d988bf78d03e4a566793e56705148c29f --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/src/main/resources/web.xml" @@ -0,0 +1,13 @@ + + + + zimu + com.zimu.LagouServlet + + + + + zimu + /zimu + + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/META-INF/Minicat.kotlin_module" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/META-INF/Minicat.kotlin_module" new file mode 100644 index 0000000000000000000000000000000000000000..a49347afef10a9b5f95305e1058ba36adec7d6dd Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/META-INF/Minicat.kotlin_module" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/BootStrap.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/BootStrap.class" new file mode 100644 index 0000000000000000000000000000000000000000..bc480cbb0d8c712e153cfdcfa0f9fdde99bd6db9 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/BootStrap.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/HttpProtocolUtil.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/HttpProtocolUtil.class" new file mode 100644 index 0000000000000000000000000000000000000000..42bafc0fa28da613e4050d21c4feeb52f7bac0d3 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/HttpProtocolUtil.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/HttpServlet.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/HttpServlet.class" new file mode 100644 index 0000000000000000000000000000000000000000..d603f6ccf926799e6f1c2afb031b44337196c95b Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/HttpServlet.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/LagouServlet.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/LagouServlet.class" new file mode 100644 index 0000000000000000000000000000000000000000..a87fd82e307b04a9e1d22c2eb4e2481db88d990f Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/LagouServlet.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/Request.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/Request.class" new file mode 100644 index 0000000000000000000000000000000000000000..0edd01d35efee604e3d9d1503585b7e972908442 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/Request.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/RequestProcessor.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/RequestProcessor.class" new file mode 100644 index 0000000000000000000000000000000000000000..398954ec1b4fe4c36bf861da9d0408cce395e0df Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/RequestProcessor.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/Response.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/Response.class" new file mode 100644 index 0000000000000000000000000000000000000000..54c020b5fa6717dfd7d42c03dbe92b9aac3450b1 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/Response.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/Servlet.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/Servlet.class" new file mode 100644 index 0000000000000000000000000000000000000000..e20f26e6ca13ee515b8410d9279330477d83d4c1 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/Servlet.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/StaticResourceUtil.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/StaticResourceUtil.class" new file mode 100644 index 0000000000000000000000000000000000000000..246005d7656014858f77195628c79afd14837f61 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/StaticResourceUtil.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/webappas/servlet1.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/webappas/servlet1.class" new file mode 100644 index 0000000000000000000000000000000000000000..3fa7fac8d948db5d3843e08de0b51af1bf4c2647 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/webappas/servlet1.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/webappas/servlet2.class" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/webappas/servlet2.class" new file mode 100644 index 0000000000000000000000000000000000000000..3a95ece00a3542147dc271e837dde39455c82d13 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/com/zimu/webappas/servlet2.class" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/index.html" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/index.html" new file mode 100644 index 0000000000000000000000000000000000000000..a7c5a081074d193cc087b88cc12752714ec60c17 --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/index.html" @@ -0,0 +1,10 @@ + + + + + static resouce + + +Hello Minicat-static resouce! + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/server.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/server.xml" new file mode 100644 index 0000000000000000000000000000000000000000..2e60ad358998b12eb65417eb72e087694fa4990c --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/server.xml" @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/web.xml" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/web.xml" new file mode 100644 index 0000000000000000000000000000000000000000..54a4393d988bf78d03e4a566793e56705148c29f --- /dev/null +++ "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/code/minicat/target/classes/web.xml" @@ -0,0 +1,13 @@ + + + + zimu + com.zimu.LagouServlet + + + + + zimu + /zimu + + diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/20210613_131111.mp4" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/20210613_131111.mp4" new file mode 100644 index 0000000000000000000000000000000000000000..6cbd58836fc3b4ce1742ee85ba8d494b16f236c1 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/20210613_131111.mp4" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/Tomcat\345\233\276\350\247\243.png" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/Tomcat\345\233\276\350\247\243.png" new file mode 100644 index 0000000000000000000000000000000000000000..ba0de7f52417df33a53e6afdef88c32a645b092c Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/Tomcat\345\233\276\350\247\243.png" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/nginx.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/nginx.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..3abe142c7ef23d2d698a1122aa8ecc3ed6b619bc Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/nginx.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/tomcat.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/tomcat.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..215070f1b1dfd6ddd492105162bcb1e361378cec Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/tomcat.pdf" differ diff --git "a/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/tomcat\346\272\220\347\240\201\347\216\257\345\242\203\346\236\204\345\273\272.pdf" "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/tomcat\346\272\220\347\240\201\347\216\257\345\242\203\346\236\204\345\273\272.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..1fd0740d8d9615f7dcd02ec5f3c1e581c5a22cf7 Binary files /dev/null and "b/\346\235\216\345\255\237\345\235\244I(\346\250\241\345\235\227\345\233\233\344\275\234\344\270\232)/\351\252\214\350\257\201\350\265\204\346\226\231/tomcat\346\272\220\347\240\201\347\216\257\345\242\203\346\236\204\345\273\272.pdf" differ