第一次提交
This commit is contained in:
parent
af0bcde70a
commit
3835e68e21
6
.idea/encodings.xml
Normal file
6
.idea/encodings.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/demo/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
13
.idea/misc.xml
Normal file
13
.idea/misc.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/demo/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
125
demo.iml
Normal file
125
demo.iml
Normal file
@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/${project.build.directory}/classes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/${project.build.directory}/test-classes" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.78" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.78" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.78" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.mchange:mchange-commons-java:0.2.15" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.28" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.7.14" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.7.14" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.7.14" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.7.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.4.11" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:2.4.11" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:9.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.22.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:4.5.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.12.23" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:3.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:4.5.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.29" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.3.29" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.postgresql:postgresql:42.3.8" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.checkerframework:checker-qual:3.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.97.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-haproxy:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http2:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-memcache:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-mqtt:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-redis:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-smtp:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-socks:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-stomp:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-xml:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler-proxy:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler-ssl-ocsp:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-rxtx:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-sctp:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-udt:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-epoll:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-kqueue:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns-classes-macos:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-x86_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-aarch_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-x86_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-aarch_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-x86_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-aarch_64:4.1.94.Final" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
120
demo/demo.iml
Normal file
120
demo/demo.iml
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
|
||||
<content url="file://$MODULE_DIR$/..">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../src/test/java" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.78" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.78" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.78" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.mchange:mchange-commons-java:0.2.15" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.28" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.7.14" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.7.14" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.7.14" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.7.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.4.11" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:2.4.11" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:9.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.22.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.8.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:4.5.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.12.23" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:3.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:4.5.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.29" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.3.29" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.7.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.postgresql:postgresql:42.3.8" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.checkerframework:checker-qual:3.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.97.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-haproxy:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http2:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-memcache:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-mqtt:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-redis:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-smtp:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-socks:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-stomp:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-xml:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler-proxy:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler-ssl-ocsp:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-rxtx:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-sctp:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-udt:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-epoll:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-kqueue:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns-classes-macos:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-x86_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-aarch_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-x86_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-aarch_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-x86_64:4.1.94.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-aarch_64:4.1.94.Final" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
91
pom.xml
Normal file
91
pom.xml
Normal file
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.14</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>demo</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>demo</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.5.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.2.2</version>
|
||||
</dependency>
|
||||
<!-- PostgreSQL -->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>4.1.97.Final</version> <!-- 使用最新稳定版本 -->
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.7.14</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
14
src/main/java/com/example/demo/Controller/MyJob.java
Normal file
14
src/main/java/com/example/demo/Controller/MyJob.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.example.demo.Controller;
|
||||
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.boot.autoconfigure.batch.BatchProperties;
|
||||
|
||||
public class MyJob implements Job {
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
System.out.println("任务执行");
|
||||
//存在暂存区
|
||||
}
|
||||
}
|
||||
23
src/main/java/com/example/demo/Controller/SE.java
Normal file
23
src/main/java/com/example/demo/Controller/SE.java
Normal file
@ -0,0 +1,23 @@
|
||||
package com.example.demo.Controller;
|
||||
|
||||
import org.quartz.*;
|
||||
import org.quartz.impl.StdSchedulerFactory;
|
||||
|
||||
public class SE {
|
||||
public static void main(String[] args) throws SchedulerException {
|
||||
JobDetail jobDetail = JobBuilder.newJob(MyJob.class)
|
||||
.withIdentity("myjob","group1")
|
||||
.build();
|
||||
|
||||
Trigger trigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity("mytrigger","group1")
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule("0 */70 * ? *"))
|
||||
.build();
|
||||
|
||||
Scheduler scheduler = new StdSchedulerFactory().getScheduler();
|
||||
|
||||
scheduler.scheduleJob(jobDetail, trigger);
|
||||
|
||||
scheduler.start();
|
||||
}
|
||||
}
|
||||
82
src/main/java/com/example/demo/Controller/Task.java
Normal file
82
src/main/java/com/example/demo/Controller/Task.java
Normal file
@ -0,0 +1,82 @@
|
||||
package com.example.demo.Controller;
|
||||
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.math.*;
|
||||
|
||||
/**
|
||||
* 定时任务的使用
|
||||
* @author
|
||||
**/
|
||||
@Component
|
||||
public class Task {
|
||||
@Scheduled(cron = "20 2/7 * * * ?") //每5秒执行一次
|
||||
public void execute1() {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //设置日期格式
|
||||
System.out.println(df.format(new Date()));
|
||||
}
|
||||
@Scheduled(cron = "40 4/7 * * * ?") //每5秒执行一次
|
||||
public void execute2() {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //设置日期格式
|
||||
System.out.println(df.format(new Date()));
|
||||
}
|
||||
@Scheduled(cron = "0 7/7 * * * ?") //每5秒执行一次
|
||||
public void execute3() {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //设置日期格式
|
||||
System.out.println(df.format(new Date()));
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<String> test1 = test(250);
|
||||
int count = test1.size();
|
||||
for(int i = 0;i < count;i++){
|
||||
System.out.println(test1.get(i));
|
||||
}
|
||||
long a = 23L, b = 24L;
|
||||
long c = a/b;
|
||||
System.out.println(test1.toString());
|
||||
}
|
||||
|
||||
public static List<String> test(int freq){
|
||||
List<String> res = new ArrayList<>();
|
||||
String cron = "";
|
||||
//java找最小公倍数的函数
|
||||
if(freq < 60){
|
||||
cron = freq +" * * * * ?";
|
||||
}
|
||||
int gcd = gcd(freq,60);// 140
|
||||
int lcm = freq * 60 / gcd;//
|
||||
int count = lcm / freq;
|
||||
int last =lcm / 60;
|
||||
int accumulate = 0, before = 0;
|
||||
for(int i = 1;i <= count;i++){
|
||||
before += (accumulate + freq) / 60;
|
||||
accumulate = (accumulate + freq) % 60;
|
||||
cron = "0 " + accumulate + " " + before + "/" + last + " * * ?";
|
||||
res.add(cron);
|
||||
System.out.println(cron);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static int gcd(int x,int y){
|
||||
if(x < y){
|
||||
int temp = x;
|
||||
x = y;
|
||||
y = temp;
|
||||
}
|
||||
int rem = -1;
|
||||
while( x % y != 0){
|
||||
rem = x % y;
|
||||
x = y;
|
||||
y = rem;
|
||||
}
|
||||
return y;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.example.demo.Controller;
|
||||
|
||||
import com.example.demo.Dao.ZyUserDao;
|
||||
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;
|
||||
|
||||
@RestController
|
||||
public class ZyUserController {
|
||||
@Autowired
|
||||
private ZyUserDao zyUserDao;
|
||||
|
||||
@RequestMapping("/all")
|
||||
public String getAllUsers(){
|
||||
return zyUserDao.selectByPrimaryKey("1").toString();
|
||||
}
|
||||
}
|
||||
19
src/main/java/com/example/demo/Controller/hello.java
Normal file
19
src/main/java/com/example/demo/Controller/hello.java
Normal file
@ -0,0 +1,19 @@
|
||||
package com.example.demo.Controller;
|
||||
|
||||
import com.example.demo.Entity.Person;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class hello {
|
||||
@Autowired
|
||||
Person person;
|
||||
@RequestMapping("/person")
|
||||
public Person person(){
|
||||
return person;
|
||||
}
|
||||
|
||||
public String a;
|
||||
//注释
|
||||
}
|
||||
17
src/main/java/com/example/demo/Dao/ZyUserDao.java
Normal file
17
src/main/java/com/example/demo/Dao/ZyUserDao.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.example.demo.Dao;
|
||||
|
||||
import com.example.demo.Entity.ZyUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface ZyUserDao {
|
||||
|
||||
List<ZyUser> getAllUsers();
|
||||
ZyUser selectByPrimaryKey(@Param("id") String id);
|
||||
|
||||
}
|
||||
21
src/main/java/com/example/demo/DemoApplication.java
Normal file
21
src/main/java/com/example/demo/DemoApplication.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.example.demo;
|
||||
|
||||
import com.example.demo.Entity.Person;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableScheduling //开启定时任务
|
||||
public class DemoApplication {
|
||||
public static void main(String[] args) {
|
||||
|
||||
ConfigurableApplicationContext run = SpringApplication.run(DemoApplication.class, args);
|
||||
System.out.println(run.getBeanDefinitionCount());
|
||||
|
||||
System.out.println();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
30
src/main/java/com/example/demo/Entity/Person.java
Normal file
30
src/main/java/com/example/demo/Entity/Person.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.example.demo.Entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@ToString
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "person")
|
||||
public class Person {
|
||||
private String name;
|
||||
private int age;
|
||||
private Date birth;
|
||||
private Pet pet;
|
||||
private String[] interets;
|
||||
private List<String> animals;
|
||||
private Map<String,Integer> score;
|
||||
private Set<Double> salary;
|
||||
// private Map<String,List<Pet>> allPet;
|
||||
|
||||
|
||||
}
|
||||
11
src/main/java/com/example/demo/Entity/Pet.java
Normal file
11
src/main/java/com/example/demo/Entity/Pet.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.example.demo.Entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@ToString
|
||||
@Data
|
||||
public class Pet {
|
||||
private String name;
|
||||
private int age;
|
||||
}
|
||||
10
src/main/java/com/example/demo/Entity/ZyUser.java
Normal file
10
src/main/java/com/example/demo/Entity/ZyUser.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.example.demo.Entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ZyUser {
|
||||
private String zid;
|
||||
private String zname;
|
||||
private String zpwd;
|
||||
}
|
||||
57
src/main/java/com/example/demo/Service/HexToCharArray.java
Normal file
57
src/main/java/com/example/demo/Service/HexToCharArray.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.example.demo.Service;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class HexToCharArray {
|
||||
public static void main(String[] args) {
|
||||
// // 示例16进制字符串的ByteBuffer
|
||||
// ByteBuffer buffer = ByteBuffer.wrap(new byte[]{0x4A, 0x6B, 0x4C, 0x6D});
|
||||
//
|
||||
// // 将 ByteBuffer 转换为字符数组
|
||||
// char[] charArray = byteBufferToCharArray(buffer);
|
||||
//
|
||||
// // 打印字符数组
|
||||
// System.out.println(charArray);
|
||||
|
||||
String hexString = "4A6B4C6D";
|
||||
|
||||
// 将16进制字符串转换为字符数组
|
||||
char[] charArray = hexStringToCharArray(hexString);
|
||||
|
||||
// 打印字符数组
|
||||
System.out.println(charArray);
|
||||
}
|
||||
|
||||
public static char[] byteBufferToCharArray(ByteBuffer buffer) {
|
||||
// 确保读取时从开头开始
|
||||
buffer.rewind();
|
||||
|
||||
// 创建字符数组,每个字节转换为一个字符
|
||||
char[] charArray = new char[buffer.remaining()];
|
||||
|
||||
for (int i = 0; i < charArray.length; i++) {
|
||||
// 逐字节读取并转换为字符
|
||||
charArray[i] = (char) buffer.get();
|
||||
}
|
||||
|
||||
return charArray;
|
||||
}
|
||||
public static char[] hexStringToCharArray(String hexString) {
|
||||
// 每两个十六进制字符表示一个字节,所以字符数组的长度为十六进制字符串长度的一半
|
||||
int length = hexString.length() / 2;
|
||||
char[] charArray = new char[length];
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
// 取出两个十六进制字符并解析为一个字节
|
||||
String hexPair = hexString.substring(2 * i, 2 * i + 2);
|
||||
int byteValue = Integer.parseInt(hexPair, 16);
|
||||
|
||||
// 转换为字符并存入数组
|
||||
charArray[i] = (char) byteValue;
|
||||
}
|
||||
|
||||
return charArray;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
2
src/main/java/com/example/demo/Service/TestService.java
Normal file
2
src/main/java/com/example/demo/Service/TestService.java
Normal file
@ -0,0 +1,2 @@
|
||||
package com.example.demo.Service;public interface TestService {
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
package com.example.demo.Service;public class TestServiceImpl {
|
||||
}
|
||||
54
src/main/java/com/example/demo/Service/nettyClient.java
Normal file
54
src/main/java/com/example/demo/Service/nettyClient.java
Normal file
@ -0,0 +1,54 @@
|
||||
package com.example.demo.Service;
|
||||
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.EventLoopGroup;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
import io.netty.channel.socket.SocketChannel;
|
||||
import io.netty.channel.socket.nio.NioSocketChannel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class nettyClient {
|
||||
|
||||
private final String host = "localhost"; // 目标服务器地址
|
||||
private final int port = 8081; // 目标服务器端口
|
||||
|
||||
public void start() throws InterruptedException {
|
||||
// 1. 创建 EventLoopGroup 用于管理客户端的 NIO 线程
|
||||
EventLoopGroup group = new NioEventLoopGroup();
|
||||
|
||||
try {
|
||||
// 2. Bootstrap 用于创建客户端
|
||||
Bootstrap bootstrap = new Bootstrap();
|
||||
bootstrap.group(group) // 指定线程组
|
||||
.channel(NioSocketChannel.class) // 指定使用 NIO 传输的Channel
|
||||
.option(ChannelOption.SO_KEEPALIVE, true) // 保持长连接
|
||||
.handler(new ChannelInitializer<SocketChannel>() {
|
||||
@Override
|
||||
protected void initChannel(SocketChannel ch) {
|
||||
// 3. 配置客户端的 ChannelHandler
|
||||
ch.pipeline().addLast(new nettyClientHandler());
|
||||
}
|
||||
});
|
||||
|
||||
// 4. 连接服务器
|
||||
Channel channel = bootstrap.connect(host, port).sync().channel();
|
||||
|
||||
// 5. 向服务器发送消息
|
||||
channel.writeAndFlush("Hello, Netty Server!");
|
||||
|
||||
// 6. 等待连接关闭
|
||||
channel.closeFuture().sync();
|
||||
} finally {
|
||||
// 7. 关闭线程组
|
||||
group.shutdownGracefully();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
new nettyClient().start();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.example.demo.Service;
|
||||
|
||||
|
||||
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
|
||||
public class nettyClientHandler extends ChannelInboundHandlerAdapter {
|
||||
|
||||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) {
|
||||
// 处理服务器的响应
|
||||
System.out.println("Received message from server: " + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||
// 处理异常
|
||||
cause.printStackTrace();
|
||||
ctx.close();
|
||||
}
|
||||
}
|
||||
51
src/main/java/com/example/demo/Service/nettyServer.java
Normal file
51
src/main/java/com/example/demo/Service/nettyServer.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.example.demo.Service;
|
||||
|
||||
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoopGroup;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
import io.netty.channel.socket.SocketChannel;
|
||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||
import io.netty.handler.codec.string.StringDecoder;
|
||||
import io.netty.handler.codec.string.StringEncoder;
|
||||
|
||||
public class nettyServer {
|
||||
private final int port;
|
||||
|
||||
public nettyServer(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public void start() throws InterruptedException {
|
||||
EventLoopGroup bossGroup = new NioEventLoopGroup();
|
||||
EventLoopGroup workerGroup = new NioEventLoopGroup();
|
||||
try {
|
||||
ServerBootstrap b = new ServerBootstrap();
|
||||
b.group(bossGroup, workerGroup)
|
||||
.channel(NioServerSocketChannel.class)
|
||||
.childHandler(new ChannelInitializer<SocketChannel>() {
|
||||
@Override
|
||||
public void initChannel(SocketChannel ch) {
|
||||
ChannelPipeline p = ch.pipeline();
|
||||
p.addLast(new StringDecoder());
|
||||
p.addLast(new StringEncoder());
|
||||
p.addLast(new nettyServerHandler());
|
||||
}
|
||||
});
|
||||
|
||||
ChannelFuture f = b.bind(port).sync();
|
||||
System.out.println("Netty server started on port " + port);
|
||||
f.channel().closeFuture().sync();
|
||||
} finally {
|
||||
bossGroup.shutdownGracefully();
|
||||
workerGroup.shutdownGracefully();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
new nettyServer(8081).start();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.example.demo.Service;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
|
||||
public class nettyServerHandler extends ChannelInboundHandlerAdapter {
|
||||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) {
|
||||
System.out.println("Received message: " + msg);
|
||||
ctx.writeAndFlush("Hello from Netty Server!\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||
cause.printStackTrace();
|
||||
ctx.close();
|
||||
}
|
||||
}
|
||||
2
src/main/java/com/example/demo/config/RedisConfig.java
Normal file
2
src/main/java/com/example/demo/config/RedisConfig.java
Normal file
@ -0,0 +1,2 @@
|
||||
package com.example.demo.config;public class RedisConfig {
|
||||
}
|
||||
2
src/main/java/com/example/demo/utils/LatLonUtil.java
Normal file
2
src/main/java/com/example/demo/utils/LatLonUtil.java
Normal file
@ -0,0 +1,2 @@
|
||||
package com.example.demo.utils;public class LatLonUtil {
|
||||
}
|
||||
2
src/main/java/com/example/demo/utils/TimeUtil.java
Normal file
2
src/main/java/com/example/demo/utils/TimeUtil.java
Normal file
@ -0,0 +1,2 @@
|
||||
package com.example.demo.utils;public class TimeUtil {
|
||||
}
|
||||
2
src/main/java/com/example/demo/utils/testMap.java
Normal file
2
src/main/java/com/example/demo/utils/testMap.java
Normal file
@ -0,0 +1,2 @@
|
||||
package com.example.demo.utils;public class testMap {
|
||||
}
|
||||
2
src/main/java/com/example/demo/utils/testThreadPool.java
Normal file
2
src/main/java/com/example/demo/utils/testThreadPool.java
Normal file
@ -0,0 +1,2 @@
|
||||
package com.example.demo.utils;public class testThreadPool {
|
||||
}
|
||||
16
src/main/resources/application.properties
Normal file
16
src/main/resources/application.properties
Normal file
@ -0,0 +1,16 @@
|
||||
#spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
#spring.datasource.url=jdbc:mysql://117.50.194.112:3306/zhangzichun?useUnicode=true&useSSL=false&serverTimezone=GMT&characterEncoding=UTF-8
|
||||
#spring.datasource.username=ot
|
||||
#spring.datasource.password=xulovezhang
|
||||
#spring.jpa.show-sql=true
|
||||
#spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
|
||||
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
|
||||
spring.datasource.username=postgres
|
||||
spring.datasource.password=postgres
|
||||
|
||||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
|
||||
|
||||
#??mapper xml???
|
||||
mybatis-plus.mapper-locations=classpath:mappers/*.xml
|
||||
23
src/main/resources/application.yaml
Normal file
23
src/main/resources/application.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
#person:
|
||||
# name: 花花
|
||||
# age: 2
|
||||
# birth: 2010/10/10
|
||||
# pet:
|
||||
# name: dd
|
||||
# age: 1
|
||||
# interets:
|
||||
# - 读书
|
||||
# - 看报
|
||||
# - 学习
|
||||
# animals: {猫, 狗, 鸟}
|
||||
# score:
|
||||
# chin: 90
|
||||
# math: 100
|
||||
# salary: [100.99,200.99,300.99]
|
||||
spring:
|
||||
mvc:
|
||||
static-path-pattern: /res/**
|
||||
|
||||
|
||||
resources:
|
||||
static-locations: [classpath:/sta/]
|
||||
34
src/main/resources/mappers/ZyUserDao.xml
Normal file
34
src/main/resources/mappers/ZyUserDao.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.example.demo.Dao.ZyUserDao">
|
||||
<!-- <resultMap id="userMap" type="com.example.demo.Entity.ZyUser">-->
|
||||
<!-- <id column="id" property="id"></id>-->
|
||||
<!-- <result column="zname" property="zNAME"></result>-->
|
||||
<!-- <result column="zpwd" property="zPwd"></result>-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
zid, zname, zpwd
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectByPrimaryKey" resultMap="com.example.demo.Entity.ZyUser" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from public.zy_user where zid = #{id}
|
||||
</select>
|
||||
|
||||
<!-- <select id="getAllUsers" resultType="com.example.demo.Entity.ZyUser">-->
|
||||
<!-- select zname as zName,zpwd as zPwd from public.zy_user where 1=1-->
|
||||
<!--<!– <if test="id!=null">–>-->
|
||||
<!--<!– AND id like concat ('%',#{id},'%')–>-->
|
||||
<!--<!– </if>–>-->
|
||||
<!-- <!– <if test="energy!=null and energy !='' ">–>-->
|
||||
<!-- <!– AND energy like concat ('%',#{energy},'%')–>-->
|
||||
<!-- <!– </if>–>-->
|
||||
<!-- </select>-->
|
||||
</mapper>
|
||||
0
src/main/resources/mybatis-config.xml
Normal file
0
src/main/resources/mybatis-config.xml
Normal file
BIN
src/main/resources/sta/a.jpg
Normal file
BIN
src/main/resources/sta/a.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 183 KiB |
13
src/test/java/com/example/demo/DemoApplicationTests.java
Normal file
13
src/test/java/com/example/demo/DemoApplicationTests.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.example.demo;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class DemoApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
52
target/classes/META-INF/spring-configuration-metadata.json
Normal file
52
target/classes/META-INF/spring-configuration-metadata.json
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"groups": [
|
||||
{
|
||||
"name": "person",
|
||||
"type": "com.example.demo.Entity.Person",
|
||||
"sourceType": "com.example.demo.Entity.Person"
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"name": "person.age",
|
||||
"type": "java.lang.Integer",
|
||||
"sourceType": "com.example.demo.Entity.Person"
|
||||
},
|
||||
{
|
||||
"name": "person.animals",
|
||||
"type": "java.util.List<java.lang.String>",
|
||||
"sourceType": "com.example.demo.Entity.Person"
|
||||
},
|
||||
{
|
||||
"name": "person.birth",
|
||||
"type": "java.util.Date",
|
||||
"sourceType": "com.example.demo.Entity.Person"
|
||||
},
|
||||
{
|
||||
"name": "person.interets",
|
||||
"type": "java.lang.String[]",
|
||||
"sourceType": "com.example.demo.Entity.Person"
|
||||
},
|
||||
{
|
||||
"name": "person.name",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "com.example.demo.Entity.Person"
|
||||
},
|
||||
{
|
||||
"name": "person.pet",
|
||||
"type": "com.example.demo.Entity.Pet",
|
||||
"sourceType": "com.example.demo.Entity.Person"
|
||||
},
|
||||
{
|
||||
"name": "person.salary",
|
||||
"type": "java.util.Set<java.lang.Double>",
|
||||
"sourceType": "com.example.demo.Entity.Person"
|
||||
},
|
||||
{
|
||||
"name": "person.score",
|
||||
"type": "java.util.Map<java.lang.String,java.lang.Integer>",
|
||||
"sourceType": "com.example.demo.Entity.Person"
|
||||
}
|
||||
],
|
||||
"hints": []
|
||||
}
|
||||
16
target/classes/application.properties
Normal file
16
target/classes/application.properties
Normal file
@ -0,0 +1,16 @@
|
||||
#spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
#spring.datasource.url=jdbc:mysql://117.50.194.112:3306/zhangzichun?useUnicode=true&useSSL=false&serverTimezone=GMT&characterEncoding=UTF-8
|
||||
#spring.datasource.username=ot
|
||||
#spring.datasource.password=xulovezhang
|
||||
#spring.jpa.show-sql=true
|
||||
#spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
|
||||
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
|
||||
spring.datasource.username=postgres
|
||||
spring.datasource.password=postgres
|
||||
|
||||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
|
||||
|
||||
#??mapper xml???
|
||||
mybatis-plus.mapper-locations=classpath:mappers/*.xml
|
||||
23
target/classes/application.yaml
Normal file
23
target/classes/application.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
#person:
|
||||
# name: 花花
|
||||
# age: 2
|
||||
# birth: 2010/10/10
|
||||
# pet:
|
||||
# name: dd
|
||||
# age: 1
|
||||
# interets:
|
||||
# - 读书
|
||||
# - 看报
|
||||
# - 学习
|
||||
# animals: {猫, 狗, 鸟}
|
||||
# score:
|
||||
# chin: 90
|
||||
# math: 100
|
||||
# salary: [100.99,200.99,300.99]
|
||||
spring:
|
||||
mvc:
|
||||
static-path-pattern: /res/**
|
||||
|
||||
|
||||
resources:
|
||||
static-locations: [classpath:/sta/]
|
||||
34
target/classes/mappers/ZyUserDao.xml
Normal file
34
target/classes/mappers/ZyUserDao.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.example.demo.Dao.ZyUserDao">
|
||||
<!-- <resultMap id="userMap" type="com.example.demo.Entity.ZyUser">-->
|
||||
<!-- <id column="id" property="id"></id>-->
|
||||
<!-- <result column="zname" property="zNAME"></result>-->
|
||||
<!-- <result column="zpwd" property="zPwd"></result>-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
zid, zname, zpwd
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectByPrimaryKey" resultMap="com.example.demo.Entity.ZyUser" parameterType="java.lang.String">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from public.zy_user where zid = #{id}
|
||||
</select>
|
||||
|
||||
<!-- <select id="getAllUsers" resultType="com.example.demo.Entity.ZyUser">-->
|
||||
<!-- select zname as zName,zpwd as zPwd from public.zy_user where 1=1-->
|
||||
<!--<!– <if test="id!=null">–>-->
|
||||
<!--<!– AND id like concat ('%',#{id},'%')–>-->
|
||||
<!--<!– </if>–>-->
|
||||
<!-- <!– <if test="energy!=null and energy !='' ">–>-->
|
||||
<!-- <!– AND energy like concat ('%',#{energy},'%')–>-->
|
||||
<!-- <!– </if>–>-->
|
||||
<!-- </select>-->
|
||||
</mapper>
|
||||
0
target/classes/mybatis-config.xml
Normal file
0
target/classes/mybatis-config.xml
Normal file
BIN
target/classes/sta/a.jpg
Normal file
BIN
target/classes/sta/a.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 183 KiB |
Loading…
Reference in New Issue
Block a user