mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 10:36:31 +08:00
重命名 orange-demo-uaa 为 orange-demo-multi-uaa
This commit is contained in:
@@ -0,0 +1,230 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<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$/target/generated-sources/annotations" isTestSource="false" generated="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-alibaba-commons:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-api:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.spring:spring-context-support:1.0.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-ribbon:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon:2.3.0" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.ribbon:ribbon-transport:2.3.0" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.reactivex:rxnetty-contexts:0.4.9" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.reactivex:rxnetty-servo:0.4.9" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: javax.inject:javax.inject:1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.reactivex:rxnetty:0.4.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon-core:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon-httpclient:2.3.0" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey:jersey-client:1.19.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey:jersey-core:1.19.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: javax.ws.rs:jsr311-api:1.1.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey.contribs:jersey-apache-client4:1.19.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.servo:servo-core:0.12.21" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.netflix-commons:netflix-commons-util:0.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.ribbon:ribbon-loadbalancer:2.3.0" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.netflix-commons:netflix-statistics:0.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava:1.3.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.13.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-starter-server:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-server:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-webflux:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-reactor-netty:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor.netty:reactor-netty:0.9.19.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http2:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler-proxy:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-socks:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-epoll:linux-x86_64:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webflux:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.synchronoss.cloud:nio-multipart-parser:1.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.synchronoss.cloud:nio-stream-storage:1.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.12.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.12.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor.addons:reactor-extra:3.3.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.16.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-server-ui:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-server-cloud:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-freemarker:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.31" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-jul:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.12" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-starter-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-hystrix:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-httpclient:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-core:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-serialization:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.fasterxml.jackson.module:jackson-module-afterburner:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-metrics-event-stream:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-javanica:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.commons:commons-lang3:3.10" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.mapstruct:mapstruct-processor:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-recipes:4.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.5.3-beta" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.luben:zstd-jni:1.4.3-1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.lz4:lz4-java:1.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.lmax:disruptor:3.4.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.skywalking:apm-toolkit-log4j-2.x:7.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" 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.16.1" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.3" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" 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.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>framework</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>admin-monitor</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>admin-monitor</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<!--nacos 服务发现客户端-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-dependencies</artifactId>
|
||||
<version>${spring-boot-admin.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.orangeforms.adminmonitor;
|
||||
|
||||
import de.codecentric.boot.admin.server.config.EnableAdminServer;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* 服务指标监控启动类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableAdminServer
|
||||
@EnableDiscoveryClient
|
||||
public class AdminMonitorApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AdminMonitorApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
server:
|
||||
port: 8769
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: admin-monitor
|
||||
profiles:
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: localhost:8848
|
||||
config:
|
||||
server-addr: localhost:8848
|
||||
@@ -0,0 +1,216 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<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$/target/generated-sources/annotations" isTestSource="false" generated="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="common-core" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: joda-time:joda-time:2.9.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-csv:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.6.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.76" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.jimmyshi:bean-query:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-all:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.thoughtworks.qdox:qdox:2.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-freemarker:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.10.RELEASE" 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.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.31" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-jul:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.12" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-starter-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.spring:spring-context-support:1.0.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-api:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-hystrix:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-httpclient:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-core:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava:1.3.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-serialization:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.fasterxml.jackson.module:jackson-module-afterburner:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-metrics-event-stream:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-javanica:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.mapstruct:mapstruct-processor:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-recipes:4.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.5.3-beta" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.luben:zstd-jni:1.4.3-1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.lz4:lz4-java:1.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.lmax:disruptor:3.4.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.skywalking:apm-toolkit-log4j-2.x:7.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" 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.16.1" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.3" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" 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.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>framework</artifactId>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>apidoc-tools</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>apidoc-tools</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.qdox</groupId>
|
||||
<artifactId>qdox</artifactId>
|
||||
<version>${qdox.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.orangeforms.apidoc.tools;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orangeforms.apidoc.tools.codeparser.ApiCodeConfig;
|
||||
import com.orangeforms.apidoc.tools.codeparser.ApiCodeParser;
|
||||
import com.orangeforms.apidoc.tools.export.ApiPostmanExporter;
|
||||
import freemarker.template.TemplateException;
|
||||
import org.springframework.util.StreamUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class ExportApiApp {
|
||||
|
||||
public static void main(String[] args) throws IOException, TemplateException {
|
||||
// 在第一次导出时,需要打开export-api-config.json配置文件,
|
||||
// 修改其中的工程根目录配置项(projectRootPath),其他配置保持不变即可。
|
||||
InputStream in = ExportApiApp.class.getResourceAsStream("/export-api-config.json");
|
||||
String jsonData = StreamUtils.copyToString(in, StandardCharsets.UTF_8);
|
||||
ApiCodeConfig apiCodeConfig = JSON.parseObject(jsonData, ApiCodeConfig.class);
|
||||
ApiCodeParser apiCodeParser = new ApiCodeParser(apiCodeConfig);
|
||||
ApiCodeParser.ApiProject project = apiCodeParser.doParse();
|
||||
ApiPostmanExporter exporter = new ApiPostmanExporter();
|
||||
// 将下面的目录改为实际输出目录。
|
||||
exporter.doGenerate(project, "/xxx/Desktop/1.json");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.orangeforms.apidoc.tools;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orangeforms.apidoc.tools.codeparser.ApiCodeConfig;
|
||||
import com.orangeforms.apidoc.tools.codeparser.ApiCodeParser;
|
||||
import com.orangeforms.apidoc.tools.export.ApiDocExporter;
|
||||
import freemarker.template.TemplateException;
|
||||
import org.springframework.util.StreamUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class ExportDocApp {
|
||||
|
||||
public static void main(String[] args) throws IOException, TemplateException {
|
||||
// 在第一次导出时,需要打开export-api-config.json配置文件,
|
||||
// 修改其中的工程根目录配置项(projectRootPath),其他配置保持不变即可。
|
||||
InputStream in = ExportDocApp.class.getResourceAsStream("/export-api-config.json");
|
||||
String jsonData = StreamUtils.copyToString(in, StandardCharsets.UTF_8);
|
||||
ApiCodeConfig apiCodeConfig = JSON.parseObject(jsonData, ApiCodeConfig.class);
|
||||
ApiCodeParser apiCodeParser = new ApiCodeParser(apiCodeConfig);
|
||||
ApiCodeParser.ApiProject project = apiCodeParser.doParse();
|
||||
ApiDocExporter exporter = new ApiDocExporter();
|
||||
// 将下面的目录改为实际输出目录。
|
||||
exporter.doGenerate(project, "/xxx/Desktop/2.md");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.orangeforms.apidoc.tools.codeparser;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 解析项目中接口信息的配置对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
public class ApiCodeConfig {
|
||||
|
||||
/**
|
||||
* 项目名称。
|
||||
*/
|
||||
private String projectName;
|
||||
/**
|
||||
* 项目的基础包名,如(com.demo.multi)。
|
||||
*/
|
||||
private String basePackage;
|
||||
/**
|
||||
* 项目在本地文件系统中的根目录。这里需要注意的是,Windows用户请务必使用反斜杠作为目录分隔符。
|
||||
* 如:"e:/mypath/OrangeSingleDemo","/Users/xxx/OrangeSingleDemo"。
|
||||
*/
|
||||
private String projectRootPath;
|
||||
/**
|
||||
* 是否为微服务项目。
|
||||
*/
|
||||
private Boolean microService;
|
||||
/**
|
||||
* 服务配置列表。对于单体服务,至少也会有一个ServiceConfig对象。
|
||||
*/
|
||||
private List<ServiceConfig> serviceList;
|
||||
|
||||
@Data
|
||||
public static class ServiceConfig {
|
||||
/**
|
||||
* 服务名称。
|
||||
*/
|
||||
private String serviceName;
|
||||
/**
|
||||
* 服务中文显示名称。
|
||||
*/
|
||||
private String showName;
|
||||
/**
|
||||
* 服务所在目录,相对于工程目录的子目录。
|
||||
*/
|
||||
private String servicePath;
|
||||
/**
|
||||
* 仅用于微服务工程。通常为服务路由路径,如:/admin/coursepaper。服务内的接口,都会加上该路径前缀。
|
||||
*/
|
||||
private String serviceRequestPath;
|
||||
/**
|
||||
* 服务的端口号。
|
||||
*/
|
||||
private String port;
|
||||
/**
|
||||
* Api Controller信息列表。
|
||||
*/
|
||||
private List<ControllerInfo> controllerInfoList;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ControllerInfo {
|
||||
/**
|
||||
* Controller.java等接口文件的所在目录。该目录仅为相对于服务代码目录的子目录。
|
||||
* 目录分隔符请务必使用反斜杠。如:"/com/orange/demo/app/controller"。
|
||||
*/
|
||||
private String path;
|
||||
/**
|
||||
* 如果一个服务内,存在多个Controller目录,将再次生成二级子目录,目录名为groupName。(可使用中文)
|
||||
*/
|
||||
private String groupName;
|
||||
/**
|
||||
* 在当前Controller目录下,需要忽略的Controller列表 (只写类名即可)。如:LoginController。
|
||||
*/
|
||||
private Set<String> skipControllers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,672 @@
|
||||
package com.orangeforms.apidoc.tools.codeparser;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.orangeforms.common.core.object.Tuple2;
|
||||
import com.orangeforms.apidoc.tools.exception.ApiCodeConfigParseException;
|
||||
import com.thoughtworks.qdox.JavaProjectBuilder;
|
||||
import com.thoughtworks.qdox.model.*;
|
||||
import com.thoughtworks.qdox.model.impl.DefaultJavaParameterizedType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 解析项目中的接口信息,以及关联的Model、Dto和Mapper,主要用于生成接口文档。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public class ApiCodeParser {
|
||||
|
||||
private static final String PATH_SEPERATOR = "/";
|
||||
private static final String REQUEST_MAPPING = "RequestMapping";
|
||||
private static final String FULL_REQUEST_MAPPING = "org.springframework.web.bind.annotation.RequestMapping";
|
||||
private static final String GET_MAPPING = "GetMapping";
|
||||
private static final String FULL_GET_MAPPING = "org.springframework.web.bind.annotation.GetMapping";
|
||||
private static final String POST_MAPPING = "PostMapping";
|
||||
private static final String FULL_POST_MAPPING = "org.springframework.web.bind.annotation.PostMapping";
|
||||
private static final String VALUE_PROP = "value";
|
||||
private static final String REQUIRED_PROP = "required";
|
||||
private static final String DELETED_COLUMN = "DeletedFlagColumn";
|
||||
|
||||
/**
|
||||
* 忽略微服务间标准调用接口的导出。
|
||||
*/
|
||||
private static final Set<String> IGNORED_API_METHOD_SET = new HashSet<>(8);
|
||||
|
||||
static {
|
||||
IGNORED_API_METHOD_SET.add("listByIds");
|
||||
IGNORED_API_METHOD_SET.add("getById");
|
||||
IGNORED_API_METHOD_SET.add("existIds");
|
||||
IGNORED_API_METHOD_SET.add("existId");
|
||||
IGNORED_API_METHOD_SET.add("deleteById");
|
||||
IGNORED_API_METHOD_SET.add("deleteBy");
|
||||
IGNORED_API_METHOD_SET.add("listBy");
|
||||
IGNORED_API_METHOD_SET.add("listMapBy");
|
||||
IGNORED_API_METHOD_SET.add("listByNotInList");
|
||||
IGNORED_API_METHOD_SET.add("getBy");
|
||||
IGNORED_API_METHOD_SET.add("countBy");
|
||||
IGNORED_API_METHOD_SET.add("aggregateBy");
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础配置。
|
||||
*/
|
||||
private ApiCodeConfig config;
|
||||
/**
|
||||
* 工程对象。
|
||||
*/
|
||||
private ApiProject apiProject;
|
||||
/**
|
||||
* 项目中所有的解析后Java文件,key是Java对象的全名,如:com.orangeforms.xxxx.Student。
|
||||
*/
|
||||
private final Map<String, JavaClass> projectJavaClassMap = new HashMap<>(128);
|
||||
/**
|
||||
* 存储服务数据。key为配置的serviceName。
|
||||
*/
|
||||
private final Map<String, InternalServiceData> serviceDataMap = new HashMap<>(8);
|
||||
|
||||
/**
|
||||
* 构造函数。
|
||||
*
|
||||
* @param config 配置对象。
|
||||
*/
|
||||
public ApiCodeParser(ApiCodeConfig config) {
|
||||
this.config = config;
|
||||
// 验证配置中的数据是否正确,出现错误直接抛出运行时异常。
|
||||
this.verifyConfigData();
|
||||
// 将配置文件中所有目录相关的参数,全部规格化处理,后续的使用中不用再做处理了。
|
||||
this.normalizeConfigPath();
|
||||
for (ApiCodeConfig.ServiceConfig serviceConfig : config.getServiceList()) {
|
||||
InternalServiceData serviceData = new InternalServiceData();
|
||||
// 仅有微服务项目,需要添加服务路由路径。
|
||||
if (StrUtil.isNotBlank(serviceConfig.getServiceRequestPath())) {
|
||||
String serviceRequestPath = "";
|
||||
if (!serviceRequestPath.equals(PATH_SEPERATOR)) {
|
||||
serviceRequestPath = normalizePath(serviceConfig.getServiceRequestPath());
|
||||
}
|
||||
serviceData.setServiceRequestPath(serviceRequestPath);
|
||||
}
|
||||
serviceDataMap.put(serviceConfig.getServiceName(), serviceData);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行解析操作。
|
||||
*
|
||||
* @return 解析后的工程对象。
|
||||
*/
|
||||
public ApiProject doParse() throws IOException {
|
||||
// 先把工程完整编译一遍,以便工程内的Java对象的引用信息更加完整。
|
||||
this.parseProject();
|
||||
// 开始逐级推演。
|
||||
apiProject = new ApiProject();
|
||||
apiProject.setProjectName(config.getProjectName());
|
||||
apiProject.setMicroService(config.getMicroService());
|
||||
apiProject.setServiceList(new LinkedList<>());
|
||||
for (ApiCodeConfig.ServiceConfig serviceConfig : config.getServiceList()) {
|
||||
ApiService apiService = this.parseService(serviceConfig);
|
||||
apiProject.getServiceList().add(apiService);
|
||||
}
|
||||
return apiProject;
|
||||
}
|
||||
|
||||
private void parseProject() throws IOException {
|
||||
JavaProjectBuilder javaProjectBuilder = new JavaProjectBuilder();
|
||||
javaProjectBuilder.setEncoding(StandardCharsets.UTF_8.name());
|
||||
javaProjectBuilder.addSourceTree(new File(config.getProjectRootPath()));
|
||||
// 全部导入,便于后续解析中使用和检索。
|
||||
for (JavaClass javaClass : javaProjectBuilder.getClasses()) {
|
||||
projectJavaClassMap.put(javaClass.getFullyQualifiedName(), javaClass);
|
||||
}
|
||||
}
|
||||
|
||||
private ApiService parseService(ApiCodeConfig.ServiceConfig serviceConfig) {
|
||||
InternalServiceData serviceData = serviceDataMap.get(serviceConfig.getServiceName());
|
||||
ApiService apiService = new ApiService();
|
||||
apiService.setServiceName(serviceConfig.getServiceName());
|
||||
apiService.setShowName(serviceConfig.getShowName());
|
||||
apiService.setPort(serviceConfig.getPort());
|
||||
List<ApiCodeConfig.ControllerInfo> controllerInfoList = serviceConfig.getControllerInfoList();
|
||||
// 准备解析接口文件
|
||||
for (ApiCodeConfig.ControllerInfo controllerInfo : controllerInfoList) {
|
||||
JavaProjectBuilder javaControllerBuilder = new JavaProjectBuilder();
|
||||
javaControllerBuilder.addSourceTree(new File(controllerInfo.getPath()));
|
||||
for (JavaClass javaClass : javaControllerBuilder.getClasses()) {
|
||||
if (controllerInfo.getSkipControllers() != null
|
||||
&& controllerInfo.getSkipControllers().contains(javaClass.getName())) {
|
||||
continue;
|
||||
}
|
||||
ApiClass apiClass = this.parseApiClass(controllerInfo, javaClass.getFullyQualifiedName(), serviceData);
|
||||
if (apiClass != null) {
|
||||
// 如果配置中,为当前ControllerInfo添加了groupName属性,
|
||||
// 所有的生成后接口都会位于serviceName/groupName子目录,否则,都直接位于当前服务的子目录。
|
||||
if (StrUtil.isBlank(apiClass.getGroupName())) {
|
||||
apiService.getDefaultGroupClassSet().add(apiClass);
|
||||
} else {
|
||||
Set<ApiClass> groupedClassList = apiService.getGroupedClassMap()
|
||||
.computeIfAbsent(apiClass.getGroupName(), k -> new TreeSet<>());
|
||||
groupedClassList.add(apiClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return apiService;
|
||||
}
|
||||
|
||||
private ApiClass parseApiClass(
|
||||
ApiCodeConfig.ControllerInfo controllerInfo,
|
||||
String classFullname,
|
||||
InternalServiceData serviceData) {
|
||||
// 去包含工程全部Class的Map中,找到当前ControllerClass。
|
||||
// 之所以这样做,主要是因为全工程分析controller文件,会包含更多更精确的对象关联信息。
|
||||
JavaClass controllerClass = this.projectJavaClassMap.get(classFullname);
|
||||
List<JavaAnnotation> classAnnotations = controllerClass.getAnnotations();
|
||||
boolean hasControllerAnnotation = false;
|
||||
String requestPath = "";
|
||||
for (JavaAnnotation annotation : classAnnotations) {
|
||||
String annotationName = annotation.getType().getValue();
|
||||
if (this.isRequestMapping(annotationName) && annotation.getNamedParameter(VALUE_PROP) != null) {
|
||||
requestPath = StrUtil.removeAll(
|
||||
annotation.getNamedParameter(VALUE_PROP).toString(), "\"");
|
||||
if (requestPath.equals(PATH_SEPERATOR) || StrUtil.isBlank(requestPath)) {
|
||||
requestPath = "";
|
||||
} else {
|
||||
requestPath = normalizePath(requestPath);
|
||||
}
|
||||
}
|
||||
if (isController(annotationName)) {
|
||||
hasControllerAnnotation = true;
|
||||
}
|
||||
}
|
||||
if (!hasControllerAnnotation) {
|
||||
return null;
|
||||
}
|
||||
requestPath = serviceData.getServiceRequestPath() + requestPath;
|
||||
ApiClass apiClass = new ApiClass();
|
||||
apiClass.setName(controllerClass.getName());
|
||||
apiClass.setFullName(controllerClass.getFullyQualifiedName());
|
||||
apiClass.setComment(controllerClass.getComment());
|
||||
apiClass.setGroupName(controllerInfo.getGroupName());
|
||||
apiClass.setRequestPath(requestPath);
|
||||
List<ApiMethod> methodList = this.parseApiMethodList(apiClass, controllerClass);
|
||||
apiClass.setMethodList(methodList);
|
||||
return apiClass;
|
||||
}
|
||||
|
||||
private boolean needToIgnore(JavaMethod method) {
|
||||
return !method.isPublic() || method.isStatic() || IGNORED_API_METHOD_SET.contains(method.getName());
|
||||
}
|
||||
|
||||
private List<ApiMethod> parseApiMethodList(ApiClass apiClass, JavaClass javaClass) {
|
||||
List<ApiMethod> apiMethodList = new LinkedList<>();
|
||||
List<JavaMethod> methodList = javaClass.getMethods();
|
||||
for (JavaMethod method : methodList) {
|
||||
if (this.needToIgnore(method)) {
|
||||
continue;
|
||||
}
|
||||
List<JavaAnnotation> methodAnnotations = method.getAnnotations();
|
||||
Tuple2<String, String> result = this.parseRequestPathAndHttpMethod(methodAnnotations);
|
||||
String methodRequestPath = result.getFirst();
|
||||
String httpMethod = result.getSecond();
|
||||
if (StrUtil.isNotBlank(methodRequestPath)) {
|
||||
ApiMethod apiMethod = new ApiMethod();
|
||||
apiMethod.setName(method.getName());
|
||||
apiMethod.setComment(method.getComment());
|
||||
apiMethod.setHttpMethod(httpMethod);
|
||||
methodRequestPath = StrUtil.removeAll(methodRequestPath, "\"");
|
||||
methodRequestPath = apiClass.getRequestPath() + normalizePath(methodRequestPath);
|
||||
apiMethod.setRequestPath(methodRequestPath);
|
||||
apiMethod.setPathList(StrUtil.splitTrim(apiMethod.getRequestPath(), PATH_SEPERATOR));
|
||||
if (apiMethod.getRequestPath().contains("/listDict")) {
|
||||
apiMethod.setListDictUrl(true);
|
||||
} else if (apiMethod.getRequestPath().endsWith("/list")
|
||||
|| apiMethod.getRequestPath().endsWith("/listWithGroup")
|
||||
|| apiMethod.getRequestPath().contains("/listNotIn")
|
||||
|| apiMethod.getRequestPath().contains("/list")) {
|
||||
apiMethod.setListUrl(true);
|
||||
} else if (apiMethod.getRequestPath().contains("/doLogin")) {
|
||||
apiMethod.setLoginUrl(true);
|
||||
}
|
||||
JavaClass returnClass = method.getReturns();
|
||||
if (returnClass.isVoid()) {
|
||||
apiMethod.setReturnString("void");
|
||||
} else {
|
||||
apiMethod.setReturnString(returnClass.getGenericValue());
|
||||
}
|
||||
apiMethodList.add(apiMethod);
|
||||
List<ApiArgument> apiArgumentList = this.parseApiMethodArgumentList(method);
|
||||
apiMethod.setArgumentList(apiArgumentList);
|
||||
this.classifyArgumentList(apiMethod, apiArgumentList);
|
||||
}
|
||||
}
|
||||
return apiMethodList;
|
||||
}
|
||||
|
||||
private void classifyArgumentList(ApiMethod apiMethod, List<ApiArgument> apiArgumentList) {
|
||||
for (ApiArgument arg : apiArgumentList) {
|
||||
if (arg.getAnnotationType() == ApiArgumentAnnotationType.REQUEST_PARAM) {
|
||||
if (arg.uploadFileParam) {
|
||||
apiMethod.getUploadParamArgumentList().add(arg);
|
||||
} else {
|
||||
apiMethod.getQueryParamArgumentList().add(arg);
|
||||
}
|
||||
}
|
||||
if (arg.getAnnotationType() != ApiArgumentAnnotationType.REQUEST_PARAM) {
|
||||
apiMethod.getJsonParamArgumentList().add(arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Tuple2<String, String> parseRequestPathAndHttpMethod(List<JavaAnnotation> methodAnnotations) {
|
||||
for (JavaAnnotation annotation : methodAnnotations) {
|
||||
String annotationName = annotation.getType().getValue();
|
||||
if (GET_MAPPING.equals(annotationName) || FULL_GET_MAPPING.equals(annotationName)) {
|
||||
String methodRequestPath = annotation.getNamedParameter(VALUE_PROP).toString();
|
||||
String httpMethod = "GET";
|
||||
return new Tuple2<>(methodRequestPath, httpMethod);
|
||||
}
|
||||
if (POST_MAPPING.equals(annotationName) || FULL_POST_MAPPING.equals(annotationName)) {
|
||||
String methodRequestPath = annotation.getNamedParameter(VALUE_PROP).toString();
|
||||
String httpMethod = "POST";
|
||||
return new Tuple2<>(methodRequestPath, httpMethod);
|
||||
}
|
||||
}
|
||||
return new Tuple2<>(null, null);
|
||||
}
|
||||
|
||||
private List<ApiArgument> parseApiMethodArgumentList(JavaMethod javaMethod) {
|
||||
List<ApiArgument> apiArgumentList = new LinkedList<>();
|
||||
List<JavaParameter> parameterList = javaMethod.getParameters();
|
||||
if (CollUtil.isEmpty(parameterList)) {
|
||||
return apiArgumentList;
|
||||
}
|
||||
for (JavaParameter parameter : parameterList) {
|
||||
String typeName = parameter.getType().getValue();
|
||||
// 该类型的参数为Validator的验证结果对象,因此忽略。
|
||||
if ("BindingResult".equals(typeName) || this.isServletArgument(typeName)) {
|
||||
continue;
|
||||
}
|
||||
ApiArgument apiArgument = this.parseApiMethodArgument(parameter);
|
||||
apiArgumentList.add(apiArgument);
|
||||
}
|
||||
return apiArgumentList;
|
||||
}
|
||||
|
||||
private String parseMethodArgmentComment(JavaParameter parameter) {
|
||||
String comment = null;
|
||||
JavaExecutable executable = parameter.getExecutable();
|
||||
List<DocletTag> tags = executable.getTagsByName("param");
|
||||
if (CollUtil.isNotEmpty(tags)) {
|
||||
for (DocletTag tag : tags) {
|
||||
if (tag.getValue().startsWith(parameter.getName())) {
|
||||
comment = StrUtil.removePrefix(tag.getValue(), parameter.getName()).trim();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return comment;
|
||||
}
|
||||
|
||||
private ApiArgument parseApiMethodArgument(JavaParameter parameter) {
|
||||
String typeName = parameter.getType().getValue();
|
||||
ApiArgument apiArgument = new ApiArgument();
|
||||
ApiArgumentAnnotation argumentAnnotation =
|
||||
this.parseArgumentAnnotationTypeAndName(parameter.getAnnotations(), parameter.getName());
|
||||
apiArgument.setAnnotationType(argumentAnnotation.getType());
|
||||
apiArgument.setName(argumentAnnotation.getName());
|
||||
apiArgument.setTypeName(typeName);
|
||||
apiArgument.setFullTypeName(parameter.getFullyQualifiedName());
|
||||
if (argumentAnnotation.getType() == ApiArgumentAnnotationType.REQUEST_PARAM) {
|
||||
apiArgument.setRequired(argumentAnnotation.isRequired());
|
||||
}
|
||||
String comment = parseMethodArgmentComment(parameter);
|
||||
apiArgument.setComment(comment);
|
||||
// 文件上传字段,是必填参数。
|
||||
if ("MultipartFile".equals(typeName)) {
|
||||
apiArgument.setUploadFileParam(true);
|
||||
apiArgument.setRequired(true);
|
||||
return apiArgument;
|
||||
}
|
||||
// 对于内置类型,则无需继续处理了。所有和内置类型参数相关的处理,应该在之前完成。
|
||||
if (this.verifyAndSetBuiltinParam(apiArgument, typeName)) {
|
||||
return apiArgument;
|
||||
}
|
||||
// 判断是否为集合类型的参数。
|
||||
if (this.isCollectionType(typeName)) {
|
||||
apiArgument.setCollectionParam(true);
|
||||
if (parameter.getType() instanceof DefaultJavaParameterizedType) {
|
||||
DefaultJavaParameterizedType javaType = (DefaultJavaParameterizedType) parameter.getType();
|
||||
JavaType genericType = javaType.getActualTypeArguments().get(0);
|
||||
ApiModel apiModel = this.buildApiModelForArgument(genericType.getFullyQualifiedName());
|
||||
apiArgument.setModelData(apiModel);
|
||||
apiArgument.setFullTypeName(parameter.getGenericFullyQualifiedName());
|
||||
apiArgument.setTypeName(parameter.getGenericValue());
|
||||
}
|
||||
} else {
|
||||
ApiModel apiModel = this.buildApiModelForArgument(parameter.getFullyQualifiedName());
|
||||
apiArgument.setModelData(apiModel);
|
||||
}
|
||||
return apiArgument;
|
||||
}
|
||||
|
||||
private boolean verifyAndSetBuiltinParam(ApiArgument apiArgument, String typeName) {
|
||||
if ("MyOrderParam".equals(typeName)) {
|
||||
apiArgument.setOrderParam(true);
|
||||
} else if ("MyPageParam".equals(typeName)) {
|
||||
apiArgument.setPageParam(true);
|
||||
} else if ("MyGroupParam".equals(typeName)) {
|
||||
apiArgument.setGroupParam(true);
|
||||
} else if ("MyQueryParam".equals(typeName)) {
|
||||
apiArgument.setQueryParam(true);
|
||||
} else if ("MyAggregationParam".equals(typeName)) {
|
||||
apiArgument.setAggregationParam(true);
|
||||
}
|
||||
return apiArgument.isOrderParam()
|
||||
|| apiArgument.isPageParam()
|
||||
|| apiArgument.isGroupParam()
|
||||
|| apiArgument.isQueryParam()
|
||||
|| apiArgument.isAggregationParam();
|
||||
}
|
||||
|
||||
private ApiArgumentAnnotation parseArgumentAnnotationTypeAndName(
|
||||
List<JavaAnnotation> annotationList, String defaultName) {
|
||||
ApiArgumentAnnotation argumentAnnotation = new ApiArgumentAnnotation();
|
||||
argumentAnnotation.setType(ApiArgumentAnnotationType.REQUEST_PARAM);
|
||||
argumentAnnotation.setName(defaultName);
|
||||
for (JavaAnnotation annotation : annotationList) {
|
||||
String annotationName = annotation.getType().getValue();
|
||||
if ("RequestBody".equals(annotationName)) {
|
||||
argumentAnnotation.setType(ApiArgumentAnnotationType.REQUEST_BODY);
|
||||
return argumentAnnotation;
|
||||
} else if ("MyRequestBody".equals(annotationName)) {
|
||||
String annotationValue = this.getArgumentNameFromAnnotationValue(annotation, VALUE_PROP);
|
||||
argumentAnnotation.setType(ApiArgumentAnnotationType.MY_REQUEST_BODY);
|
||||
argumentAnnotation.setName(annotationValue != null ? annotationValue : defaultName);
|
||||
return argumentAnnotation;
|
||||
} else if ("RequestParam".equals(annotationName)) {
|
||||
String annotationValue = this.getArgumentNameFromAnnotationValue(annotation, VALUE_PROP);
|
||||
argumentAnnotation.setType(ApiArgumentAnnotationType.REQUEST_PARAM);
|
||||
argumentAnnotation.setName(annotationValue != null ? annotationValue : defaultName);
|
||||
String requiredValue = this.getArgumentNameFromAnnotationValue(annotation, REQUIRED_PROP);
|
||||
if (StrUtil.isNotBlank(requiredValue)) {
|
||||
argumentAnnotation.setRequired(Boolean.parseBoolean(requiredValue));
|
||||
}
|
||||
return argumentAnnotation;
|
||||
}
|
||||
}
|
||||
// 缺省为@RequestParam
|
||||
return argumentAnnotation;
|
||||
}
|
||||
|
||||
private String getArgumentNameFromAnnotationValue(JavaAnnotation annotation, String attribute) {
|
||||
Object value = annotation.getNamedParameter(attribute);
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
String paramAlias = value.toString();
|
||||
if (StrUtil.isNotBlank(paramAlias)) {
|
||||
paramAlias = StrUtil.removeAll(paramAlias, "\"");
|
||||
}
|
||||
return paramAlias;
|
||||
}
|
||||
|
||||
private ApiModel buildApiModelForArgument(String fullJavaClassName) {
|
||||
// 先从当前服务内的Model中找,如果参数是Model类型的对象,微服务和单体行为一致。
|
||||
ApiModel apiModel = apiProject.getFullNameModelMap().get(fullJavaClassName);
|
||||
if (apiModel != null) {
|
||||
return apiModel;
|
||||
}
|
||||
// 判断工程全局对象映射中是否包括该对象类型,如果不包含,就直接返回了。
|
||||
JavaClass modelClass = projectJavaClassMap.get(fullJavaClassName);
|
||||
if (modelClass == null) {
|
||||
return apiModel;
|
||||
}
|
||||
// 先行解析对象中的字段。
|
||||
apiModel = parseModel(modelClass);
|
||||
apiProject.getFullNameModelMap().put(fullJavaClassName, apiModel);
|
||||
return apiModel;
|
||||
}
|
||||
|
||||
private ApiModel parseModel(JavaClass javaClass) {
|
||||
ApiModel apiModel = new ApiModel();
|
||||
apiModel.setName(javaClass.getName());
|
||||
apiModel.setFullName(javaClass.getFullyQualifiedName());
|
||||
apiModel.setComment(javaClass.getComment());
|
||||
apiModel.setFieldList(new LinkedList<>());
|
||||
List<JavaField> fieldList = javaClass.getFields();
|
||||
for (JavaField field : fieldList) {
|
||||
if (field.isStatic()) {
|
||||
continue;
|
||||
}
|
||||
ApiField apiField = new ApiField();
|
||||
apiField.setName(field.getName());
|
||||
apiField.setComment(field.getComment());
|
||||
apiField.setTypeName(field.getType().getSimpleName());
|
||||
apiModel.getFieldList().add(apiField);
|
||||
}
|
||||
return apiModel;
|
||||
}
|
||||
|
||||
private void verifyConfigData() {
|
||||
if (StrUtil.isBlank(config.getProjectName())) {
|
||||
throw new ApiCodeConfigParseException("ProjectName field can't be EMPTY.");
|
||||
}
|
||||
if (StrUtil.isBlank(config.getBasePackage())) {
|
||||
throw new ApiCodeConfigParseException("BasePackage field can't be EMPTY.");
|
||||
}
|
||||
if (StrUtil.isBlank(config.getProjectRootPath())) {
|
||||
throw new ApiCodeConfigParseException("ProjectRootPath field can't be EMPTY.");
|
||||
}
|
||||
if (!FileUtil.exist(config.getProjectRootPath())) {
|
||||
throw new ApiCodeConfigParseException(
|
||||
"ProjectRootPath doesn't exist, please check ./resources/export-api-config.json as DEFAULT.");
|
||||
}
|
||||
if (config.getMicroService() == null) {
|
||||
throw new ApiCodeConfigParseException("MicroService field can't be NULL.");
|
||||
}
|
||||
if (CollUtil.isEmpty(config.getServiceList())) {
|
||||
throw new ApiCodeConfigParseException("ServiceList field can't be EMPTY.");
|
||||
}
|
||||
this.verifyServiceConfig(config.getServiceList());
|
||||
}
|
||||
|
||||
private void verifyServiceConfig(List<ApiCodeConfig.ServiceConfig> serviceConfigList) {
|
||||
Set<String> serviceNameSet = new HashSet<>(8);
|
||||
Set<String> servicePathSet = new HashSet<>(8);
|
||||
for (ApiCodeConfig.ServiceConfig serviceConfig : serviceConfigList) {
|
||||
if (StrUtil.isBlank(serviceConfig.getServiceName())) {
|
||||
throw new ApiCodeConfigParseException("One of the ServiceName Field in Services List is NULL.");
|
||||
}
|
||||
String serviceName = serviceConfig.getServiceName();
|
||||
if (StrUtil.isBlank(serviceConfig.getServicePath())) {
|
||||
throw new ApiCodeConfigParseException(
|
||||
"The ServicePath Field in Service [" + serviceName + "] is NULL.");
|
||||
}
|
||||
if (serviceNameSet.contains(serviceName)) {
|
||||
throw new ApiCodeConfigParseException("The ServiceName [" + serviceName + "] is duplicated.");
|
||||
}
|
||||
serviceNameSet.add(serviceName);
|
||||
if (servicePathSet.contains(serviceConfig.getServicePath())) {
|
||||
throw new ApiCodeConfigParseException(
|
||||
"The ServicePath [" + serviceConfig.getServicePath() + "] is duplicated.");
|
||||
}
|
||||
servicePathSet.add(serviceConfig.getServicePath());
|
||||
if (StrUtil.isBlank(serviceConfig.getPort())) {
|
||||
throw new ApiCodeConfigParseException(
|
||||
"The Port Field in Service [" + serviceName + "] is NULL.");
|
||||
}
|
||||
this.verifyServiceControllerConfig(serviceConfig.getControllerInfoList(), serviceName);
|
||||
}
|
||||
}
|
||||
|
||||
private void verifyServiceControllerConfig(
|
||||
List<ApiCodeConfig.ControllerInfo> controllerInfoList, String serviceName) {
|
||||
if (CollUtil.isEmpty(controllerInfoList)) {
|
||||
throw new ApiCodeConfigParseException(
|
||||
"The ControllerInfoList Field of Service [" + serviceName + "] is EMPTY");
|
||||
}
|
||||
for (ApiCodeConfig.ControllerInfo controllerInfo : controllerInfoList) {
|
||||
if (StrUtil.isBlank(controllerInfo.getPath())) {
|
||||
throw new ApiCodeConfigParseException(
|
||||
"One of the ControllerInfo.Path Field of Service [" + serviceName + "] is EMPTY");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void normalizeConfigPath() {
|
||||
config.setProjectRootPath(normalizePath(config.getProjectRootPath()));
|
||||
for (ApiCodeConfig.ServiceConfig serviceConfig : config.getServiceList()) {
|
||||
serviceConfig.setServicePath(config.getProjectRootPath() + normalizePath(serviceConfig.getServicePath()));
|
||||
for (ApiCodeConfig.ControllerInfo controllerInfo : serviceConfig.getControllerInfoList()) {
|
||||
controllerInfo.setPath(serviceConfig.getServicePath() + normalizePath(controllerInfo.getPath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String normalizePath(String path) {
|
||||
if (!path.startsWith(PATH_SEPERATOR)) {
|
||||
path = PATH_SEPERATOR + path;
|
||||
}
|
||||
return StrUtil.removeSuffix(path, PATH_SEPERATOR);
|
||||
}
|
||||
|
||||
private boolean isCollectionType(String typeName) {
|
||||
return "List".equals(typeName) || "Set".equals(typeName) || "Collection".equals(typeName);
|
||||
}
|
||||
|
||||
private boolean isServletArgument(String typeName) {
|
||||
return "HttpServletResponse".equals(typeName) || "HttpServletRequest".equals(typeName);
|
||||
}
|
||||
|
||||
private boolean isController(String annotationName) {
|
||||
return "Controller".equals(annotationName)
|
||||
|| "org.springframework.stereotype.Controller".equals(annotationName)
|
||||
|| "RestController".equals(annotationName)
|
||||
|| "org.springframework.web.bind.annotation.RestController".equals(annotationName);
|
||||
}
|
||||
|
||||
private boolean isRequiredColumn(String annotationName) {
|
||||
return "NotNull".equals(annotationName)
|
||||
|| "javax.validation.constraints.NotNull".equals(annotationName)
|
||||
|| "NotBlank".equals(annotationName)
|
||||
|| "javax.validation.constraints.NotBlank".equals(annotationName)
|
||||
|| "NotEmpty".equals(annotationName)
|
||||
|| "javax.validation.constraints.NotEmpty".equals(annotationName);
|
||||
}
|
||||
|
||||
private boolean isRequestMapping(String name) {
|
||||
return REQUEST_MAPPING.equals(name) || FULL_REQUEST_MAPPING.equals(name);
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApiProject {
|
||||
private String projectName;
|
||||
private Boolean microService;
|
||||
private List<ApiService> serviceList;
|
||||
private Map<String, ApiModel> fullNameModelMap = new HashMap<>(32);
|
||||
private Map<String, ApiModel> simpleNameModelMap = new HashMap<>(32);
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApiService {
|
||||
private String serviceName;
|
||||
private String showName;
|
||||
private String port;
|
||||
private Set<ApiClass> defaultGroupClassSet = new TreeSet<>();
|
||||
private Map<String, Set<ApiClass>> groupedClassMap = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApiClass implements Comparable<ApiClass> {
|
||||
private String name;
|
||||
private String fullName;
|
||||
private String groupName;
|
||||
private String comment;
|
||||
private String requestPath;
|
||||
private List<ApiMethod> methodList;
|
||||
|
||||
@Override
|
||||
public int compareTo(ApiClass o) {
|
||||
return this.name.compareTo(o.name);
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApiMethod {
|
||||
private String name;
|
||||
private String comment;
|
||||
private String returnString;
|
||||
private String requestPath;
|
||||
private String httpMethod;
|
||||
private boolean listDictUrl = false;
|
||||
private boolean listUrl = false;
|
||||
private boolean loginUrl = false;
|
||||
private List<String> pathList = new LinkedList<>();
|
||||
private List<ApiArgument> argumentList;
|
||||
private List<ApiArgument> queryParamArgumentList = new LinkedList<>();
|
||||
private List<ApiArgument> jsonParamArgumentList = new LinkedList<>();
|
||||
private List<ApiArgument> uploadParamArgumentList = new LinkedList<>();
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApiArgument {
|
||||
private String name;
|
||||
private String typeName;
|
||||
private String fullTypeName;
|
||||
private String comment;
|
||||
private Integer annotationType;
|
||||
private boolean required = true;
|
||||
private boolean uploadFileParam = false;
|
||||
private boolean collectionParam = false;
|
||||
private boolean orderParam = false;
|
||||
private boolean pageParam = false;
|
||||
private boolean groupParam = false;
|
||||
private boolean queryParam = false;
|
||||
private boolean aggregationParam = false;
|
||||
private boolean jsonData = false;
|
||||
private ApiModel modelData;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApiArgumentAnnotation {
|
||||
private String name;
|
||||
private Integer type;
|
||||
private boolean required = true;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApiModel {
|
||||
private String name;
|
||||
private String fullName;
|
||||
private String comment;
|
||||
private List<ApiField> fieldList;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ApiField {
|
||||
private String name;
|
||||
private String comment;
|
||||
private String typeName;
|
||||
private boolean requiredColumn = false;
|
||||
}
|
||||
|
||||
public static final class ApiArgumentAnnotationType {
|
||||
public static final int REQUEST_PARAM = 0;
|
||||
public static final int REQUEST_BODY = 1;
|
||||
public static final int MY_REQUEST_BODY = 2;
|
||||
|
||||
private ApiArgumentAnnotationType() {
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
private static class InternalServiceData {
|
||||
private String serviceRequestPath = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.orangeforms.apidoc.tools.exception;
|
||||
|
||||
/**
|
||||
* 解析接口信息配置对象中的异常。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public class ApiCodeConfigParseException extends RuntimeException {
|
||||
|
||||
/**
|
||||
* 构造函数。
|
||||
*/
|
||||
public ApiCodeConfigParseException() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数。
|
||||
*
|
||||
* @param msg 错误信息。
|
||||
*/
|
||||
public ApiCodeConfigParseException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.orangeforms.apidoc.tools.exception;
|
||||
|
||||
/**
|
||||
* 解析Mybatis XML Mapper中的异常。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public class MapperParseException extends RuntimeException {
|
||||
|
||||
/**
|
||||
* 构造函数。
|
||||
*/
|
||||
public MapperParseException() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数。
|
||||
*
|
||||
* @param msg 错误信息。
|
||||
*/
|
||||
public MapperParseException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.orangeforms.apidoc.tools.export;
|
||||
|
||||
import com.orangeforms.apidoc.tools.codeparser.ApiCodeParser;
|
||||
import com.orangeforms.apidoc.tools.util.FreeMarkerUtils;
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.TemplateException;
|
||||
import freemarker.template.TemplateExceptionHandler;
|
||||
import freemarker.template.TemplateModelException;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 根据代码解析后的工程对象数据,导出到Markdown格式的接口文档文件。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public class ApiDocExporter {
|
||||
|
||||
private final Configuration config;
|
||||
|
||||
public ApiDocExporter() throws TemplateModelException {
|
||||
config = new Configuration(Configuration.VERSION_2_3_28);
|
||||
config.setNumberFormat("0.####");
|
||||
config.setClassicCompatible(true);
|
||||
config.setAPIBuiltinEnabled(true);
|
||||
config.setClassForTemplateLoading(ApiPostmanExporter.class, "/templates/");
|
||||
config.setDefaultEncoding("UTF-8");
|
||||
config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
|
||||
config.setSharedVariable("freemarkerUtils", new FreeMarkerUtils());
|
||||
config.unsetCacheStorage();
|
||||
config.clearTemplateCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成Markdown格式的API接口文档。
|
||||
*
|
||||
* @param apiProject 解析后的工程对象。
|
||||
* @param outputFile 生成后的、包含全路径的输出文件名。
|
||||
* @throws IOException 文件操作异常。
|
||||
* @throws TemplateException 模板实例化异常。
|
||||
*/
|
||||
public void doGenerate(ApiCodeParser.ApiProject apiProject, String outputFile) throws IOException, TemplateException {
|
||||
Map<String, Object> paramMap = new HashMap<>(1);
|
||||
paramMap.put("project", apiProject);
|
||||
List<ApiCodeParser.ApiService> newServiceList = new LinkedList<>();
|
||||
if (apiProject.getMicroService()) {
|
||||
// 在微服务场景中,我们需要把upms服务放到最前面显示。
|
||||
for (ApiCodeParser.ApiService apiService : apiProject.getServiceList()) {
|
||||
if ("upms".equals(apiService.getServiceName())) {
|
||||
newServiceList.add(apiService);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (ApiCodeParser.ApiService apiService : apiProject.getServiceList()) {
|
||||
if (!"upms".equals(apiService.getServiceName())) {
|
||||
newServiceList.add(apiService);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ApiCodeParser.ApiService appService = apiProject.getServiceList().get(0);
|
||||
ApiCodeParser.ApiService newUpmsService = new ApiCodeParser.ApiService();
|
||||
newUpmsService.setDefaultGroupClassSet(appService.getGroupedClassMap().get("upms"));
|
||||
newUpmsService.setServiceName("upms");
|
||||
newUpmsService.setShowName("用户权限模块");
|
||||
newServiceList.add(newUpmsService);
|
||||
ApiCodeParser.ApiService newAppService = new ApiCodeParser.ApiService();
|
||||
newAppService.setDefaultGroupClassSet(appService.getGroupedClassMap().get("app"));
|
||||
newAppService.setServiceName("app");
|
||||
newAppService.setShowName("业务应用模块");
|
||||
newServiceList.add(newAppService);
|
||||
}
|
||||
apiProject.setServiceList(newServiceList);
|
||||
FileUtils.forceMkdirParent(new File(outputFile));
|
||||
config.getTemplate("./api-doc.md.ftl").process(paramMap, new FileWriter(outputFile));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.orangeforms.apidoc.tools.export;
|
||||
|
||||
import com.orangeforms.apidoc.tools.codeparser.ApiCodeParser;
|
||||
import com.orangeforms.apidoc.tools.util.FreeMarkerUtils;
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.TemplateException;
|
||||
import freemarker.template.TemplateExceptionHandler;
|
||||
import freemarker.template.TemplateModelException;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 根据代码解析后的工程对象数据,导出到Postman支持的JSON格式的文件。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public class ApiPostmanExporter {
|
||||
|
||||
private final Configuration config;
|
||||
|
||||
public ApiPostmanExporter() throws TemplateModelException {
|
||||
config = new Configuration(Configuration.VERSION_2_3_28);
|
||||
config.setNumberFormat("0.####");
|
||||
config.setClassicCompatible(true);
|
||||
config.setAPIBuiltinEnabled(true);
|
||||
config.setClassForTemplateLoading(ApiPostmanExporter.class, "/templates/");
|
||||
config.setDefaultEncoding("UTF-8");
|
||||
config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
|
||||
config.setSharedVariable("freemarkerUtils", new FreeMarkerUtils());
|
||||
config.unsetCacheStorage();
|
||||
config.clearTemplateCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成Postman支持的JSON文档。
|
||||
* @param apiProject 解析后的工程对象。
|
||||
* @param outputFile 生成后的、包含全路径的输出文件名。
|
||||
* @throws IOException 文件操作异常。
|
||||
* @throws TemplateException 模板实例化异常。
|
||||
*/
|
||||
public void doGenerate(ApiCodeParser.ApiProject apiProject, String outputFile) throws IOException, TemplateException {
|
||||
Map<String, Object> paramMap = new HashMap<>(1);
|
||||
paramMap.put("project", apiProject);
|
||||
FileUtils.forceMkdirParent(new File(outputFile));
|
||||
config.getTemplate("./postman_collection.json.ftl").process(paramMap, new FileWriter(outputFile));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.orangeforms.apidoc.tools.util;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 仅供Freemarker模板内部使用的Java工具函数。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public class FreeMarkerUtils {
|
||||
|
||||
/**
|
||||
* 生成GUID。
|
||||
*
|
||||
* @return 生成后的GUID。
|
||||
*/
|
||||
public static String generateGuid() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 私有构造函数,明确标识该常量类的作用。
|
||||
*/
|
||||
public FreeMarkerUtils() {
|
||||
// FreeMarker的工具对象,Sonarqube建议给出空构造的注释。
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"projectName": "橙单微服务开源版",
|
||||
"basePackage": "com.orangeforms",
|
||||
"projectRootPath": "这里请使用当前工程的根目录,如:e:/xxx/OrangeDemo 或者 /Users/xxx/OrangeDemo",
|
||||
"microService": "true",
|
||||
"serviceList": [
|
||||
{
|
||||
"serviceName": "course-class",
|
||||
"showName": "班级服务",
|
||||
"servicePath": "/application/course-class",
|
||||
"serviceRequestPath": "/admin/CourseClass",
|
||||
"port": "8082",
|
||||
"controllerInfoList": [
|
||||
{
|
||||
"path": "/course-class-service/src/main/java/com/orangeforms/courseclassservice/controller"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"serviceName": "stats",
|
||||
"showName": "统计服务",
|
||||
"servicePath": "/application/stats",
|
||||
"serviceRequestPath": "/admin/stats",
|
||||
"port": "8082",
|
||||
"controllerInfoList": [
|
||||
{
|
||||
"path": "/stats-service/src/main/java/com/orangeforms/statsservice/controller"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"serviceName": "upms",
|
||||
"showName": "用户权限服务",
|
||||
"servicePath": "/application/upms",
|
||||
"serviceRequestPath": "/admin/upms",
|
||||
"port": "8082",
|
||||
"controllerInfoList": [
|
||||
{
|
||||
"path": "/upms-service/src/main/java/com/orangeforms/upmsservice/controller"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
## 用户登录
|
||||
### 登录接口
|
||||
#### 登录
|
||||
- **URI:** /admin/upms/login/doLogin
|
||||
- **Type:** GET
|
||||
- **Content-Type:** multipart/form-data
|
||||
- **Request-Headers:**
|
||||
Name|Type|Description
|
||||
--|--|--
|
||||
Authorization|String|身份验证的Token
|
||||
- **Request-Parameters:**
|
||||
Parameter|Type|Required|Description
|
||||
--|--|--|--
|
||||
loginName|string|true|用户名
|
||||
password|string|true|加密后的用户密码
|
||||
|
||||
#### 退出
|
||||
- **URI:** /admin/upms/login/logout
|
||||
- **Type:** POST
|
||||
- **Content-Type:** application/json; chartset=utf-8
|
||||
- **Request-Headers:**
|
||||
Name|Type|Description
|
||||
--|--|--
|
||||
Authorization|String|身份验证的Token
|
||||
|
||||
#### 修改密码
|
||||
- **URI:** /admin/upms/login/changePassword
|
||||
- **Type:** POST
|
||||
- **Content-Type:** application/json; chartset=utf-8
|
||||
- **Request-Headers:**
|
||||
Name|Type|Description
|
||||
--|--|--
|
||||
Authorization|String|身份验证的Token
|
||||
- **Request-Parameters:**
|
||||
Parameter|Type|Required|Description
|
||||
--|--|--|--
|
||||
oldPass|string|true|加密后的原用户密码
|
||||
newPass|string|true|加密后的新用户密码
|
||||
<#list project.serviceList as service>
|
||||
|
||||
## ${service.showName}
|
||||
<#list service.defaultGroupClassSet as apiClass>
|
||||
### ${apiClass.name}
|
||||
<#list apiClass.methodList as apiMethod>
|
||||
#### ${apiMethod.name}
|
||||
- **URI:** ${apiMethod.requestPath}
|
||||
- **Type:** ${apiMethod.httpMethod}
|
||||
- **Content-Type:** <#if apiMethod.httpMethod == "GET" || apiMethod.queryParamArgumentList?size gt 0 || apiMethod.uploadParamArgumentList?size gt 0>multipart/form-data<#else>application/json; chartset=utf-8</#if>
|
||||
- **Request-Headers:**
|
||||
Name|Type|Description
|
||||
--|--|--
|
||||
Authorization|String|身份验证的Token
|
||||
<#if apiMethod.queryParamArgumentList?size gt 0 || apiMethod.uploadParamArgumentList?size gt 0>
|
||||
- **Request-Parameters:**
|
||||
Parameter|Type|Required|Description
|
||||
--|--|--|--
|
||||
<#list apiMethod.queryParamArgumentList as apiArgument>
|
||||
<#if apiArgument.modelData??>
|
||||
<#list apiArgument.modelData.tableFieldList as apiField>
|
||||
${apiField.name}|${apiField.typeName}|<#if apiMethod.listDictUrl>false<#else><#if apiField.requiredColumn>true<#else>false</#if></#if>|${apiField.comment}
|
||||
</#list>
|
||||
<#else>
|
||||
${apiArgument.name}|${apiArgument.typeName}|<#if apiMethod.listDictUrl>false<#else><#if apiArgument.required>true<#else>false</#if></#if>|${apiArgument.comment}
|
||||
</#if><#-- apiArgument.modelData?? -->
|
||||
</#list>
|
||||
</#if>
|
||||
<#list apiMethod.uploadParamArgumentList as apiArgument>
|
||||
${apiArgument.name}|File|true|${apiArgument.comment}
|
||||
</#list>
|
||||
<#if apiMethod.jsonParamArgumentList?size gt 0>
|
||||
- **Request-Body:**
|
||||
``` json
|
||||
{
|
||||
<#list apiMethod.jsonParamArgumentList as apiArgument>
|
||||
<#if apiArgument.modelData??>
|
||||
<#if apiArgument.collectionParam>
|
||||
"${apiArgument.name}" : [
|
||||
{
|
||||
<#if apiMethod.listUrl>
|
||||
<#list apiArgument.modelData.filteredFieldList as apiField>
|
||||
"${apiField.name}" : "${apiField.typeName} | false | <#if apiField.name == "searchString">模糊搜索字符串。<#else>${apiField.comment}</#if>"<#if apiField_has_next>,</#if>
|
||||
</#list>
|
||||
<#else><#-- apiMethod.listUrl -->
|
||||
<#list apiArgument.modelData.tableFieldList as apiField>
|
||||
<#if !apiMethod.addUrl || !apiField.primaryKey>
|
||||
"${apiField.name}" : "${apiField.typeName} | <#if apiField.requiredColumn>true<#else>false</#if> | ${apiField.comment}"<#if apiField_has_next>,</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if><#-- apiMethod.listUrl -->
|
||||
}
|
||||
]<#if apiArgument_has_next>,</#if>
|
||||
<#else><#-- apiArgument.collectionParam -->
|
||||
"${apiArgument.name}" : {
|
||||
<#if apiMethod.listUrl>
|
||||
<#list apiArgument.modelData.filteredFieldList as apiField>
|
||||
"${apiField.name}" : "${apiField.typeName} | false | <#if apiField.name == "searchString">模糊搜索字符串。<#else>${apiField.comment}</#if>"<#if apiField_has_next>,</#if>
|
||||
</#list>
|
||||
<#else><#-- apiMethod.listUrl -->
|
||||
<#list apiArgument.modelData.tableFieldList as apiField>
|
||||
<#if !apiMethod.addUrl || !apiField.primaryKey>
|
||||
"${apiField.name}" : "${apiField.typeName} | <#if apiField.requiredColumn>true<#else>false</#if> | ${apiField.comment}"<#if apiField_has_next>,</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if><#-- apiMethod.listUrl -->
|
||||
}<#if apiArgument_has_next>,</#if>
|
||||
</#if><#-- apiArgument.collectionParam -->
|
||||
<#elseif apiArgument.orderParam>
|
||||
"${apiArgument.name}" : [
|
||||
{
|
||||
"fieldName" : "String | false | 排序字段名",
|
||||
"asc" : "Boolean | false | 是否升序"
|
||||
}
|
||||
]<#if apiArgument_has_next>,</#if>
|
||||
<#elseif apiArgument.groupParam>
|
||||
"${apiArgument.name}" : [
|
||||
{
|
||||
"fieldName" : "String | false | 分组字段名",
|
||||
"aliasName" : "String | false | 分组字段别名",
|
||||
"dateAggregateBy" : "String | false | 是否按照日期聚合,可选项(day|month|year)"
|
||||
}
|
||||
]<#if apiArgument_has_next>,</#if>
|
||||
<#elseif apiArgument.pageParam>
|
||||
"${apiArgument.name}" : {
|
||||
"pageNum": "Integer | false | 分页页号",
|
||||
"pageSize": "Integer | false | 每页数据量"
|
||||
}<#if apiArgument_has_next>,</#if>
|
||||
<#elseif apiArgument.queryParam || apiArgument.aggregationParam>
|
||||
${apiArgument.name}" : {
|
||||
|
||||
}<#if apiArgument_has_next>,</#if>
|
||||
<#else><#-- apiArgument.modelData?? -->
|
||||
<#if apiArgument.collectionParam>
|
||||
"${apiArgument.name}" : [ "${apiArgument.typeName} | ${apiArgument.required}<#if apiArgument.comment??> | ${apiArgument.comment}</#if>" ]<#if apiArgument_has_next>,</#if>
|
||||
<#else>
|
||||
"${apiArgument.name}" : "${apiArgument.typeName} | ${apiArgument.required}<#if apiArgument.comment??> | ${apiArgument.comment}</#if>"<#if apiArgument_has_next>,</#if>
|
||||
</#if>
|
||||
</#if><#-- apiArgument.modelData?? -->
|
||||
</#list>
|
||||
}
|
||||
```
|
||||
</#if>
|
||||
</#list><#-- apiClass.methodList as apiMethod -->
|
||||
</#list><#-- upmsClassList as apiClass -->
|
||||
</#list>
|
||||
@@ -0,0 +1,42 @@
|
||||
<#import "postman_common.ftl" as Common>
|
||||
{
|
||||
"info": {
|
||||
"_postman_id": "92b51dc5-3611-49ac-8d94-a0718dba5bf1",
|
||||
"name": "${project.projectName}",
|
||||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
||||
},
|
||||
"item": [
|
||||
<#list project.serviceList as service>
|
||||
{
|
||||
"name": "${service.serviceName}",
|
||||
"item": [
|
||||
<#if service.groupedClassMap?size gt 0>
|
||||
<#list service.groupedClassMap?keys as groupName>
|
||||
<#assign groupedClassList=service.groupedClassMap[groupName] />
|
||||
{
|
||||
"name": "${groupName}",
|
||||
"item": [
|
||||
<#list groupedClassList as apiClass>
|
||||
{
|
||||
<@Common.generateControllerRequest service apiClass 7/>
|
||||
}<#if apiClass_has_next>,</#if>
|
||||
</#list>
|
||||
],
|
||||
"protocolProfileBehavior": {},
|
||||
"_postman_isSubFolder": true
|
||||
}<#if groupName_has_next>,</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
<#list service.defaultGroupClassSet as apiClass>
|
||||
{
|
||||
<@Common.generateControllerRequest service apiClass 5/>
|
||||
}<#if apiClass_has_next>,</#if>
|
||||
</#list>
|
||||
],
|
||||
"protocolProfileBehavior": {},
|
||||
"_postman_isSubFolder": true
|
||||
}<#if service_has_next>,</#if>
|
||||
</#list><#-- project.serviceList as service -->
|
||||
],
|
||||
"protocolProfileBehavior": {}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<#macro doIndent level><#if level != 0><#list 0..(level-1) as i> </#list></#if></#macro>
|
||||
|
||||
<#macro generateControllerRequest service apiClass indentLevel>
|
||||
<@doIndent indentLevel/>"name": "${apiClass.name}",
|
||||
<@doIndent indentLevel/>"item": [
|
||||
<#list apiClass.methodList as apiMethod>
|
||||
<@doIndent indentLevel/> {
|
||||
<@doIndent indentLevel/> "name": "${apiMethod.name}",
|
||||
<#if apiMethod.loginUrl>
|
||||
<@doIndent indentLevel/> "event": [
|
||||
<@doIndent indentLevel/> {
|
||||
<@doIndent indentLevel/> "listen": "test",
|
||||
<@doIndent indentLevel/> "script": {
|
||||
<@doIndent indentLevel/> "id": "${freemarkerUtils.generateGuid()}",
|
||||
<@doIndent indentLevel/> "type": "text/javascript",
|
||||
<@doIndent indentLevel/> "exec": [
|
||||
<@doIndent indentLevel/> "pm.test(\"登录操作\", function () {",
|
||||
<@doIndent indentLevel/> " var jsonData = pm.response.json();",
|
||||
<@doIndent indentLevel/> " var token = jsonData.data.tokenData;",
|
||||
<@doIndent indentLevel/> " pm.environment.set(\"token\", token);",
|
||||
<@doIndent indentLevel/> " console.log(\"login token \" + token);",
|
||||
<@doIndent indentLevel/> "});",
|
||||
<@doIndent indentLevel/> ""
|
||||
<@doIndent indentLevel/> ]
|
||||
<@doIndent indentLevel/> }
|
||||
<@doIndent indentLevel/> },
|
||||
<@doIndent indentLevel/> {
|
||||
<@doIndent indentLevel/> "listen": "prerequest",
|
||||
<@doIndent indentLevel/> "script": {
|
||||
<@doIndent indentLevel/> "id": "${freemarkerUtils.generateGuid()}",
|
||||
<@doIndent indentLevel/> "type": "text/javascript",
|
||||
<@doIndent indentLevel/> "exec": [
|
||||
<@doIndent indentLevel/> ""
|
||||
<@doIndent indentLevel/> ]
|
||||
<@doIndent indentLevel/> }
|
||||
<@doIndent indentLevel/> }
|
||||
<@doIndent indentLevel/> ],
|
||||
</#if>
|
||||
<@doIndent indentLevel/> "request": {
|
||||
<@doIndent indentLevel/> "method": "${apiMethod.httpMethod}",
|
||||
<#if apiMethod.loginUrl>
|
||||
<@doIndent indentLevel/> "header": [],
|
||||
<#else>
|
||||
<@doIndent indentLevel/> "header": [
|
||||
<@doIndent indentLevel/> {
|
||||
<@doIndent indentLevel/> "key": "Authorization",
|
||||
<@doIndent indentLevel/> "value": "{{token}}",
|
||||
<@doIndent indentLevel/> "type": "text"
|
||||
<@doIndent indentLevel/> }
|
||||
<@doIndent indentLevel/> ],
|
||||
</#if>
|
||||
<@doIndent indentLevel/> "url": {
|
||||
<@doIndent indentLevel/> "raw": "http://{{host}}:${service.port}/${apiMethod.requestPath}",
|
||||
<@doIndent indentLevel/> "protocol": "http",
|
||||
<@doIndent indentLevel/> "host": [
|
||||
<@doIndent indentLevel/> "{{host}}"
|
||||
<@doIndent indentLevel/> ],
|
||||
<@doIndent indentLevel/> "port": "${service.port}",
|
||||
<@doIndent indentLevel/> "path": [
|
||||
<#list apiMethod.pathList as path>
|
||||
<@doIndent indentLevel/> "${path}"<#if path_has_next>,</#if>
|
||||
</#list>
|
||||
<@doIndent indentLevel/> ]<#if apiMethod.queryParamArgumentList?size gt 0>,</#if>
|
||||
<#if apiMethod.queryParamArgumentList?size gt 0>
|
||||
<@doIndent indentLevel/> "query": [
|
||||
<#list apiMethod.queryParamArgumentList as apiArgument>
|
||||
<#if apiArgument.modelData??>
|
||||
<#list apiArgument.modelData.tableFieldList as apiField>
|
||||
<@doIndent indentLevel/> {
|
||||
<@doIndent indentLevel/> "key": "${apiField.name}",
|
||||
<@doIndent indentLevel/> "value": ""
|
||||
<@doIndent indentLevel/> }<#if apiArgument_has_next || apiField_has_next>,</#if>
|
||||
</#list>
|
||||
<#else>
|
||||
<@doIndent indentLevel/> {
|
||||
<@doIndent indentLevel/> "key": "${apiArgument.name}",
|
||||
<@doIndent indentLevel/> "value": ""
|
||||
<@doIndent indentLevel/> }<#if apiArgument_has_next>,</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
<@doIndent indentLevel/> ]
|
||||
</#if>
|
||||
<@doIndent indentLevel/> }<#if (apiMethod.httpMethod == "POST" && apiMethod.jsonParamArgumentList?size gt 0) || apiMethod.uploadParamArgumentList?size gt 0>,</#if>
|
||||
<#if apiMethod.uploadParamArgumentList?size gt 0>
|
||||
<@doIndent indentLevel/> "body": {
|
||||
<@doIndent indentLevel/> "mode": "formdata",
|
||||
<@doIndent indentLevel/> "formdata": [
|
||||
<#list apiMethod.uploadParamArgumentList as apiArgument>
|
||||
<@doIndent indentLevel/> {
|
||||
<@doIndent indentLevel/> "key": "${apiArgument.name}",
|
||||
<@doIndent indentLevel/> "type": "file",
|
||||
<@doIndent indentLevel/> "src": []
|
||||
<@doIndent indentLevel/> }<#if apiArgument_has_next>,</#if>
|
||||
</#list>
|
||||
<@doIndent indentLevel/> ]
|
||||
<@doIndent indentLevel/> }<#if apiMethod.httpMethod == "POST" && apiMethod.jsonParamArgumentList?size gt 0>,</#if>
|
||||
</#if><#-- apiMethod.uploadParamArgumentList?size gt 0 -->
|
||||
<#if apiMethod.httpMethod == "POST" && apiMethod.jsonParamArgumentList?size gt 0>
|
||||
<@doIndent indentLevel/> "body": {
|
||||
<@doIndent indentLevel/> "mode": "raw",
|
||||
<#if !apiMethod.loginUrl>
|
||||
<@doIndent indentLevel/> "raw": "{\n<#list apiMethod.jsonParamArgumentList as apiArgument><#if apiArgument.modelData??><#if apiArgument.collectionParam>\t\"${apiArgument.name}\" : [\n\t\t{\n<#list apiArgument.modelData.fieldList as apiField><#if apiMethod.listUrl>\t\t\t\"${apiField.name}\" : \"\"<#if apiField_has_next>,</#if>\n<#else>\t\t\t\"${apiField.name}\" : \"<#if apiField.typeName == "Integer" || apiField.typeName == "Long">0</#if>\"<#if apiField_has_next>,</#if>\n</#if><#-- apiMethod.listUrl --></#list>\t\t}\n\t]<#if apiArgument_has_next>,</#if>\n<#else><#-- apiArgument.collectionParam -->\t\"${apiArgument.name}\" : {\n<#list apiArgument.modelData.fieldList as apiField><#if apiMethod.listUrl>\t\t\"${apiField.name}\" : \"\"<#if apiField_has_next>,</#if>\n<#else>\t\t\"${apiField.name}\" : \"<#if apiField.typeName == "Integer" || apiField.typeName == "Long">0</#if>\"<#if apiField_has_next>,</#if>\n</#if><#-- apiMethod.listUrl --></#list>\t}<#if apiArgument_has_next>,</#if>\n</#if><#-- apiArgument.collectionParam --><#elseif apiArgument.orderParam>\t\"${apiArgument.name}\" : [\n\t\t{\n\t\t\t\"fieldName\" : \"\",\n\t\t\t\"asc\" : \"true\"\n\t\t}\n\t]<#if apiArgument_has_next>,</#if>\n<#elseif apiArgument.groupParam>\t\"${apiArgument.name}\" : [\n\t\t{\n\t\t\t\"fieldName\" : \"\",\n\t\t\t\"aliasName\" : \"\",\n\t\t\t\"dateAggregateBy\" : \"\"\n\t\t}\n\t]<#if apiArgument_has_next>,</#if>\n<#elseif apiArgument.pageParam>\t\"${apiArgument.name}\" : {\n\t\t\"pageNum\": \"1\",\n\t\t\"pageSize\": \"10\"\n\t}<#if apiArgument_has_next>,</#if>\n<#elseif apiArgument.queryParam || apiArgument.aggregationParam>\t\"${apiArgument.name}\" : {\n\t}<#if apiArgument_has_next>,</#if>\n<#else><#if apiArgument.collectionParam>\t\"${apiArgument.name}\" : [ ]<#if apiArgument_has_next>,</#if>\n<#else>\t\"${apiArgument.name}\" : \"\"<#if apiArgument_has_next>,</#if>\n</#if></#if><#-- apiArgument.modelData?? --></#list><#-- apiMethod.jsonParamArgumentList?size gt 0 -->}\n",
|
||||
<#else>
|
||||
<@doIndent indentLevel/> "raw": "{\n \"loginName\":\"admin\",\n \"password\":\"IP3ccke3GhH45iGHB5qP9p7iZw6xUyj28Ju10rnBiPKOI35sc%2BjI7%2FdsjOkHWMfUwGYGfz8ik31HC2Ruk%2Fhkd9f6RPULTHj7VpFdNdde2P9M4mQQnFBAiPM7VT9iW3RyCtPlJexQ3nAiA09OqG%2F0sIf1kcyveSrulxembARDbDo%3D\"\n}",
|
||||
</#if>
|
||||
<@doIndent indentLevel/> "options": {
|
||||
<@doIndent indentLevel/> "raw": {
|
||||
<@doIndent indentLevel/> "language": "json"
|
||||
<@doIndent indentLevel/> }
|
||||
<@doIndent indentLevel/> }
|
||||
<@doIndent indentLevel/> }
|
||||
</#if>
|
||||
<@doIndent indentLevel/> },
|
||||
<@doIndent indentLevel/> "response": []
|
||||
<@doIndent indentLevel/> }<#if apiMethod_has_next>,</#if>
|
||||
</#list><#-- apiClass.methodList as apiMethod -->
|
||||
<@doIndent indentLevel/>],
|
||||
<@doIndent indentLevel/>"protocolProfileBehavior": {},
|
||||
<@doIndent indentLevel/>"_postman_isSubFolder": true
|
||||
</#macro>
|
||||
@@ -0,0 +1,155 @@
|
||||
<?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$/target/generated-sources/annotations" isTestSource="false" generated="true" />
|
||||
<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-freemarker:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.10.RELEASE" 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.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.31" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-jul:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.12" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-starter-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.spring:spring-context-support:1.0.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-api:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-hystrix:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-httpclient:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-core:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava:1.3.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-serialization:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.fasterxml.jackson.module:jackson-module-afterburner:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-metrics-event-stream:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-javanica:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.commons:commons-lang3:3.10" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.mapstruct:mapstruct-processor:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-recipes:4.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.5.3-beta" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.luben:zstd-jni:1.4.3-1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.lz4:lz4-java:1.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.lmax:disruptor:3.4.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.skywalking:apm-toolkit-log4j-2.x:7.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" 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.16.1" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.3" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" 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.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>OrangeMultiDemo</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>framework</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>admin-monitor</module>
|
||||
<module>apidoc-tools</module>
|
||||
<module>uaa</module>
|
||||
</modules>
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>framework</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>uaa</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>uaa-admin</module>
|
||||
<module>uaa-auth</module>
|
||||
</modules>
|
||||
</project>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>uaa</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>uaa-admin</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>uaa-admin</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>common-redis</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>common-sequence</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.orangeforms.uaaadmin;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* UAA管理服务启动类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
@ComponentScan("com.orangeforms")
|
||||
public class UaaAdminApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(UaaAdminApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.orangeforms.uaaadmin.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 应用程序自定义的程序属性配置文件。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@RefreshScope
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "application")
|
||||
public class ApplicationConfig {
|
||||
|
||||
/**
|
||||
* token 加密用的密钥。该值的长度最少10个字符(过短会报错)。
|
||||
*/
|
||||
private String tokenSigningKey;
|
||||
/**
|
||||
* token的Http Request Header的key。
|
||||
*/
|
||||
private String tokenHeaderKey;
|
||||
/**
|
||||
* token在过期之前,但是已经需要被刷新时,response返回的header信息的key。
|
||||
*/
|
||||
private String refreshedTokenHeaderKey;
|
||||
/**
|
||||
* 令牌的过期时间,单位毫秒
|
||||
*/
|
||||
private Long expiration;
|
||||
/**
|
||||
* 授信ip列表,没有填写表示全部信任。多个ip之间逗号分隔,如: http://10.10.10.1:8080,http://10.10.10.2:8080
|
||||
*/
|
||||
private String credentialIpList;
|
||||
/**
|
||||
* Session在Redis中的过期时间(秒)。
|
||||
* 缺省值是 one day + 60s
|
||||
*/
|
||||
private int sessionExpiredSeconds = 86460;
|
||||
/**
|
||||
* 用户密码被重置之后的缺省密码。
|
||||
*/
|
||||
private String defaultUserPassword;
|
||||
/**
|
||||
* 上传文件的基础目录。
|
||||
*/
|
||||
private String uploadFileBaseDir;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.orangeforms.uaaadmin.config;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
/**
|
||||
* 这里主要配置Web的各种过滤器和监听器等Servlet容器组件。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Configuration
|
||||
public class CorsConfig {
|
||||
|
||||
/**
|
||||
* 配置Ajax跨域过滤器。
|
||||
*/
|
||||
@Bean
|
||||
public CorsFilter corsFilterRegistration(ApplicationConfig applicationConfig) {
|
||||
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
|
||||
CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
if (StringUtils.isNotBlank(applicationConfig.getCredentialIpList())) {
|
||||
String[] credentialIpList = StringUtils.split(applicationConfig.getCredentialIpList(), ",");
|
||||
if (credentialIpList.length > 0) {
|
||||
for (String ip : credentialIpList) {
|
||||
corsConfiguration.addAllowedOrigin(ip);
|
||||
}
|
||||
}
|
||||
corsConfiguration.addAllowedHeader("*");
|
||||
corsConfiguration.addAllowedMethod("*");
|
||||
corsConfiguration.addExposedHeader(applicationConfig.getRefreshedTokenHeaderKey());
|
||||
corsConfiguration.setAllowCredentials(true);
|
||||
configSource.registerCorsConfiguration("/**", corsConfiguration);
|
||||
}
|
||||
return new CorsFilter(configSource);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.orangeforms.uaaadmin.config;
|
||||
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* 数据源配置Bean对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@MapperScan(value = {"com.orangeforms.*.dao", "com.orangeforms.common.*.dao"})
|
||||
public class DataSourceConfig {
|
||||
|
||||
@Bean(initMethod = "init", destroyMethod = "close")
|
||||
@Primary
|
||||
@ConfigurationProperties(prefix = "spring.datasource.druid")
|
||||
public DataSource druidDataSource() {
|
||||
return DruidDataSourceBuilder.create().build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.orangeforms.uaaadmin.config;
|
||||
|
||||
import com.orangeforms.uaaadmin.interceptor.AuthenticationInterceptor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* 所有的项目拦截器都在这里集中配置
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Configuration
|
||||
public class InterceptorConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new AuthenticationInterceptor()).addPathPatterns("/admin/**");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.orangeforms.uaaadmin.controller;
|
||||
|
||||
import com.orangeforms.uaaadmin.model.AuthClientDetails;
|
||||
import com.orangeforms.uaaadmin.service.AuthClientDetailsService;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orangeforms.common.core.object.*;
|
||||
import com.orangeforms.common.core.util.*;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.annotation.MyRequestBody;
|
||||
import com.orangeforms.common.core.validator.AddGroup;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.groups.Default;
|
||||
|
||||
/**
|
||||
* 应用客户端操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/uaaadmin/authClientDetails")
|
||||
public class AuthClientDetailsController {
|
||||
|
||||
@Autowired
|
||||
private AuthClientDetailsService authClientDetailsService;
|
||||
|
||||
/**
|
||||
* 新增应用客户端数据。
|
||||
*
|
||||
* @param authClientDetails 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<String> add(@MyRequestBody AuthClientDetails authClientDetails) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(authClientDetails, Default.class, AddGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
authClientDetails = authClientDetailsService.saveNew(authClientDetails);
|
||||
return ResponseResult.success(authClientDetails.getClientId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新应用客户端数据。
|
||||
*
|
||||
* @param authClientDetails 更新对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Void> update(@MyRequestBody AuthClientDetails authClientDetails) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(authClientDetails);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
// 判断数据合法性。
|
||||
AuthClientDetails originalAuthClientDetails = authClientDetailsService.getById(authClientDetails.getClientId());
|
||||
if (originalAuthClientDetails == null) {
|
||||
errorMessage = "数据验证失败,当前应用客户端并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
if (!originalAuthClientDetails.getClientSecretPlain().equals(authClientDetails.getClientSecretPlain())) {
|
||||
errorMessage = "数据验证失败,client_secret不能被修改!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
if (!authClientDetailsService.update(authClientDetails, originalAuthClientDetails)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用客户端数据。
|
||||
*
|
||||
* @param clientId 删除对象主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
public ResponseResult<Void> delete(@MyRequestBody String clientId) {
|
||||
String errorMessage;
|
||||
if (MyCommonUtil.existBlankArgument(clientId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
// 验证关联Id的数据合法性
|
||||
AuthClientDetails originalAuthClientDetails = authClientDetailsService.getById(clientId);
|
||||
if (originalAuthClientDetails == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
if (!authClientDetailsService.remove(clientId)) {
|
||||
errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出符合过滤条件的应用客户端列表。
|
||||
*
|
||||
* @param authClientDetailsFilter 过滤对象。
|
||||
* @param orderParam 排序参数。
|
||||
* @param pageParam 分页参数。
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<AuthClientDetails>> list(
|
||||
@MyRequestBody AuthClientDetails authClientDetailsFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, AuthClientDetails.class);
|
||||
List<AuthClientDetails> resultList =
|
||||
authClientDetailsService.getAuthClientDetailsListWithRelation(authClientDetailsFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看指定应用客户端对象详情。
|
||||
*
|
||||
* @param clientId 指定对象主键Id。
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<AuthClientDetails> view(@RequestParam String clientId) {
|
||||
if (MyCommonUtil.existBlankArgument(clientId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
AuthClientDetails authClientDetails = authClientDetailsService.getByIdWithRelation(clientId, MyRelationParam.full());
|
||||
if (authClientDetails == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(authClientDetails);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.orangeforms.uaaadmin.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.orangeforms.uaaadmin.config.ApplicationConfig;
|
||||
import com.orangeforms.uaaadmin.model.SysUaaOperator;
|
||||
import com.orangeforms.uaaadmin.model.constant.OperatorType;
|
||||
import com.orangeforms.uaaadmin.service.SysUaaOperatorService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.orangeforms.common.core.util.*;
|
||||
import com.orangeforms.common.core.annotation.NoAuthInterface;
|
||||
import com.orangeforms.common.core.annotation.MyRequestBody;
|
||||
import com.orangeforms.common.core.constant.ApplicationConstant;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.object.ResponseResult;
|
||||
import com.orangeforms.common.core.object.TokenData;
|
||||
import org.redisson.api.RBucket;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 登录接口控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/upms/login")
|
||||
public class LoginController {
|
||||
|
||||
@Autowired
|
||||
private SysUaaOperatorService sysOperatorService;
|
||||
@Autowired
|
||||
private ApplicationConfig appConfig;
|
||||
@Autowired
|
||||
private RedissonClient redissonClient;
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
/**
|
||||
* 登录接口。
|
||||
*
|
||||
* @param loginName 登录名。
|
||||
* @param password 密码。
|
||||
* @return 应答结果对象,其中包括JWT的Token数据,以及菜单列表。
|
||||
*/
|
||||
@NoAuthInterface
|
||||
@PostMapping("/doLogin")
|
||||
public ResponseResult<JSONObject> doLogin(
|
||||
@MyRequestBody String loginName, @MyRequestBody String password) throws Exception {
|
||||
if (MyCommonUtil.existBlankArgument(loginName, password)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
SysUaaOperator operator = sysOperatorService.getUaaOperatorByLoginName(loginName);
|
||||
password = URLDecoder.decode(password, StandardCharsets.UTF_8.name());
|
||||
// NOTE: 第一次使用时,请务必阅读ApplicationConstant.PRIVATE_KEY的代码注释。
|
||||
// 执行RsaUtil工具类中的main函数,可以生成新的公钥和私钥。
|
||||
password = RsaUtil.decrypt(password, ApplicationConstant.PRIVATE_KEY);
|
||||
if (operator == null || !passwordEncoder.matches(password, operator.getPassword())) {
|
||||
return ResponseResult.error(ErrorCodeEnum.INVALID_USERNAME_PASSWORD);
|
||||
}
|
||||
String errorMessage;
|
||||
boolean isAdmin = operator.getOperatorType() == OperatorType.ADMIN;
|
||||
Map<String, Object> claims = new HashMap<>(3);
|
||||
String sessionId = operator.getLoginName() + "_" + MyCommonUtil.generateUuid();
|
||||
claims.put("sessionId", sessionId);
|
||||
String token = JwtUtil.generateToken(claims, appConfig.getExpiration(), appConfig.getTokenSigningKey());
|
||||
TokenData tokenData = new TokenData();
|
||||
tokenData.setSessionId(sessionId);
|
||||
tokenData.setUserId(operator.getOperatorId());
|
||||
tokenData.setLoginName(operator.getLoginName());
|
||||
tokenData.setShowName(operator.getShowName());
|
||||
tokenData.setIsAdmin(isAdmin);
|
||||
tokenData.setLoginIp(IpUtil.getRemoteIpAddress(ContextUtil.getHttpRequest()));
|
||||
tokenData.setLoginTime(new Date());
|
||||
RBucket<String> bucket = redissonClient.getBucket(RedisKeyUtil.makeSessionIdKey(sessionId));
|
||||
bucket.set(JSON.toJSONString(tokenData), 4, TimeUnit.HOURS);
|
||||
JSONObject jsonData = new JSONObject();
|
||||
jsonData.put(TokenData.REQUEST_ATTRIBUTE_NAME, token);
|
||||
jsonData.put("showName", operator.getShowName());
|
||||
jsonData.put("isAdmin", isAdmin);
|
||||
// 这里手动将TokenData存入request,便于OperationLogAspect统一处理操作日志。
|
||||
TokenData.addToRequest(tokenData);
|
||||
return ResponseResult.success(jsonData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登出操作。同时将Session相关的信息从缓存中删除。
|
||||
*
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/doLogout")
|
||||
public ResponseResult<Void> doLogout() {
|
||||
TokenData tokenData = TokenData.takeFromRequest();
|
||||
String sessionIdKey = RedisKeyUtil.makeSessionIdKey(tokenData.getSessionId());
|
||||
redissonClient.getBucket(sessionIdKey).delete();
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户修改自己的密码。
|
||||
*
|
||||
* @param oldPass 原有密码。
|
||||
* @param newPass 新密码。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/changePassword")
|
||||
public ResponseResult<Void> changePassword(
|
||||
@MyRequestBody String oldPass, @MyRequestBody String newPass) throws Exception {
|
||||
if (MyCommonUtil.existBlankArgument(newPass, oldPass)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
TokenData tokenData = TokenData.takeFromRequest();
|
||||
SysUaaOperator operator = sysOperatorService.getById(tokenData.getUserId());
|
||||
oldPass = URLDecoder.decode(oldPass, StandardCharsets.UTF_8.name());
|
||||
// NOTE: 第一次使用时,请务必阅读ApplicationConstant.PRIVATE_KEY的代码注释。
|
||||
// 执行RsaUtil工具类中的main函数,可以生成新的公钥和私钥。
|
||||
oldPass = RsaUtil.decrypt(oldPass, ApplicationConstant.PRIVATE_KEY);
|
||||
if (operator == null || !passwordEncoder.matches(oldPass, operator.getPassword())) {
|
||||
return ResponseResult.error(ErrorCodeEnum.INVALID_USERNAME_PASSWORD);
|
||||
}
|
||||
newPass = URLDecoder.decode(newPass, StandardCharsets.UTF_8.name());
|
||||
newPass = RsaUtil.decrypt(newPass, ApplicationConstant.PRIVATE_KEY);
|
||||
if (!sysOperatorService.changePassword(tokenData.getUserId(), newPass)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
package com.orangeforms.uaaadmin.controller;
|
||||
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.orangeforms.common.core.upload.BaseUpDownloader;
|
||||
import com.orangeforms.common.core.upload.UpDownloaderFactory;
|
||||
import com.orangeforms.common.core.upload.UploadResponseInfo;
|
||||
import com.orangeforms.common.core.upload.UploadStoreInfo;
|
||||
import com.orangeforms.common.redis.cache.SessionCacheHelper;
|
||||
import com.orangeforms.uaaadmin.config.ApplicationConfig;
|
||||
import com.orangeforms.uaaadmin.model.SysUaaOperator;
|
||||
import com.orangeforms.uaaadmin.service.SysUaaOperatorService;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orangeforms.common.core.object.*;
|
||||
import com.orangeforms.common.core.util.*;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.annotation.MyRequestBody;
|
||||
import com.orangeforms.common.core.validator.AddGroup;
|
||||
import com.orangeforms.common.core.validator.UpdateGroup;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
import javax.validation.groups.Default;
|
||||
|
||||
/**
|
||||
* 操作员操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/uaaadmin/sysUaaOperator")
|
||||
public class SysUaaOperatorController {
|
||||
|
||||
@Autowired
|
||||
private SysUaaOperatorService sysUaaOperatorService;
|
||||
@Autowired
|
||||
private ApplicationConfig appConfig;
|
||||
@Autowired
|
||||
private SessionCacheHelper cacheHelper;
|
||||
@Autowired
|
||||
private UpDownloaderFactory upDownloaderFactory;
|
||||
|
||||
/**
|
||||
* 新增操作员数据。
|
||||
*
|
||||
* @param sysUaaOperator 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Long> add(@MyRequestBody SysUaaOperator sysUaaOperator) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUaaOperator, Default.class, AddGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
sysUaaOperator = sysUaaOperatorService.saveNew(sysUaaOperator);
|
||||
return ResponseResult.success(sysUaaOperator.getOperatorId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新操作员数据。
|
||||
*
|
||||
* @param sysUaaOperator 更新对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Void> update(@MyRequestBody SysUaaOperator sysUaaOperator) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUaaOperator, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
// 验证关联Id的数据合法性
|
||||
SysUaaOperator originalSysUaaOperator = sysUaaOperatorService.getById(sysUaaOperator.getOperatorId());
|
||||
if (originalSysUaaOperator == null) {
|
||||
errorMessage = "数据验证失败,当前UAA操作员并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
if (!sysUaaOperatorService.update(sysUaaOperator, originalSysUaaOperator)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置UAA操作员密码到初始化密码。
|
||||
*
|
||||
* @param uaaOperatorId 操作员Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/resetPassword")
|
||||
public ResponseResult<Void> resetPassword(@MyRequestBody Long uaaOperatorId) {
|
||||
if (MyCommonUtil.existBlankArgument(uaaOperatorId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
if (!sysUaaOperatorService.changePassword(uaaOperatorId, appConfig.getDefaultUserPassword())) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除操作员数据。
|
||||
*
|
||||
* @param operatorId 删除对象主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
public ResponseResult<Void> delete(@MyRequestBody Long operatorId) {
|
||||
String errorMessage;
|
||||
if (MyCommonUtil.existBlankArgument(operatorId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
// 验证关联Id的数据合法性
|
||||
SysUaaOperator originalSysUaaOperator = sysUaaOperatorService.getById(operatorId);
|
||||
if (originalSysUaaOperator == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
if (!sysUaaOperatorService.remove(operatorId)) {
|
||||
errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出符合过滤条件的操作员列表。
|
||||
*
|
||||
* @param sysUaaOperatorFilter 过滤对象。
|
||||
* @param orderParam 排序参数。
|
||||
* @param pageParam 分页参数。
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<SysUaaOperator>> list(
|
||||
@MyRequestBody SysUaaOperator sysUaaOperatorFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUaaOperator.class);
|
||||
List<SysUaaOperator> resultList =
|
||||
sysUaaOperatorService.getSysUaaOperatorListWithRelation(sysUaaOperatorFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看指定操作员对象详情。
|
||||
*
|
||||
* @param operatorId 指定对象主键Id。
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SysUaaOperator> view(@RequestParam Long operatorId) {
|
||||
if (MyCommonUtil.existBlankArgument(operatorId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
SysUaaOperator sysUaaOperator = sysUaaOperatorService.getByIdWithRelation(operatorId, MyRelationParam.full());
|
||||
if (sysUaaOperator == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(sysUaaOperator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件文件下载。
|
||||
* 这里将图片和其他类型的附件文件放到不同的父目录下,主要为了便于今后图片文件的迁移。
|
||||
*
|
||||
* @param operatorId 附件所在记录的主键Id。
|
||||
* @param fieldName 附件所属的字段名。
|
||||
* @param filename 文件名。如果没有提供该参数,就从当前记录的指定字段中读取。
|
||||
* @param asImage 下载文件是否为图片。
|
||||
* @param response Http 应答对象。
|
||||
*/
|
||||
@GetMapping("/download")
|
||||
public void download(
|
||||
@RequestParam Long operatorId,
|
||||
@RequestParam String fieldName,
|
||||
@RequestParam String filename,
|
||||
@RequestParam Boolean asImage,
|
||||
HttpServletResponse response) {
|
||||
if (MyCommonUtil.existBlankArgument(operatorId, fieldName, filename, asImage)) {
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
return;
|
||||
}
|
||||
// 使用try来捕获异常,是为了保证一旦出现异常可以返回500的错误状态,便于调试。
|
||||
// 否则有可能给前端返回的是200的错误码。
|
||||
try {
|
||||
SysUaaOperator sysUaaOperator = sysUaaOperatorService.getById(operatorId);
|
||||
if (sysUaaOperator == null) {
|
||||
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
String fieldJsonData = (String) ReflectUtil.getFieldValue(sysUaaOperator, fieldName);
|
||||
if (fieldJsonData == null) {
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
return;
|
||||
}
|
||||
if (!BaseUpDownloader.containFile(fieldJsonData, filename)) {
|
||||
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||
return;
|
||||
}
|
||||
UploadStoreInfo storeInfo = MyModelUtil.getUploadStoreInfo(SysUaaOperator.class, fieldName);
|
||||
if (!storeInfo.isSupportUpload()) {
|
||||
ResponseResult.output(HttpServletResponse.SC_NOT_IMPLEMENTED,
|
||||
ResponseResult.error(ErrorCodeEnum.INVALID_UPLOAD_FIELD));
|
||||
return;
|
||||
}
|
||||
BaseUpDownloader upDownloader = upDownloaderFactory.get(storeInfo.getStoreType());
|
||||
upDownloader.doDownload(appConfig.getUploadFileBaseDir(),
|
||||
SysUaaOperator.class.getSimpleName(), fieldName, filename, asImage, response);
|
||||
} catch (Exception e) {
|
||||
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传操作。
|
||||
*
|
||||
* @param fieldName 上传文件名。
|
||||
* @param asImage 是否作为图片上传。如果是图片,今后下载的时候无需权限验证。否则就是附件上传,下载时需要权限验证。
|
||||
* @param uploadFile 上传文件对象。
|
||||
* @param response Http 应答对象。
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public void upload(
|
||||
@RequestParam String fieldName,
|
||||
@RequestParam Boolean asImage,
|
||||
@RequestParam("uploadFile") MultipartFile uploadFile,
|
||||
HttpServletResponse response) throws Exception {
|
||||
UploadStoreInfo storeInfo = MyModelUtil.getUploadStoreInfo(SysUaaOperator.class, fieldName);
|
||||
if (!storeInfo.isSupportUpload()) {
|
||||
ResponseResult.output(HttpServletResponse.SC_FORBIDDEN,
|
||||
ResponseResult.error(ErrorCodeEnum.INVALID_UPLOAD_FIELD));
|
||||
return;
|
||||
}
|
||||
BaseUpDownloader upDownloader = upDownloaderFactory.get(storeInfo.getStoreType());
|
||||
UploadResponseInfo responseInfo = upDownloader.doUpload(null,
|
||||
appConfig.getUploadFileBaseDir(), SysUaaOperator.class.getSimpleName(), fieldName, asImage, uploadFile);
|
||||
if (responseInfo.getUploadFailed()) {
|
||||
ResponseResult.output(HttpServletResponse.SC_FORBIDDEN,
|
||||
ResponseResult.error(ErrorCodeEnum.UPLOAD_FAILED, responseInfo.getErrorMessage()));
|
||||
return;
|
||||
}
|
||||
cacheHelper.putSessionUploadFile(responseInfo.getFilename());
|
||||
ResponseResult.output(ResponseResult.success(responseInfo));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.orangeforms.uaaadmin.controller;
|
||||
|
||||
import com.orangeforms.uaaadmin.config.ApplicationConfig;
|
||||
import com.orangeforms.uaaadmin.model.SysUaaUser;
|
||||
import com.orangeforms.uaaadmin.service.SysUaaUserService;
|
||||
import com.github.pagehelper.page.PageMethod;
|
||||
import com.orangeforms.common.core.object.*;
|
||||
import com.orangeforms.common.core.util.*;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.annotation.MyRequestBody;
|
||||
import com.orangeforms.common.core.validator.AddGroup;
|
||||
import com.orangeforms.common.core.validator.UpdateGroup;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.groups.Default;
|
||||
|
||||
/**
|
||||
* UAA用户操作控制器类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/uaaadmin/sysUaaUser")
|
||||
public class SysUaaUserController {
|
||||
|
||||
@Autowired
|
||||
private SysUaaUserService sysUaaUserService;
|
||||
@Autowired
|
||||
private ApplicationConfig appConfig;
|
||||
|
||||
/**
|
||||
* 新增UAA用户数据。
|
||||
*
|
||||
* @param sysUaaUser 新增对象。
|
||||
* @return 应答结果对象,包含新增对象主键Id。
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public ResponseResult<Long> add(@MyRequestBody SysUaaUser sysUaaUser) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUaaUser, Default.class, AddGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
sysUaaUser = sysUaaUserService.saveNew(sysUaaUser);
|
||||
return ResponseResult.success(sysUaaUser.getUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新UAA用户数据。
|
||||
*
|
||||
* @param sysUaaUser 更新对象。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public ResponseResult<Void> update(@MyRequestBody SysUaaUser sysUaaUser) {
|
||||
String errorMessage = MyCommonUtil.getModelValidationError(sysUaaUser, Default.class, UpdateGroup.class);
|
||||
if (errorMessage != null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
|
||||
}
|
||||
// 验证关联Id的数据合法性
|
||||
SysUaaUser originalSysUaaUser = sysUaaUserService.getById(sysUaaUser.getUserId());
|
||||
if (originalSysUaaUser == null) {
|
||||
errorMessage = "数据验证失败,当前UAA用户并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
if (!sysUaaUserService.update(sysUaaUser, originalSysUaaUser)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置UAA用户密码到初始化密码。
|
||||
*
|
||||
* @param uaaUserId 用户Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/resetPassword")
|
||||
public ResponseResult<Void> resetPassword(@MyRequestBody Long uaaUserId) {
|
||||
if (MyCommonUtil.existBlankArgument(uaaUserId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
if (!sysUaaUserService.changePassword(uaaUserId, appConfig.getDefaultUserPassword())) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除UAA用户数据。
|
||||
*
|
||||
* @param userId 删除对象主键Id。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
public ResponseResult<Void> delete(@MyRequestBody Long userId) {
|
||||
String errorMessage;
|
||||
if (MyCommonUtil.existBlankArgument(userId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
// 验证关联Id的数据合法性
|
||||
SysUaaUser originalSysUaaUser = sysUaaUserService.getById(userId);
|
||||
if (originalSysUaaUser == null) {
|
||||
// NOTE: 修改下面方括号中的话述
|
||||
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
if (!sysUaaUserService.remove(userId)) {
|
||||
errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出符合过滤条件的UAA用户列表。
|
||||
*
|
||||
* @param sysUaaUserFilter 过滤对象。
|
||||
* @param orderParam 排序参数。
|
||||
* @param pageParam 分页参数。
|
||||
* @return 应答结果对象,包含查询结果集。
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public ResponseResult<MyPageData<SysUaaUser>> list(
|
||||
@MyRequestBody SysUaaUser sysUaaUserFilter,
|
||||
@MyRequestBody MyOrderParam orderParam,
|
||||
@MyRequestBody MyPageParam pageParam) {
|
||||
if (pageParam != null) {
|
||||
PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize());
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(orderParam, SysUaaUser.class);
|
||||
List<SysUaaUser> resultList = sysUaaUserService.getSysUaaUserListWithRelation(sysUaaUserFilter, orderBy);
|
||||
return ResponseResult.success(MyPageUtil.makeResponseData(resultList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看指定UAA用户对象详情。
|
||||
*
|
||||
* @param userId 指定对象主键Id。
|
||||
* @return 应答结果对象,包含对象详情。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SysUaaUser> view(@RequestParam Long userId) {
|
||||
if (MyCommonUtil.existBlankArgument(userId)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
SysUaaUser sysUaaUser = sysUaaUserService.getByIdWithRelation(userId, MyRelationParam.full());
|
||||
if (sysUaaUser == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(sysUaaUser);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.orangeforms.uaaadmin.dao;
|
||||
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orangeforms.uaaadmin.model.AuthClientDetails;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 应用客户端数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface AuthClientDetailsMapper extends BaseDaoMapper<AuthClientDetails> {
|
||||
|
||||
/**
|
||||
* 获取过滤后的对象列表。
|
||||
*
|
||||
* @param authClientDetailsFilter 主表过滤对象。
|
||||
* @param orderBy 排序字符串,order by从句的参数。
|
||||
* @return 对象列表。
|
||||
*/
|
||||
List<AuthClientDetails> getAuthClientDetailsList(
|
||||
@Param("authClientDetailsFilter") AuthClientDetails authClientDetailsFilter, @Param("orderBy") String orderBy);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.orangeforms.uaaadmin.dao;
|
||||
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orangeforms.uaaadmin.model.SysUaaOperator;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 操作员数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface SysUaaOperatorMapper extends BaseDaoMapper<SysUaaOperator> {
|
||||
|
||||
/**
|
||||
* 获取过滤后的对象列表。
|
||||
*
|
||||
* @param sysUaaOperatorFilter 主表过滤对象。
|
||||
* @param orderBy 排序字符串,order by从句的参数。
|
||||
* @return 对象列表。
|
||||
*/
|
||||
List<SysUaaOperator> getSysUaaOperatorList(
|
||||
@Param("sysUaaOperatorFilter") SysUaaOperator sysUaaOperatorFilter, @Param("orderBy") String orderBy);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.orangeforms.uaaadmin.dao;
|
||||
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orangeforms.uaaadmin.model.SysUaaUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* UAA用户数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface SysUaaUserMapper extends BaseDaoMapper<SysUaaUser> {
|
||||
|
||||
/**
|
||||
* 获取过滤后的对象列表。
|
||||
*
|
||||
* @param sysUaaUserFilter 主表过滤对象。
|
||||
* @param orderBy 排序字符串,order by从句的参数。
|
||||
* @return 对象列表。
|
||||
*/
|
||||
List<SysUaaUser> getSysUaaUserList(
|
||||
@Param("sysUaaUserFilter") SysUaaUser sysUaaUserFilter, @Param("orderBy") String orderBy);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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.orangeforms.uaaadmin.dao.AuthClientDetailsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.orangeforms.uaaadmin.model.AuthClientDetails">
|
||||
<id column="client_id" jdbcType="CHAR" property="clientId"/>
|
||||
<result column="client_secret" jdbcType="VARCHAR" property="clientSecret"/>
|
||||
<result column="client_secret_plain" jdbcType="VARCHAR" property="clientSecretPlain"/>
|
||||
<result column="client_desc" jdbcType="VARCHAR" property="clientDesc"/>
|
||||
<result column="authorized_grant_types" jdbcType="VARCHAR" property="authorizedGrantTypes"/>
|
||||
<result column="web_server_redirect_uri" jdbcType="VARCHAR" property="webServerRedirectUri"/>
|
||||
<result column="access_token_validity" jdbcType="INTEGER" property="accessTokenValidity"/>
|
||||
<result column="refresh_token_validity" jdbcType="INTEGER" property="refreshTokenValidity"/>
|
||||
<result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="deleted_flag" jdbcType="INTEGER" property="deletedFlag"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="filterRef">
|
||||
<if test="authClientDetailsFilter != null">
|
||||
<if test="authClientDetailsFilter.clientDesc != null and authClientDetailsFilter.clientDesc != ''">
|
||||
AND zz_auth_client_details.client_desc = #{authClientDetailsFilter.clientDesc}
|
||||
</if>
|
||||
</if>
|
||||
AND zz_auth_client_details.deleted_flag = ${@com.orangeforms.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
|
||||
<select id="getAuthClientDetailsList" resultMap="BaseResultMap" parameterType="com.orangeforms.uaaadmin.model.AuthClientDetails">
|
||||
SELECT * FROM zz_auth_client_details
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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.orangeforms.uaaadmin.dao.SysUaaOperatorMapper">
|
||||
<resultMap id="BaseResultMap" type="com.orangeforms.uaaadmin.model.SysUaaOperator">
|
||||
<id column="operator_id" jdbcType="BIGINT" property="operatorId"/>
|
||||
<result column="login_name" jdbcType="VARCHAR" property="loginName"/>
|
||||
<result column="password" jdbcType="VARCHAR" property="password"/>
|
||||
<result column="show_name" jdbcType="VARCHAR" property="showName"/>
|
||||
<result column="operator_type" jdbcType="INTEGER" property="operatorType"/>
|
||||
<result column="head_image_url" jdbcType="VARCHAR" property="headImageUrl"/>
|
||||
<result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="deleted_flag" jdbcType="INTEGER" property="deletedFlag"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="filterRef">
|
||||
<if test="sysUaaOperatorFilter != null">
|
||||
<if test="sysUaaOperatorFilter.operatorType != null">
|
||||
AND zz_sys_uaa_operator.operator_type = #{sysUaaOperatorFilter.operatorType}
|
||||
</if>
|
||||
<if test="sysUaaOperatorFilter.searchString != null and sysUaaOperatorFilter.searchString != ''">
|
||||
<bind name = "safeSearchString" value = "'%' + sysUaaOperatorFilter.searchString + '%'" />
|
||||
AND CONCAT(IFNULL(zz_sys_uaa_operator.login_name,''), IFNULL(zz_sys_uaa_operator.show_name,'')) LIKE #{safeSearchString}
|
||||
</if>
|
||||
</if>
|
||||
AND zz_sys_uaa_operator.deleted_flag = ${@com.orangeforms.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
|
||||
<select id="getSysUaaOperatorList" resultMap="BaseResultMap" parameterType="com.orangeforms.uaaadmin.model.SysUaaOperator">
|
||||
SELECT * FROM zz_sys_uaa_operator
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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.orangeforms.uaaadmin.dao.SysUaaUserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.orangeforms.uaaadmin.model.SysUaaUser">
|
||||
<id column="user_id" jdbcType="BIGINT" property="userId"/>
|
||||
<result column="username" jdbcType="VARCHAR" property="username"/>
|
||||
<result column="password" jdbcType="VARCHAR" property="password"/>
|
||||
<result column="show_name" jdbcType="VARCHAR" property="showName"/>
|
||||
<result column="locked" jdbcType="INTEGER" property="locked"/>
|
||||
<result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="deleted_flag" jdbcType="INTEGER" property="deletedFlag"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="filterRef">
|
||||
<if test="sysUaaUserFilter != null">
|
||||
<if test="sysUaaUserFilter.locked != null">
|
||||
AND zz_sys_uaa_user.locked = #{sysUaaUserFilter.locked}
|
||||
</if>
|
||||
<if test="sysUaaUserFilter.createTimeStart != null and sysUaaUserFilter.createTimeStart != ''">
|
||||
AND zz_sys_uaa_user.create_time >= #{sysUaaUserFilter.createTimeStart}
|
||||
</if>
|
||||
<if test="sysUaaUserFilter.createTimeEnd != null and sysUaaUserFilter.createTimeEnd != ''">
|
||||
AND zz_sys_uaa_user.create_time <= #{sysUaaUserFilter.createTimeEnd}
|
||||
</if>
|
||||
<if test="sysUaaUserFilter.searchString != null and sysUaaUserFilter.searchString != ''">
|
||||
<bind name = "safeSearchString" value = "'%' + sysUaaUserFilter.searchString + '%'" />
|
||||
AND CONCAT(IFNULL(zz_sys_uaa_user.username,''), IFNULL(zz_sys_uaa_user.show_name,'')) LIKE #{safeSearchString}
|
||||
</if>
|
||||
</if>
|
||||
AND zz_sys_uaa_user.deleted_flag = ${@com.orangeforms.common.core.constant.GlobalDeletedFlag@NORMAL}
|
||||
</sql>
|
||||
|
||||
<select id="getSysUaaUserList" resultMap="BaseResultMap" parameterType="com.orangeforms.uaaadmin.model.SysUaaUser">
|
||||
SELECT * FROM zz_sys_uaa_user
|
||||
<where>
|
||||
<include refid="filterRef"/>
|
||||
</where>
|
||||
<if test="orderBy != null and orderBy != ''">
|
||||
ORDER BY ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.orangeforms.uaaadmin.interceptor;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orangeforms.common.core.annotation.NoAuthInterface;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.object.ResponseResult;
|
||||
import com.orangeforms.common.core.object.TokenData;
|
||||
import com.orangeforms.common.core.util.ApplicationContextHolder;
|
||||
import com.orangeforms.common.core.util.JwtUtil;
|
||||
import com.orangeforms.common.core.util.RedisKeyUtil;
|
||||
import com.orangeforms.uaaadmin.config.ApplicationConfig;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.redisson.api.RBucket;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* 登录用户Token验证、生成和权限验证的拦截器。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
public class AuthenticationInterceptor implements HandlerInterceptor {
|
||||
|
||||
private final ApplicationConfig appConfig =
|
||||
ApplicationContextHolder.getBean("applicationConfig");
|
||||
private final RedissonClient redissonClient =
|
||||
ApplicationContextHolder.getBean(RedissonClient.class);
|
||||
private final String operatorAdminUrlPrefix = "/admin/uaaadmin/sysUaaOperator";
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
||||
throws Exception {
|
||||
String url = request.getRequestURI();
|
||||
// 如果接口方法标记NoAuthInterface注解,可以直接跳过Token鉴权验证,这里主要为了测试接口方便
|
||||
if (handler instanceof HandlerMethod) {
|
||||
HandlerMethod hm = (HandlerMethod) handler;
|
||||
if (hm.getBeanType().getAnnotation(NoAuthInterface.class) != null
|
||||
|| hm.getMethodAnnotation(NoAuthInterface.class) != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
String token = request.getHeader(appConfig.getTokenHeaderKey());
|
||||
if (StringUtils.isBlank(token)) {
|
||||
token = request.getParameter(appConfig.getTokenHeaderKey());
|
||||
}
|
||||
Claims c = JwtUtil.parseToken(token, appConfig.getTokenSigningKey());
|
||||
if (JwtUtil.isNullOrExpired(c)) {
|
||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
this.outputResponseMessage(response,
|
||||
ResponseResult.error(ErrorCodeEnum.UNAUTHORIZED_LOGIN, "用户会话已过期或尚未登录,请重新登录!"));
|
||||
return false;
|
||||
}
|
||||
String sessionId = (String) c.get("sessionId");
|
||||
RBucket<String> bucket = redissonClient.getBucket(RedisKeyUtil.makeSessionIdKey(sessionId));
|
||||
String tokenString = bucket.get();
|
||||
if (tokenString == null) {
|
||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
this.outputResponseMessage(response,
|
||||
ResponseResult.error(ErrorCodeEnum.UNAUTHORIZED_LOGIN, "用户会话已失效,请重新登录!"));
|
||||
return false;
|
||||
}
|
||||
TokenData tokenData = JSON.parseObject(tokenString, TokenData.class);
|
||||
TokenData.addToRequest(tokenData);
|
||||
// 操作员管理的URL接口,只有管理员可以访问。
|
||||
if (!tokenData.getIsAdmin() && StringUtils.startsWithIgnoreCase(url, this.operatorAdminUrlPrefix)) {
|
||||
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||
this.outputResponseMessage(response,
|
||||
ResponseResult.error(ErrorCodeEnum.NO_OPERATION_PERMISSION));
|
||||
return false;
|
||||
}
|
||||
if (JwtUtil.needToRefresh(c)) {
|
||||
String refreshedToken = JwtUtil.generateToken(c, appConfig.getExpiration(), appConfig.getTokenSigningKey());
|
||||
response.addHeader(appConfig.getRefreshedTokenHeaderKey(), refreshedToken);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
|
||||
ModelAndView modelAndView) throws Exception {
|
||||
// 这里需要空注解,否则sonar会不happy。
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
|
||||
throws Exception {
|
||||
// 这里需要空注解,否则sonar会不happy。
|
||||
}
|
||||
|
||||
private void outputResponseMessage(HttpServletResponse response, ResponseResult<Object> respObj) {
|
||||
PrintWriter out;
|
||||
try {
|
||||
out = response.getWriter();
|
||||
} catch (IOException e) {
|
||||
log.error("Failed to call OutputResponseMessage.", e);
|
||||
return;
|
||||
}
|
||||
response.setContentType("application/json; charset=utf-8");
|
||||
out.print(JSON.toJSONString(respObj));
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.orangeforms.uaaadmin.model;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orangeforms.common.core.base.model.BaseModel;
|
||||
import com.orangeforms.common.core.validator.AddGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* AuthClientDetails实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "zz_auth_client_details")
|
||||
public class AuthClientDetails extends BaseModel {
|
||||
|
||||
/**
|
||||
* 应用标识。
|
||||
*/
|
||||
@NotBlank(message = "数据验证失败,应用标识不能为空!")
|
||||
@TableId(value = "client_id")
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 应用密钥(bcyt) 加密。
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@TableField(value = "client_secret")
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 应用密钥(明文)。
|
||||
*/
|
||||
@NotBlank(message = "数据验证失败,应用密钥为空!", groups = {AddGroup.class})
|
||||
@TableField(value = "client_secret_plain")
|
||||
private String clientSecretPlain;
|
||||
|
||||
/**
|
||||
* 应用名称。
|
||||
*/
|
||||
@TableField(value = "client_desc")
|
||||
private String clientDesc;
|
||||
|
||||
/**
|
||||
* 5种oauth授权方式(authorization_code,password,refresh_token,client_credentials)。
|
||||
*/
|
||||
@TableField(value = "authorized_grant_types")
|
||||
private String authorizedGrantTypes;
|
||||
|
||||
/**
|
||||
* 回调地址。
|
||||
*/
|
||||
@TableField(value = "web_server_redirect_uri")
|
||||
private String webServerRedirectUri;
|
||||
|
||||
/**
|
||||
* access_token有效期。
|
||||
*/
|
||||
@NotNull(message = "数据验证失败,TOKEN 有效期不能为空!")
|
||||
@TableField(value = "access_token_validity")
|
||||
private Integer accessTokenValidity;
|
||||
|
||||
/**
|
||||
* refresh_token有效期。
|
||||
*/
|
||||
@TableField(value = "refresh_token_validity")
|
||||
private Integer refreshTokenValidity;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@TableLogic
|
||||
@TableField(value = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.orangeforms.uaaadmin.model;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orangeforms.common.core.util.MyCommonUtil;
|
||||
import com.orangeforms.common.core.base.model.BaseModel;
|
||||
import com.orangeforms.common.core.annotation.RelationConstDict;
|
||||
import com.orangeforms.common.core.annotation.UploadFlagColumn;
|
||||
import com.orangeforms.common.core.upload.UploadStoreTypeEnum;
|
||||
import com.orangeforms.common.core.validator.AddGroup;
|
||||
import com.orangeforms.common.core.validator.UpdateGroup;
|
||||
import com.orangeforms.common.core.validator.ConstDictRef;
|
||||
import com.orangeforms.uaaadmin.model.constant.OperatorType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* SysUaaOperator实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "zz_sys_uaa_operator")
|
||||
public class SysUaaOperator extends BaseModel {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
@TableId(value = "operator_id")
|
||||
private Long operatorId;
|
||||
|
||||
/**
|
||||
* 用户登录名称。
|
||||
*/
|
||||
@NotBlank(message = "数据验证失败,登录名称不能为空!")
|
||||
@TableField(value = "login_name")
|
||||
private String loginName;
|
||||
|
||||
/**
|
||||
* 密码。
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@NotBlank(message = "数据验证失败,密码不能为空!", groups = {AddGroup.class})
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户显示名称。
|
||||
*/
|
||||
@NotBlank(message = "数据验证失败,用户昵称不能为空!")
|
||||
@TableField(value = "show_name")
|
||||
private String showName;
|
||||
|
||||
/**
|
||||
* 操作员类型(0: 管理员 1: 普通操作员)。
|
||||
*/
|
||||
@NotNull(message = "数据验证失败,操作员类型不能为空!")
|
||||
@ConstDictRef(constDictClass = OperatorType.class, message = "数据验证失败,操作员类型为无效值!")
|
||||
@TableField(value = "operator_type")
|
||||
private Integer operatorType;
|
||||
|
||||
/**
|
||||
* 用户头像的Url。
|
||||
*/
|
||||
@UploadFlagColumn(storeType = UploadStoreTypeEnum.LOCAL_SYSTEM)
|
||||
@TableField(value = "head_image_url")
|
||||
private String headImageUrl;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@TableLogic
|
||||
@TableField(value = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
|
||||
/**
|
||||
* login_name / show_name LIKE搜索字符串。
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String searchString;
|
||||
|
||||
public void setSearchString(String searchString) {
|
||||
this.searchString = MyCommonUtil.replaceSqlWildcard(searchString);
|
||||
}
|
||||
|
||||
@RelationConstDict(
|
||||
masterIdField = "operatorType",
|
||||
constantDictClass = OperatorType.class)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> operatorTypeDictMap;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.orangeforms.uaaadmin.model;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orangeforms.common.core.util.MyCommonUtil;
|
||||
import com.orangeforms.common.core.base.model.BaseModel;
|
||||
import com.orangeforms.common.core.annotation.RelationConstDict;
|
||||
import com.orangeforms.common.core.validator.AddGroup;
|
||||
import com.orangeforms.common.core.validator.UpdateGroup;
|
||||
import com.orangeforms.common.core.validator.ConstDictRef;
|
||||
import com.orangeforms.uaaadmin.model.constant.UserStatus;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* SysUaaUser实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "zz_sys_uaa_user")
|
||||
public class SysUaaUser extends BaseModel {
|
||||
|
||||
/**
|
||||
* 主键Id。
|
||||
*/
|
||||
@NotNull(message = "数据验证失败,主键Id不能为空!", groups = {UpdateGroup.class})
|
||||
@TableId(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户登录名称。
|
||||
*/
|
||||
@NotBlank(message = "数据验证失败,登录名称不能为空!")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码。
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@NotBlank(message = "数据验证失败,密码不能为空!", groups = {AddGroup.class})
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户显示名称。
|
||||
*/
|
||||
@NotBlank(message = "数据验证失败,用户昵称不能为空!")
|
||||
@TableField(value = "show_name")
|
||||
private String showName;
|
||||
|
||||
/**
|
||||
* 状态(0: 正常 1: 锁定)。
|
||||
*/
|
||||
@NotNull(message = "数据验证失败,用户状态不能为空!")
|
||||
@ConstDictRef(constDictClass = UserStatus.class, message = "数据验证失败,用户状态为无效值!")
|
||||
private Integer locked;
|
||||
|
||||
/**
|
||||
* 逻辑删除标记字段(1: 正常 -1: 已删除)。
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@TableLogic
|
||||
@TableField(value = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
|
||||
/**
|
||||
* [创建时间] 范围过滤起始值(>=)。
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String createTimeStart;
|
||||
|
||||
/**
|
||||
* [创建时间] 范围过滤结束值(<=)。
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String createTimeEnd;
|
||||
|
||||
/**
|
||||
* username / show_name LIKE搜索字符串。
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String searchString;
|
||||
|
||||
public void setSearchString(String searchString) {
|
||||
this.searchString = MyCommonUtil.replaceSqlWildcard(searchString);
|
||||
}
|
||||
|
||||
@RelationConstDict(
|
||||
masterIdField = "locked",
|
||||
constantDictClass = UserStatus.class)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> lockedDictMap;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.orangeforms.uaaadmin.model.constant;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户类型常量字典对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public final class OperatorType {
|
||||
|
||||
/**
|
||||
* 管理员。
|
||||
*/
|
||||
public static final int ADMIN = 0;
|
||||
/**
|
||||
* 普通操作员。
|
||||
*/
|
||||
public static final int NORMAL = 1;
|
||||
|
||||
private static final Map<Object, String> DICT_MAP = new HashMap<>(2);
|
||||
static {
|
||||
DICT_MAP.put(ADMIN, "管理员");
|
||||
DICT_MAP.put(NORMAL, "普通操作员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断参数是否为当前常量字典的合法值。
|
||||
*
|
||||
* @param value 待验证的参数值。
|
||||
* @return 合法返回true,否则false。
|
||||
*/
|
||||
public static boolean isValid(Integer value) {
|
||||
return value != null && DICT_MAP.containsKey(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 私有构造函数,明确标识该常量类的作用。
|
||||
*/
|
||||
private OperatorType() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.orangeforms.uaaadmin.model.constant;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户状态常量字典对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public final class UserStatus {
|
||||
|
||||
/**
|
||||
* 正常。
|
||||
*/
|
||||
public static final int NORMAL = 0;
|
||||
/**
|
||||
* 锁定。
|
||||
*/
|
||||
public static final int LOCKED = 1;
|
||||
|
||||
private static final Map<Object, String> DICT_MAP = new HashMap<>(2);
|
||||
static {
|
||||
DICT_MAP.put(NORMAL, "正常");
|
||||
DICT_MAP.put(LOCKED, "锁定");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断参数是否为当前常量字典的合法值。
|
||||
*
|
||||
* @param value 待验证的参数值。
|
||||
* @return 合法返回true,否则false。
|
||||
*/
|
||||
public static boolean isValid(Integer value) {
|
||||
return value != null && DICT_MAP.containsKey(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 私有构造函数,明确标识该常量类的作用。
|
||||
*/
|
||||
private UserStatus() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.orangeforms.uaaadmin.service;
|
||||
|
||||
import com.orangeforms.common.core.base.service.IBaseService;
|
||||
import com.orangeforms.uaaadmin.model.AuthClientDetails;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 应用客户端数据操作服务接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface AuthClientDetailsService extends IBaseService<AuthClientDetails, String> {
|
||||
|
||||
/**
|
||||
* 保存新增对象。
|
||||
*
|
||||
* @param authClientDetails 新增对象。
|
||||
* @return 返回新增对象。
|
||||
*/
|
||||
AuthClientDetails saveNew(AuthClientDetails authClientDetails);
|
||||
|
||||
/**
|
||||
* 更新数据对象。
|
||||
*
|
||||
* @param authClientDetails 更新的对象。
|
||||
* @param originalAuthClientDetails 原有数据对象。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
boolean update(AuthClientDetails authClientDetails, AuthClientDetails originalAuthClientDetails);
|
||||
|
||||
/**
|
||||
* 删除指定数据。
|
||||
*
|
||||
* @param clientId 主键Id。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
boolean remove(String clientId);
|
||||
|
||||
/**
|
||||
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
|
||||
* 如果需要同时获取关联数据,请移步(getAuthClientDetailsListWithRelation)方法。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
List<AuthClientDetails> getAuthClientDetailsList(AuthClientDetails filter, String orderBy);
|
||||
|
||||
/**
|
||||
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
|
||||
* 如果仅仅需要获取主表数据,请移步(getAuthClientDetailsList),以便获取更好的查询性能。
|
||||
*
|
||||
* @param filter 主表过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
List<AuthClientDetails> getAuthClientDetailsListWithRelation(AuthClientDetails filter, String orderBy);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.orangeforms.uaaadmin.service;
|
||||
|
||||
import com.orangeforms.common.core.base.service.IBaseService;
|
||||
import com.orangeforms.uaaadmin.model.SysUaaOperator;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 操作员数据操作服务接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface SysUaaOperatorService extends IBaseService<SysUaaOperator, Long> {
|
||||
|
||||
/**
|
||||
* 根据登录名获取UAA操作员对象。
|
||||
*
|
||||
* @param loginName UAA操作员登录名。
|
||||
* @return UAA操作员对象。
|
||||
*/
|
||||
SysUaaOperator getUaaOperatorByLoginName(String loginName);
|
||||
|
||||
/**
|
||||
* 保存新增对象。
|
||||
*
|
||||
* @param sysUaaOperator 新增对象。
|
||||
* @return 返回新增对象。
|
||||
*/
|
||||
SysUaaOperator saveNew(SysUaaOperator sysUaaOperator);
|
||||
|
||||
/**
|
||||
* 更新数据对象。
|
||||
*
|
||||
* @param sysUaaOperator 更新的对象。
|
||||
* @param originalSysUaaOperator 原有数据对象。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
boolean update(SysUaaOperator sysUaaOperator, SysUaaOperator originalSysUaaOperator);
|
||||
|
||||
/**
|
||||
* 修改密码。
|
||||
*
|
||||
* @param uaaOperatorId 操作员Id。
|
||||
* @param newPass 新密码明文。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
boolean changePassword(Long uaaOperatorId, String newPass);
|
||||
|
||||
/**
|
||||
* 删除指定数据。
|
||||
*
|
||||
* @param operatorId 主键Id。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
boolean remove(Long operatorId);
|
||||
|
||||
/**
|
||||
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
|
||||
* 如果需要同时获取关联数据,请移步(getSysUaaOperatorListWithRelation)方法。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
List<SysUaaOperator> getSysUaaOperatorList(SysUaaOperator filter, String orderBy);
|
||||
|
||||
/**
|
||||
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
|
||||
* 如果仅仅需要获取主表数据,请移步(getSysUaaOperatorList),以便获取更好的查询性能。
|
||||
*
|
||||
* @param filter 主表过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
List<SysUaaOperator> getSysUaaOperatorListWithRelation(SysUaaOperator filter, String orderBy);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.orangeforms.uaaadmin.service;
|
||||
|
||||
import com.orangeforms.common.core.base.service.IBaseService;
|
||||
import com.orangeforms.uaaadmin.model.SysUaaUser;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* UAA用户数据操作服务接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface SysUaaUserService extends IBaseService<SysUaaUser, Long> {
|
||||
|
||||
/**
|
||||
* 保存新增对象。
|
||||
*
|
||||
* @param sysUaaUser 新增对象。
|
||||
* @return 返回新增对象。
|
||||
*/
|
||||
SysUaaUser saveNew(SysUaaUser sysUaaUser);
|
||||
|
||||
/**
|
||||
* 更新数据对象。
|
||||
*
|
||||
* @param sysUaaUser 更新的对象。
|
||||
* @param originalSysUaaUser 原有数据对象。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
boolean update(SysUaaUser sysUaaUser, SysUaaUser originalSysUaaUser);
|
||||
|
||||
/**
|
||||
* 修改密码。
|
||||
*
|
||||
* @param uaaUserId 用户Id。
|
||||
* @param newPass 新密码明文。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
boolean changePassword(Long uaaUserId, String newPass);
|
||||
|
||||
/**
|
||||
* 删除指定数据。
|
||||
*
|
||||
* @param userId 主键Id。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
boolean remove(Long userId);
|
||||
|
||||
/**
|
||||
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
|
||||
* 如果需要同时获取关联数据,请移步(getSysUaaUserListWithRelation)方法。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
List<SysUaaUser> getSysUaaUserList(SysUaaUser filter, String orderBy);
|
||||
|
||||
/**
|
||||
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
|
||||
* 如果仅仅需要获取主表数据,请移步(getSysUaaUserList),以便获取更好的查询性能。
|
||||
*
|
||||
* @param filter 主表过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
List<SysUaaUser> getSysUaaUserListWithRelation(SysUaaUser filter, String orderBy);
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.orangeforms.uaaadmin.service.impl;
|
||||
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orangeforms.common.core.base.service.BaseService;
|
||||
import com.orangeforms.common.core.object.MyRelationParam;
|
||||
import com.orangeforms.common.core.util.MyModelUtil;
|
||||
import com.orangeforms.uaaadmin.service.AuthClientDetailsService;
|
||||
import com.orangeforms.uaaadmin.dao.AuthClientDetailsMapper;
|
||||
import com.orangeforms.uaaadmin.model.AuthClientDetails;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 应用客户端数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service("authClientDetailsService")
|
||||
public class AuthClientDetailsServiceImpl extends BaseService<AuthClientDetails, String> implements AuthClientDetailsService {
|
||||
|
||||
@Autowired
|
||||
private AuthClientDetailsMapper authClientDetailsMapper;
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
/**
|
||||
* 返回当前Service的主表Mapper对象。
|
||||
*
|
||||
* @return 主表Mapper对象。
|
||||
*/
|
||||
@Override
|
||||
protected BaseDaoMapper<AuthClientDetails> mapper() {
|
||||
return authClientDetailsMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新增对象。
|
||||
*
|
||||
* @param authClientDetails 新增对象。
|
||||
* @return 返回新增对象。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AuthClientDetails saveNew(AuthClientDetails authClientDetails) {
|
||||
authClientDetails.setClientSecret(passwordEncoder.encode(authClientDetails.getClientSecretPlain()));
|
||||
MyModelUtil.fillCommonsForInsert(authClientDetails);
|
||||
authClientDetailsMapper.insert(authClientDetails);
|
||||
return authClientDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据对象。
|
||||
*
|
||||
* @param authClientDetails 更新的对象。
|
||||
* @param originalAuthClientDetails 原有数据对象。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean update(AuthClientDetails authClientDetails, AuthClientDetails originalAuthClientDetails) {
|
||||
authClientDetails.setClientSecret(originalAuthClientDetails.getClientSecret());
|
||||
authClientDetails.setClientSecretPlain(originalAuthClientDetails.getClientSecretPlain());
|
||||
MyModelUtil.fillCommonsForUpdate(authClientDetails, originalAuthClientDetails);
|
||||
return authClientDetailsMapper.updateById(authClientDetails) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定数据。
|
||||
*
|
||||
* @param clientId 主键Id。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean remove(String clientId) {
|
||||
return authClientDetailsMapper.deleteById(clientId) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
|
||||
* 如果需要同时获取关联数据,请移步(getAuthClientDetailsListWithRelation)方法。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
@Override
|
||||
public List<AuthClientDetails> getAuthClientDetailsList(AuthClientDetails filter, String orderBy) {
|
||||
return authClientDetailsMapper.getAuthClientDetailsList(filter, orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
|
||||
* 如果仅仅需要获取主表数据,请移步(getAuthClientDetailsList),以便获取更好的查询性能。
|
||||
*
|
||||
* @param filter 主表过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
@Override
|
||||
public List<AuthClientDetails> getAuthClientDetailsListWithRelation(AuthClientDetails filter, String orderBy) {
|
||||
List<AuthClientDetails> resultList = authClientDetailsMapper.getAuthClientDetailsList(filter, orderBy);
|
||||
this.buildRelationForDataList(resultList, MyRelationParam.normal());
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.orangeforms.uaaadmin.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orangeforms.common.core.base.service.BaseService;
|
||||
import com.orangeforms.common.core.object.MyRelationParam;
|
||||
import com.orangeforms.common.core.util.MyModelUtil;
|
||||
import com.orangeforms.common.sequence.wrapper.IdGeneratorWrapper;
|
||||
import com.orangeforms.uaaadmin.service.SysUaaOperatorService;
|
||||
import com.orangeforms.uaaadmin.dao.SysUaaOperatorMapper;
|
||||
import com.orangeforms.uaaadmin.model.SysUaaOperator;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 操作员数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service("sysUaaOperatorService")
|
||||
public class SysUaaOperatorServiceImpl extends BaseService<SysUaaOperator, Long> implements SysUaaOperatorService {
|
||||
|
||||
@Autowired
|
||||
private SysUaaOperatorMapper sysUaaOperatorMapper;
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
@Autowired
|
||||
private IdGeneratorWrapper idGenerator;
|
||||
|
||||
/**
|
||||
* 返回当前Service的主表Mapper对象。
|
||||
*
|
||||
* @return 主表Mapper对象。
|
||||
*/
|
||||
@Override
|
||||
protected BaseDaoMapper<SysUaaOperator> mapper() {
|
||||
return sysUaaOperatorMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据登录名获取UAA操作员对象。
|
||||
* @param loginName UAA操作员登录名。
|
||||
* @return UAA操作员对象。
|
||||
*/
|
||||
@Override
|
||||
public SysUaaOperator getUaaOperatorByLoginName(String loginName) {
|
||||
SysUaaOperator sysUaaOperator = new SysUaaOperator();
|
||||
sysUaaOperator.setLoginName(loginName);
|
||||
return sysUaaOperatorMapper.selectOne(new QueryWrapper<>(sysUaaOperator));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新增对象。
|
||||
*
|
||||
* @param sysUaaOperator 新增对象。
|
||||
* @return 返回新增对象。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public SysUaaOperator saveNew(SysUaaOperator sysUaaOperator) {
|
||||
sysUaaOperator.setPassword(passwordEncoder.encode(sysUaaOperator.getPassword()));
|
||||
sysUaaOperator.setOperatorId(idGenerator.nextLongId());
|
||||
MyModelUtil.fillCommonsForInsert(sysUaaOperator);
|
||||
sysUaaOperatorMapper.insert(sysUaaOperator);
|
||||
return sysUaaOperator;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据对象。
|
||||
*
|
||||
* @param sysUaaOperator 更新的对象。
|
||||
* @param originalSysUaaOperator 原有数据对象。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean update(SysUaaOperator sysUaaOperator, SysUaaOperator originalSysUaaOperator) {
|
||||
sysUaaOperator.setPassword(originalSysUaaOperator.getPassword());
|
||||
MyModelUtil.fillCommonsForUpdate(sysUaaOperator, originalSysUaaOperator);
|
||||
return sysUaaOperatorMapper.updateById(sysUaaOperator) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码。
|
||||
*
|
||||
* @param uaaOperatorId 操作员Id。
|
||||
* @param newPass 新密码明文。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean changePassword(Long uaaOperatorId, String newPass) {
|
||||
SysUaaOperator updatedOperator = new SysUaaOperator();
|
||||
updatedOperator.setOperatorId(uaaOperatorId);
|
||||
updatedOperator.setPassword(passwordEncoder.encode(newPass));
|
||||
return sysUaaOperatorMapper.updateById(updatedOperator) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定数据。
|
||||
*
|
||||
* @param operatorId 主键Id。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean remove(Long operatorId) {
|
||||
return sysUaaOperatorMapper.deleteById(operatorId) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
|
||||
* 如果需要同时获取关联数据,请移步(getSysUaaOperatorListWithRelation)方法。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
@Override
|
||||
public List<SysUaaOperator> getSysUaaOperatorList(SysUaaOperator filter, String orderBy) {
|
||||
return sysUaaOperatorMapper.getSysUaaOperatorList(filter, orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
|
||||
* 如果仅仅需要获取主表数据,请移步(getSysUaaOperatorList),以便获取更好的查询性能。
|
||||
*
|
||||
* @param filter 主表过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
@Override
|
||||
public List<SysUaaOperator> getSysUaaOperatorListWithRelation(SysUaaOperator filter, String orderBy) {
|
||||
List<SysUaaOperator> resultList = sysUaaOperatorMapper.getSysUaaOperatorList(filter, orderBy);
|
||||
this.buildRelationForDataList(resultList, MyRelationParam.normal());
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.orangeforms.uaaadmin.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orangeforms.common.core.base.service.BaseService;
|
||||
import com.orangeforms.common.core.object.MyRelationParam;
|
||||
import com.orangeforms.common.core.util.MyModelUtil;
|
||||
import com.orangeforms.common.sequence.wrapper.IdGeneratorWrapper;
|
||||
import com.orangeforms.uaaadmin.service.SysUaaUserService;
|
||||
import com.orangeforms.uaaadmin.dao.SysUaaUserMapper;
|
||||
import com.orangeforms.uaaadmin.model.SysUaaUser;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* UAA用户数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service("sysUaaUserService")
|
||||
public class SysUaaUserServiceImpl extends BaseService<SysUaaUser, Long> implements SysUaaUserService {
|
||||
|
||||
@Autowired
|
||||
private SysUaaUserMapper sysUaaUserMapper;
|
||||
@Autowired
|
||||
private IdGeneratorWrapper idGenerator;
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
/**
|
||||
* 返回当前Service的主表Mapper对象。
|
||||
*
|
||||
* @return 主表Mapper对象。
|
||||
*/
|
||||
@Override
|
||||
protected BaseDaoMapper<SysUaaUser> mapper() {
|
||||
return sysUaaUserMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新增对象。
|
||||
*
|
||||
* @param sysUaaUser 新增对象。
|
||||
* @return 返回新增对象。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public SysUaaUser saveNew(SysUaaUser sysUaaUser) {
|
||||
sysUaaUser.setUserId(idGenerator.nextLongId());
|
||||
sysUaaUser.setPassword(passwordEncoder.encode(sysUaaUser.getPassword()));
|
||||
MyModelUtil.fillCommonsForInsert(sysUaaUser);
|
||||
sysUaaUserMapper.insert(sysUaaUser);
|
||||
return sysUaaUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据对象。
|
||||
*
|
||||
* @param sysUaaUser 更新的对象。
|
||||
* @param originalSysUaaUser 原有数据对象。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean update(SysUaaUser sysUaaUser, SysUaaUser originalSysUaaUser) {
|
||||
sysUaaUser.setPassword(originalSysUaaUser.getPassword());
|
||||
MyModelUtil.fillCommonsForUpdate(sysUaaUser, originalSysUaaUser);
|
||||
return sysUaaUserMapper.updateById(sysUaaUser) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码。
|
||||
*
|
||||
* @param uaaUserId 用户Id。
|
||||
* @param newPass 新密码明文。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean changePassword(Long uaaUserId, String newPass) {
|
||||
SysUaaUser updatedUser = new SysUaaUser();
|
||||
updatedUser.setUserId(uaaUserId);
|
||||
updatedUser.setPassword(passwordEncoder.encode(newPass));
|
||||
return sysUaaUserMapper.updateById(updatedUser) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定数据。
|
||||
*
|
||||
* @param userId 主键Id。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean remove(Long userId) {
|
||||
return sysUaaUserMapper.deleteById(userId) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
|
||||
* 如果需要同时获取关联数据,请移步(getSysUaaUserListWithRelation)方法。
|
||||
*
|
||||
* @param filter 过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
@Override
|
||||
public List<SysUaaUser> getSysUaaUserList(SysUaaUser filter, String orderBy) {
|
||||
return sysUaaUserMapper.getSysUaaUserList(filter, orderBy);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
|
||||
* 如果仅仅需要获取主表数据,请移步(getSysUaaUserList),以便获取更好的查询性能。
|
||||
*
|
||||
* @param filter 主表过滤对象。
|
||||
* @param orderBy 排序参数。
|
||||
* @return 查询结果集。
|
||||
*/
|
||||
@Override
|
||||
public List<SysUaaUser> getSysUaaUserListWithRelation(SysUaaUser filter, String orderBy) {
|
||||
List<SysUaaUser> resultList = sysUaaUserMapper.getSysUaaUserList(filter, orderBy);
|
||||
this.buildRelationForDataList(resultList, MyRelationParam.normal());
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
spring:
|
||||
application:
|
||||
name: uaa-admin
|
||||
profiles:
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
server-addr: localhost:8848
|
||||
file-extension: yaml
|
||||
# 共享配置文件,排序越高后,优先级越高。
|
||||
shared-configs:
|
||||
- data-id: application-dev.yaml
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!-- 本项目全部使用log4j2性能上有很大提升 -->
|
||||
|
||||
<!--monitorInterval="60" 自动检测配置文件更改时间 单位为秒 最小值为5 -->
|
||||
<!--Configuration后面的status,这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,你会看到log4j2内部各种详细输出。 -->
|
||||
<configuration monitorInterval="20" status="OFF">
|
||||
<!--日志变量 -->
|
||||
<properties>
|
||||
<!-- 日志主目录 ,需要保存到文件时请自己配置-->
|
||||
<property name="LOG_HOME">./zzlogs/uaa-admin</property>
|
||||
<!-- 日志备份目录 -->
|
||||
<property name="BACKUP_HOME">./zzlogs/uaa-admin/backup</property>
|
||||
<!-- 日志输出级别 -->
|
||||
<property name="OUTPUT_LOG_LEVEL">info</property>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="LOG_PATTERN">
|
||||
<!-- 输出格式%d{HH:mm:ss}时间24小时制 -->
|
||||
<!-- %-5p日志级别 5位左对齐 [%t]线程名 [%c]类名 -->
|
||||
<!--%l:输出日志事件的发生位置,相当于%c.%M(%F:%L)的组合,包括类全名、方法、文件名以及在代码中的行数。例如:test.TestLog4j.main(TestLog4j.java:10)。 -->
|
||||
<!-- 另一种输出风格<PatternLayout pattern="级别%-5p [%d{YYYY-MM-dd HH:mm:ss}] [%t] 位置[%l] - 信息:%msg%n" /> -->
|
||||
<!-- [%-5p][%d{yy-MM-dd HH:mm:ss}][%t]==>%m==>%c==>%L%n -->
|
||||
[%-5p] [%d{YYYY-MM-dd HH:mm:ss}] [%t] ==> %msg%n
|
||||
</property>
|
||||
<property name="LOG_PATTERN_EX">
|
||||
<!-- 下面注释中 %traceid 为SkyWalking 中的traceid -->
|
||||
[%-5p] [%d{YYYY-MM-dd HH:mm:ss}] T:[%X{traceId}] S:[%X{sessionId}] U:[%X{userId}] [%t] ==> [%traceId] %msg%n
|
||||
</property>
|
||||
<!-- 日志保留天数 -->
|
||||
<property name="EVERY_FILE_COUNT">31</property>
|
||||
<!-- 日志切割的最小单位 -->
|
||||
<property name="EVERY_FILE_SIZE">20M</property>
|
||||
</properties>
|
||||
|
||||
<appenders>
|
||||
<!--Kafka输出 -->
|
||||
<Kafka name="kafka_log" topic="zz-log-topic" syncSend="false" ignoreExceptions="false">
|
||||
<PatternLayout pattern="${LOG_PATTERN_EX}"/>
|
||||
<Property name="bootstrap.servers">localhost:9092</Property>
|
||||
<Property name="max.block.ms">10000</Property>
|
||||
</Kafka>
|
||||
<!--控制台输出 -->
|
||||
<console name="console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="${LOG_PATTERN}"/>
|
||||
</console>
|
||||
<!--每次大小超过size,则这size大小的日志会自动进行压缩,作为存档 -->
|
||||
<rollingFile name="file_log" fileName="${LOG_HOME}/uaa-admin.log"
|
||||
filePattern="${LOG_HOME}/uaa-admin-%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<PatternLayout charset="UTF-8" pattern="${LOG_PATTERN_EX}"/>
|
||||
<!-- 日志切割的最小单位 -->
|
||||
<SizeBasedTriggeringPolicy size="${EVERY_FILE_SIZE}"/>
|
||||
<!-- 默认的日志文件数量 -->
|
||||
<DefaultRolloverStrategy max="${EVERY_FILE_COUNT}"/>
|
||||
</rollingFile>
|
||||
</appenders>
|
||||
|
||||
<!-- 然后定义logger,只有定义了logger并引入的appender,appender才会生效 -->
|
||||
<!-- 这里我们把输出到控制台appender的日志级别设置为DEBUG,便于调试。但是输出文件我们缺省为INFO,两者均可随时修改。-->
|
||||
<Loggers>
|
||||
<Root level="${OUTPUT_LOG_LEVEL}">
|
||||
<AppenderRef ref="console"/>
|
||||
</Root>
|
||||
<!-- AsyncLogger 是基于Disruptor的全量异步队列,性能极高,队列默认大小4096。-->
|
||||
<!-- 队列默认值可通过JVM参数设置,参考博客:https://www.jianshu.com/p/82469047acbf -->
|
||||
<AsyncLogger name="com.orangeforms" additivity="false" level="info">
|
||||
<AppenderRef ref="console"/>
|
||||
<AppenderRef ref="kafka_log"/>
|
||||
<AppenderRef ref="file_log"/>
|
||||
</AsyncLogger>
|
||||
<!-- 这里将dao的日志级别设置为DEBUG,是为了SQL语句的输出 -->
|
||||
<AsyncLogger name="com.orangeforms.uaaadmin.dao" additivity="false" level="debug">
|
||||
<AppenderRef ref="console"/>
|
||||
<AppenderRef ref="kafka_log"/>
|
||||
<AppenderRef ref="file_log"/>
|
||||
</AsyncLogger>
|
||||
</Loggers>
|
||||
</configuration>
|
||||
@@ -0,0 +1,234 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<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$/target/generated-sources/annotations" isTestSource="false" generated="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="common-core" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: joda-time:joda-time:2.9.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-csv:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.6.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.76" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.jimmyshi:bean-query:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-all:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
|
||||
<orderEntry type="module" module-name="common-redis" />
|
||||
<orderEntry type="library" name="Maven: org.redisson:redisson:3.15.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.cache:cache-api:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.16.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex.rxjava3:rxjava:3.0.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.marshalling:jboss-marshalling-river:2.0.11.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.marshalling:jboss-marshalling:2.0.11.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jodd:jodd-bean:5.1.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jodd:jodd-core:5.1.6" level="project" />
|
||||
<orderEntry type="module" module-name="common-sequence" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-freemarker:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.31" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-jul:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.12" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-starter-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.spring:spring-context-support:1.0.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-api:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-hystrix:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-httpclient:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-core:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava:1.3.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-serialization:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.fasterxml.jackson.module:jackson-module-afterburner:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-metrics-event-stream:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-javanica:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.mapstruct:mapstruct-processor:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-recipes:4.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.5.3-beta" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.luben:zstd-jni:1.4.3-1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.lz4:lz4-java:1.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.lmax:disruptor:3.4.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.skywalking:apm-toolkit-log4j-2.x:7.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" 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.16.1" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.3" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" 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.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>uaa</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>uaa-auth</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>uaa-auth</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.orangeforms</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-oauth2</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.security.oauth</groupId>
|
||||
<artifactId>spring-security-oauth2</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 2.3.3 之前的版本和redis不兼容 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.security.oauth</groupId>
|
||||
<artifactId>spring-security-oauth2</artifactId>
|
||||
<version>2.3.8.RELEASE</version>
|
||||
</dependency>
|
||||
<!-- redis 分布式session -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.orangeforms.uaaauth;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* UAA服务启动类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
@ComponentScan("com.orangeforms")
|
||||
public class UaaAuthApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(UaaAuthApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.orangeforms.uaaauth.config;
|
||||
|
||||
import org.springframework.http.HttpInputMessage;
|
||||
import org.springframework.http.HttpOutputMessage;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.AbstractHttpMessageConverter;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
import org.springframework.http.converter.HttpMessageNotWritableException;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* OAuth2AccessToken 接口对象的专有序列化转换器。如果不指定该转换器,并采用缺省的Fastjson,
|
||||
* /oauth/token返回的对象参数格式不符合oauth2的标准。
|
||||
* 由于OAuth2AccessToken接口对象中的每一个字段,都基于jackson指定了不同的序列化方式,因此,
|
||||
* 这里我们针对OAuth2AccessToken,仍然保留使用jackson的序列化方式。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SuppressWarnings("NullableProblems")
|
||||
public class AuthHttpMessageConverter extends AbstractHttpMessageConverter<DefaultOAuth2AccessToken> {
|
||||
|
||||
private final MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
|
||||
|
||||
public AuthHttpMessageConverter() {
|
||||
super(MediaType.APPLICATION_JSON);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean supports(Class<?> clazz) {
|
||||
return clazz.equals(DefaultOAuth2AccessToken.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DefaultOAuth2AccessToken readInternal(
|
||||
Class<? extends DefaultOAuth2AccessToken> clazz, HttpInputMessage inputMessage)
|
||||
throws IOException, HttpMessageNotReadableException {
|
||||
throw new UnsupportedOperationException(
|
||||
"This converter is only used for converting DefaultOAuth2AccessToken to json.");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeInternal(DefaultOAuth2AccessToken accessToken, HttpOutputMessage outputMessage)
|
||||
throws IOException, HttpMessageNotWritableException {
|
||||
mappingJackson2HttpMessageConverter.write(accessToken, MediaType.APPLICATION_JSON, outputMessage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.orangeforms.uaaauth.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 为OAuth2AccessToken 接口对象设定专有的序列化转换器。如果不指定该转换器,并采用缺省的Fastjson,
|
||||
* /oauth/token返回的对象参数格式不符合oauth2的标准。
|
||||
* 由于OAuth2AccessToken接口对象中的每一个字段,都基于jackson指定了不同的序列化方式,因此,
|
||||
* 这里我们针对OAuth2AccessToken,仍然保留使用jackson的序列化方式。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Configuration
|
||||
public class AuthWebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
AuthHttpMessageConverter authHttpMessageConverter = new AuthHttpMessageConverter();
|
||||
converters.add(0, authHttpMessageConverter);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.orangeforms.uaaauth.config;
|
||||
|
||||
import com.orangeforms.uaaauth.service.ClientDetailsServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.InternalAuthenticationServiceException;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.oauth2.common.exceptions.*;
|
||||
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
|
||||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;
|
||||
import org.springframework.security.oauth2.provider.code.RandomValueAuthorizationCodeServices;
|
||||
import org.springframework.security.oauth2.provider.error.DefaultWebResponseExceptionTranslator;
|
||||
import org.springframework.security.oauth2.provider.error.WebResponseExceptionTranslator;
|
||||
import org.springframework.security.oauth2.provider.token.TokenEnhancerChain;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* 认证授权服务配置类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Configuration
|
||||
@EnableAuthorizationServer
|
||||
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {
|
||||
|
||||
@Autowired
|
||||
private AuthenticationManager authenticationManager;
|
||||
@Autowired
|
||||
private UserDetailsService userDetailsService;
|
||||
@Autowired
|
||||
private ClientDetailsServiceImpl clientDetailsService;
|
||||
@Autowired
|
||||
private TokenStore tokenStore;
|
||||
@Autowired
|
||||
private RandomValueAuthorizationCodeServices authorizationCodeServices;
|
||||
@Autowired
|
||||
private WebResponseExceptionTranslator<OAuth2Exception> webResponseExceptionTranslator;
|
||||
|
||||
@Override
|
||||
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
|
||||
clients.withClientDetails(clientDetailsService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
|
||||
// 将用户对象作为token的附加信息,一同返回给应用服务,减少一次网络交互。
|
||||
TokenEnhancerChain enhancerChain = new TokenEnhancerChain();
|
||||
enhancerChain.setTokenEnhancers(Collections.singletonList(new CustomTokenEnhancer()));
|
||||
// 配置令牌存储对象,这里我们使用了下面的RedisTokenStore
|
||||
endpoints.tokenStore(tokenStore)
|
||||
.authenticationManager(authenticationManager)
|
||||
// 获取用户数据服务,该bean的实际类型为UserDetailsServiceImpl。
|
||||
.userDetailsService(userDetailsService)
|
||||
// 授权码被存储在Redis,该bean的实际类型为RedisAuthorizationCodeServices。
|
||||
.authorizationCodeServices(authorizationCodeServices)
|
||||
// 自定义异常处理。
|
||||
.exceptionTranslator(webResponseExceptionTranslator)
|
||||
// 扩展token携带的数据,在登录验证成功后,同时返回了userId,以供应用服务使用,减少了与uaa-auth的交互次数。
|
||||
// 该bean的实际类型为CustomTokenEnhancer
|
||||
.tokenEnhancer(enhancerChain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {
|
||||
security
|
||||
.tokenKeyAccess("isAuthenticated()")
|
||||
.checkTokenAccess("permitAll()")
|
||||
// 让/oauth/token支持client_id以及client_secret作表单登录认证
|
||||
.allowFormAuthenticationForClients();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TokenStore tokenStore(RedisConnectionFactory connectionFactory) {
|
||||
return new RedisTokenStore(connectionFactory);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebResponseExceptionTranslator<OAuth2Exception> webResponseExceptionTranslator() {
|
||||
return new DefaultWebResponseExceptionTranslator() {
|
||||
public static final String BAD_MSG = "坏的凭证";
|
||||
|
||||
@Override
|
||||
public ResponseEntity<OAuth2Exception> translate(Exception e) throws Exception {
|
||||
OAuth2Exception oAuth2Exception;
|
||||
if (e.getMessage() != null && e.getMessage().equals(BAD_MSG)) {
|
||||
oAuth2Exception = new InvalidGrantException("用户名或密码错误", e);
|
||||
} else if (e instanceof InternalAuthenticationServiceException) {
|
||||
oAuth2Exception = new InvalidGrantException(e.getMessage(), e);
|
||||
} else if (e instanceof RedirectMismatchException) {
|
||||
oAuth2Exception = new InvalidGrantException(e.getMessage(), e);
|
||||
} else if (e instanceof InvalidScopeException) {
|
||||
oAuth2Exception = new InvalidGrantException(e.getMessage(), e);
|
||||
} else {
|
||||
oAuth2Exception = new UnsupportedResponseTypeException("服务内部错误", e);
|
||||
}
|
||||
ResponseEntity<OAuth2Exception> response = super.translate(oAuth2Exception);
|
||||
ResponseEntity.status(oAuth2Exception.getHttpErrorCode());
|
||||
response.getBody().addAdditionalInformation("respCode", oAuth2Exception.getHttpErrorCode() + "");
|
||||
response.getBody().addAdditionalInformation("respMsg", oAuth2Exception.getMessage());
|
||||
return response;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.orangeforms.uaaauth.config;
|
||||
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 自定义访问令牌对象的数据增强器。
|
||||
* 在/oauth/token接口中,仅仅返回最基本的验证数据,这里我们通过增强器,将username也连同返回,
|
||||
* 其目的主要为两点:
|
||||
* 1. 避免uaa客户端在获取access_token后,再次发出请求获取username,提升验证效率。
|
||||
* 2. 给出一个典型的例子,今后如果需要添加更多的信息,可以直接在这里修改。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public class CustomTokenEnhancer implements TokenEnhancer {
|
||||
|
||||
@Override
|
||||
public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
|
||||
final Map<String, Object> additionalInfo = new HashMap<>(1);
|
||||
Object principal = authentication.getPrincipal();
|
||||
// 增加id参数
|
||||
if (principal instanceof User) {
|
||||
User user = (User) principal;
|
||||
additionalInfo.put("username", user.getUsername());
|
||||
}
|
||||
((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo);
|
||||
return accessToken;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.orangeforms.uaaauth.config;
|
||||
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* 数据源配置Bean对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@MapperScan(value = {"com.orangeforms.*.dao", "com.orangeforms.common.*.dao"})
|
||||
public class DataSourceConfig {
|
||||
|
||||
@Bean(initMethod = "init", destroyMethod = "close")
|
||||
@Primary
|
||||
@ConfigurationProperties(prefix = "spring.datasource.druid")
|
||||
public DataSource druidDataSource() {
|
||||
return DruidDataSourceBuilder.create().build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.orangeforms.uaaauth.config;
|
||||
|
||||
import com.orangeforms.common.core.constant.ApplicationConstant;
|
||||
import com.orangeforms.common.core.util.RsaUtil;
|
||||
import com.orangeforms.uaaauth.handler.AuthLogoutHandler;
|
||||
import com.orangeforms.uaaauth.handler.AuthLogoutSuccessHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
|
||||
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* 认证授权服务安全配置类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Autowired
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
/**
|
||||
* 全局用户信息。
|
||||
*/
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
auth.userDetailsService(userDetailsService).passwordEncoder(new CustomPasswordEncoder());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http.formLogin()
|
||||
// login.html位于resources/static目录中,用户登录时,将使用该页面。
|
||||
.loginPage("/login.html")
|
||||
// 登录处理url。在login.html的表单提交中,将使用该uri。
|
||||
.loginProcessingUrl("/uaa/login")
|
||||
// 注册登录成功后的处理器。
|
||||
.successHandler(loginSuccessHandler())
|
||||
.and()
|
||||
.logout()
|
||||
// 登出时调用的uri,该uri的处理逻辑,已在oauth内置的filter中实现。
|
||||
.logoutUrl("/oauth/remove/token")
|
||||
// 登出成功处理器
|
||||
.logoutSuccessHandler(new AuthLogoutSuccessHandler())
|
||||
// 登出操作处理器。
|
||||
.addLogoutHandler(authLogoutHandler())
|
||||
// 登出后清除session。以使用户下次访问授权页面时,必须重新进行登录验证。
|
||||
.clearAuthentication(true)
|
||||
.and()
|
||||
.csrf().disable()
|
||||
// 解决不允许显示在iframe的问题
|
||||
.headers().frameOptions().disable().cacheControl();
|
||||
// 授权码模式单独处理,需要session的支持,此模式可以支持所有oauth2的认证
|
||||
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义的密码匹配对象。相比于Spring Security的BCryptPasswordEncoder,会现将前端传入
|
||||
* 的密码进行RSA解密,再将解密后的结果交由BCryptPasswordEncoder对象进行密码匹配。
|
||||
*/
|
||||
static class CustomPasswordEncoder extends BCryptPasswordEncoder {
|
||||
@Override
|
||||
public boolean matches(CharSequence rawPassword, String encodedPassword) {
|
||||
try {
|
||||
rawPassword = URLDecoder.decode(rawPassword.toString(), StandardCharsets.UTF_8.name());
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error("Failed to call URLDecoder.decode for passwd [" + rawPassword + "]", e);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
rawPassword = RsaUtil.decrypt(rawPassword.toString(), ApplicationConstant.PRIVATE_KEY);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to call RsaUtil.decrypt for passwd [" + rawPassword + "]", e);
|
||||
return false;
|
||||
}
|
||||
return super.matches(rawPassword, encodedPassword);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户认证管理对象。
|
||||
*/
|
||||
@Bean
|
||||
@Override
|
||||
public AuthenticationManager authenticationManagerBean() throws Exception {
|
||||
return super.authenticationManagerBean();
|
||||
}
|
||||
|
||||
/**
|
||||
* 登出操作处理器。
|
||||
* @return 登出操作处理器。
|
||||
*/
|
||||
@Bean
|
||||
public AuthLogoutHandler authLogoutHandler() {
|
||||
return new AuthLogoutHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录成功操作处理器。
|
||||
* @return 登录成功操作处理器。
|
||||
*/
|
||||
@Bean
|
||||
public AuthenticationSuccessHandler loginSuccessHandler() {
|
||||
return new SavedRequestAwareAuthenticationSuccessHandler() {
|
||||
@Override
|
||||
public void onAuthenticationSuccess(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
Authentication authentication) throws IOException, ServletException {
|
||||
super.onAuthenticationSuccess(request, response, authentication);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.orangeforms.uaaauth.controller;
|
||||
|
||||
import com.orangeforms.uaaauth.model.SysUaaUser;
|
||||
import com.orangeforms.uaaauth.service.SysUaaUserService;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.object.ResponseResult;
|
||||
import com.orangeforms.common.core.util.MyCommonUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* UaaUser用户对象查询示例接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/uaaauth/sysUaaUser")
|
||||
public class SysUaaUserController {
|
||||
|
||||
@Autowired
|
||||
private SysUaaUserService sysUaaUserService;
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
/**
|
||||
* 获取UAA授权用户的相信信息。
|
||||
* 在Uaa客户端应用正确获取access_token后,可通过请求
|
||||
* /admin/uaa/sysUaaUser/view?username=xxx&access_token=yyy 获取用户的详情信息。
|
||||
*
|
||||
* @param username 用户名。
|
||||
* @return 授权用户的详细信息。
|
||||
*/
|
||||
@GetMapping("/view")
|
||||
public ResponseResult<SysUaaUser> view(@RequestParam String username) {
|
||||
if (MyCommonUtil.existBlankArgument(username)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
// 这里查看用户数据时候,需要把用户多对多关联的角色和数据权限Id一并查出。
|
||||
SysUaaUser user = sysUaaUserService.getByUsername(username);
|
||||
if (user == null) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作员修改自己的密码。
|
||||
*
|
||||
* @param username 用户名。
|
||||
* @param oldPass 原有密码明文。
|
||||
* @param newPass 新密码明文。
|
||||
* @return 应答结果对象。
|
||||
*/
|
||||
@GetMapping("/changePassword")
|
||||
public ResponseResult<Void> changePassword(
|
||||
@RequestParam String username, @RequestParam String oldPass, @RequestParam String newPass) {
|
||||
if (MyCommonUtil.existBlankArgument(newPass, oldPass)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
||||
}
|
||||
SysUaaUser user = sysUaaUserService.getByUsername(username);
|
||||
if (user == null || !passwordEncoder.matches(oldPass, user.getPassword())) {
|
||||
return ResponseResult.error(ErrorCodeEnum.INVALID_USERNAME_PASSWORD);
|
||||
}
|
||||
if (!sysUaaUserService.changePassword(user.getUserId(), newPass)) {
|
||||
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.orangeforms.uaaauth.dao;
|
||||
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orangeforms.uaaauth.model.AuthClientDetails;
|
||||
|
||||
/**
|
||||
* UAA应用客户端数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface AuthClientDetailsMapper extends BaseDaoMapper<AuthClientDetails> {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.orangeforms.uaaauth.dao;
|
||||
|
||||
import com.orangeforms.uaaauth.model.SysUaaUser;
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
|
||||
/**
|
||||
* UAA用户管理数据操作访问接口。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
public interface SysUaaUserMapper extends BaseDaoMapper<SysUaaUser> {
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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.orangeforms.uaaauth.dao.AuthClientDetailsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.orangeforms.uaaauth.model.AuthClientDetails">
|
||||
<id column="client_id" jdbcType="VARCHAR" property="clientId"/>
|
||||
<result column="client_secret" jdbcType="VARCHAR" property="clientSecret"/>
|
||||
<result column="client_secret_plain" jdbcType="VARCHAR" property="clientSecretPlain"/>
|
||||
<result column="client_desc" jdbcType="VARCHAR" property="clientDesc"/>
|
||||
<result column="authorized_grant_types" jdbcType="VARCHAR" property="authorizedGrantTypes"/>
|
||||
<result column="web_server_redirect_uri" jdbcType="VARCHAR" property="webServerRedirectUri"/>
|
||||
<result column="access_token_validity" jdbcType="INTEGER" property="accessTokenValidity"/>
|
||||
<result column="refresh_token_validity" jdbcType="INTEGER" property="refreshTokenValidity"/>
|
||||
<result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="deleted_flag" jdbcType="BIT" property="deletedFlag"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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.orangeforms.uaaauth.dao.SysUaaUserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.orangeforms.uaaauth.model.SysUaaUser">
|
||||
<id column="user_id" jdbcType="BIGINT" property="userId"/>
|
||||
<result column="username" jdbcType="VARCHAR" property="username"/>
|
||||
<result column="password" jdbcType="VARCHAR" property="password"/>
|
||||
<result column="show_name" jdbcType="VARCHAR" property="showName"/>
|
||||
<result column="locked" jdbcType="INTEGER" property="locked"/>
|
||||
<result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="deleted_flag" jdbcType="BIT" property="deletedFlag"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.orangeforms.uaaauth.handler;
|
||||
|
||||
import com.orangeforms.uaaauth.util.AuthUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
import org.springframework.security.web.authentication.logout.LogoutHandler;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 登出操作处理器对象。这里将同时清空redis中的access_token。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
public class AuthLogoutHandler implements LogoutHandler {
|
||||
@Autowired
|
||||
private TokenStore tokenStore;
|
||||
|
||||
@Override
|
||||
public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
|
||||
String token = request.getParameter("token");
|
||||
if (StringUtils.isBlank(token)) {
|
||||
token = AuthUtils.extractToken(request);
|
||||
}
|
||||
if (StringUtils.isNotBlank(token)) {
|
||||
OAuth2AccessToken existingAccessToken = tokenStore.readAccessToken(token);
|
||||
if (existingAccessToken != null) {
|
||||
tokenStore.removeAccessToken(existingAccessToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.orangeforms.uaaauth.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orangeforms.common.core.object.ResponseResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.web.DefaultRedirectStrategy;
|
||||
import org.springframework.security.web.RedirectStrategy;
|
||||
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* 登出成功处理器对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
public class AuthLogoutSuccessHandler implements LogoutSuccessHandler {
|
||||
private final RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
|
||||
|
||||
@Override
|
||||
public void onLogoutSuccess(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
Authentication authentication) throws IOException {
|
||||
String redirectUri = request.getParameter("redirect_uri");
|
||||
if (StrUtil.isNotEmpty(redirectUri)) {
|
||||
// 重定向指定的地址
|
||||
redirectStrategy.sendRedirect(request, response, redirectUri);
|
||||
} else {
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
|
||||
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
|
||||
PrintWriter writer = response.getWriter();
|
||||
String jsonStr = JSON.toJSONString(ResponseResult.success("登出成功"));
|
||||
writer.write(jsonStr);
|
||||
writer.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.orangeforms.uaaauth.model;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orangeforms.common.core.base.model.BaseModel;
|
||||
|
||||
/**
|
||||
* OAuth2 应用客户端表的实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "zz_auth_client_details")
|
||||
public class AuthClientDetails extends BaseModel {
|
||||
|
||||
/**
|
||||
* 应用标识。
|
||||
*/
|
||||
@TableId(value = "client_id")
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 应用密钥(bcyt) 加密。
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@TableField(value = "client_secret")
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 应用密钥(明文)。
|
||||
*/
|
||||
@TableField(value = "client_secret_plain")
|
||||
private String clientSecretPlain;
|
||||
|
||||
/**
|
||||
* 应用描述。
|
||||
*/
|
||||
@TableField(value = "client_desc")
|
||||
private String clientDesc;
|
||||
|
||||
/**
|
||||
* 5种oauth授权方式(authorization_code,password,refresh_token,client_credentials)。
|
||||
*/
|
||||
@TableField(value = "authorized_grant_types")
|
||||
private String authorizedGrantTypes;
|
||||
|
||||
/**
|
||||
* 回调地址 。
|
||||
*/
|
||||
@TableField(value = "web_server_redirect_uri")
|
||||
private String webServerRedirectUri;
|
||||
|
||||
/**
|
||||
* access_token有效期。
|
||||
*/
|
||||
@TableField(value = "access_token_validity")
|
||||
private Integer accessTokenValidity;
|
||||
|
||||
/**
|
||||
* refresh_token有效期。
|
||||
*/
|
||||
@TableField(value = "refresh_token_validity")
|
||||
private Integer refreshTokenValidity;
|
||||
|
||||
/**
|
||||
* 是否删除(1: 正常,-1: 删除)
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@TableLogic
|
||||
@TableField(value = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.orangeforms.uaaauth.model;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orangeforms.common.core.base.model.BaseModel;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* SysUaaUser实体对象。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "zz_sys_uaa_user")
|
||||
public class SysUaaUser extends BaseModel {
|
||||
|
||||
/**
|
||||
* 用户Id。
|
||||
*/
|
||||
@NotNull(message = "数据验证失败,用户Id不能为空!")
|
||||
@TableId(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 登录用户名。
|
||||
*/
|
||||
@NotBlank(message = "数据验证失败,用户名不能为空!")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 用户密码。
|
||||
*/
|
||||
@NotBlank(message = "数据验证失败,用户密码不能为空!")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户显示名称。
|
||||
*/
|
||||
@NotBlank(message = "数据验证失败,用户显示名称不能为空!")
|
||||
@TableField(value = "show_name")
|
||||
private String showName;
|
||||
|
||||
/**
|
||||
* 用户状态(0: 正常 1: 锁定)。
|
||||
*/
|
||||
@NotNull(message = "数据验证失败,用户状态不能为空!")
|
||||
private Boolean locked;
|
||||
|
||||
/**
|
||||
* 是否删除(1: 正常,-1: 删除)
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@TableLogic
|
||||
@TableField(value = "deleted_flag")
|
||||
private Integer deletedFlag;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.orangeforms.uaaauth.service;
|
||||
|
||||
import com.orangeforms.uaaauth.dao.AuthClientDetailsMapper;
|
||||
import com.orangeforms.uaaauth.model.AuthClientDetails;
|
||||
import com.orangeforms.common.core.constant.GlobalDeletedFlag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.oauth2.provider.ClientDetails;
|
||||
import org.springframework.security.oauth2.provider.ClientDetailsService;
|
||||
import org.springframework.security.oauth2.provider.ClientRegistrationException;
|
||||
import org.springframework.security.oauth2.provider.client.BaseClientDetails;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* UAA客户端应用数据操作服务类。该类必须为ClientDetailsService接口的实现类。
|
||||
* loadClientByClientId方法,被Oauth2框架调用获取客户端数据。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class ClientDetailsServiceImpl implements ClientDetailsService {
|
||||
|
||||
@Autowired
|
||||
private AuthClientDetailsMapper clientDetailsMapper;
|
||||
|
||||
@Override
|
||||
public ClientDetails loadClientByClientId(String clientId) throws ClientRegistrationException {
|
||||
AuthClientDetails authClientDetails = clientDetailsMapper.selectById(clientId);
|
||||
if (authClientDetails == null || authClientDetails.getDeletedFlag() == GlobalDeletedFlag.DELETED) {
|
||||
throw new ClientRegistrationException("应用Id不存在!");
|
||||
}
|
||||
BaseClientDetails clientDetails = new BaseClientDetails();
|
||||
clientDetails.setClientId(authClientDetails.getClientId());
|
||||
clientDetails.setClientSecret(authClientDetails.getClientSecret());
|
||||
clientDetails.setAccessTokenValiditySeconds(authClientDetails.getAccessTokenValidity());
|
||||
clientDetails.setRefreshTokenValiditySeconds(authClientDetails.getRefreshTokenValidity());
|
||||
clientDetails.setScope(Collections.singletonList("all"));
|
||||
// 这里设置为"true",表示所有的scope都会自动审批通过。
|
||||
clientDetails.setAutoApproveScopes(Collections.singletonList("true"));
|
||||
if (StringUtils.isNotBlank(authClientDetails.getAuthorizedGrantTypes())) {
|
||||
clientDetails.setAuthorizedGrantTypes(Arrays.stream(StringUtils.split(
|
||||
authClientDetails.getAuthorizedGrantTypes(), ",")).collect(Collectors.toSet()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(authClientDetails.getWebServerRedirectUri())) {
|
||||
clientDetails.setRegisteredRedirectUri(Arrays.stream(StringUtils.split(
|
||||
authClientDetails.getWebServerRedirectUri(), ",")).collect(Collectors.toSet()));
|
||||
}
|
||||
return clientDetails;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.orangeforms.uaaauth.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.connection.RedisConnection;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
import org.springframework.security.oauth2.provider.code.RandomValueAuthorizationCodeServices;
|
||||
import org.springframework.security.oauth2.provider.token.store.redis.JdkSerializationStrategy;
|
||||
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreSerializationStrategy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 在OAuth2授权码验证模式下,请求的授权码都会存储到redis中,以实现UAA服务的分布式部署。
|
||||
* 同时也提升了验证过程的执行效率。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class RedisAuthorizationCodeServices extends RandomValueAuthorizationCodeServices {
|
||||
|
||||
@Autowired
|
||||
private RedisConnectionFactory redisConnectionFactory;
|
||||
private final RedisTokenStoreSerializationStrategy serializationStrategy = new JdkSerializationStrategy();
|
||||
private static final int EXPIRED_SECONDS = 10 * 60;
|
||||
|
||||
private RedisConnection getConnection() {
|
||||
return redisConnectionFactory.getConnection();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将授权码存储到redis中。
|
||||
*/
|
||||
@Override
|
||||
protected void store(String code, OAuth2Authentication authentication) {
|
||||
RedisConnection connection = getConnection();
|
||||
try {
|
||||
byte[] key = serializationStrategy.serialize(redisKey(code));
|
||||
connection.set(key, serializationStrategy.serialize(authentication));
|
||||
connection.expire(key, EXPIRED_SECONDS);
|
||||
} finally {
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将授权码从redis中删除。
|
||||
*/
|
||||
@Override
|
||||
protected OAuth2Authentication remove(final String code) {
|
||||
OAuth2Authentication token = null;
|
||||
RedisConnection connection = getConnection();
|
||||
try {
|
||||
byte[] key = serializationStrategy.serialize(redisKey(code));
|
||||
byte[] value = connection.get(key);
|
||||
if (value != null) {
|
||||
connection.del(key);
|
||||
token = serializationStrategy.deserialize(value, OAuth2Authentication.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
connection.close();
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
private String redisKey(String code) {
|
||||
return "oauth:code:" + code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.orangeforms.uaaauth.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.orangeforms.uaaauth.dao.SysUaaUserMapper;
|
||||
import com.orangeforms.uaaauth.model.SysUaaUser;
|
||||
import com.orangeforms.common.core.base.service.BaseService;
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 用户管理数据操作服务类。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Service
|
||||
public class SysUaaUserService extends BaseService<SysUaaUser, Long> {
|
||||
|
||||
@Autowired
|
||||
private SysUaaUserMapper sysUserMapper;
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
/**
|
||||
* 返回当前Service的主表Mapper对象。
|
||||
*
|
||||
* @return 主表Mapper对象。
|
||||
*/
|
||||
@Override
|
||||
protected BaseDaoMapper<SysUaaUser> mapper() {
|
||||
return sysUserMapper;
|
||||
}
|
||||
|
||||
public SysUaaUser getByUsername(String username) {
|
||||
SysUaaUser filter = new SysUaaUser();
|
||||
filter.setUsername(username);
|
||||
return sysUserMapper.selectOne(new QueryWrapper<>(filter));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户密码。
|
||||
* @param userId 用户主键Id。
|
||||
* @param newPass 新密码。
|
||||
* @return 成功返回true,否则false。
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean changePassword(Long userId, String newPass) {
|
||||
SysUaaUser updatedUser = new SysUaaUser();
|
||||
updatedUser.setUserId(userId);
|
||||
updatedUser.setPassword(passwordEncoder.encode(newPass));
|
||||
return sysUserMapper.updateById(updatedUser) == 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.orangeforms.uaaauth.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.orangeforms.uaaauth.dao.SysUaaUserMapper;
|
||||
import com.orangeforms.uaaauth.model.SysUaaUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* UAA授权用户数据操作服务类。该类必须为UserDetailsService接口的实现类。
|
||||
* loadUserByUsername方法,被Oauth2框架调用获取授权用户数据。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class UserDetailsServiceImpl implements UserDetailsService {
|
||||
|
||||
@Autowired
|
||||
private SysUaaUserMapper mapper;
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
SysUaaUser filter = new SysUaaUser();
|
||||
filter.setUsername(username);
|
||||
SysUaaUser sysUaaUser = mapper.selectOne(new QueryWrapper<>(filter));
|
||||
if (sysUaaUser == null) {
|
||||
throw new UsernameNotFoundException("用户名不存在![" + username + "]");
|
||||
}
|
||||
return new User(
|
||||
sysUaaUser.getUsername(),
|
||||
sysUaaUser.getPassword(),
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
!sysUaaUser.getLocked(),
|
||||
Collections.emptyList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.orangeforms.uaaauth.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.common.exceptions.UnapprovedClientAuthenticationException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.Enumeration;
|
||||
|
||||
/**
|
||||
* 认证授权相关工具类。该类直接取自zlt,感谢作者。
|
||||
*
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@Slf4j
|
||||
public final class AuthUtils {
|
||||
|
||||
private AuthUtils() {
|
||||
throw new IllegalStateException("Utility class");
|
||||
}
|
||||
|
||||
private static final String BASIC = "Basic ";
|
||||
private static final String CLIENT_STR_SEPERATOR = ":";
|
||||
private static final int CLIENT_STR_ARRAY_LENGTH = 2;
|
||||
|
||||
/**
|
||||
* 获取requet(head/param)中的token
|
||||
*/
|
||||
public static String extractToken(HttpServletRequest request) {
|
||||
String token = extractHeaderToken(request);
|
||||
if (token == null) {
|
||||
token = request.getParameter(OAuth2AccessToken.ACCESS_TOKEN);
|
||||
if (token == null) {
|
||||
log.debug("Token not found in request parameters. Not an OAuth2 request.");
|
||||
}
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析head中的token
|
||||
*/
|
||||
private static String extractHeaderToken(HttpServletRequest request) {
|
||||
Enumeration<String> headers = request.getHeaders("Authorization");
|
||||
while (headers.hasMoreElements()) {
|
||||
String value = headers.nextElement();
|
||||
if ((value.startsWith(OAuth2AccessToken.BEARER_TYPE))) {
|
||||
String authHeaderValue = value.substring(OAuth2AccessToken.BEARER_TYPE.length()).trim();
|
||||
int commaIndex = authHeaderValue.indexOf(',');
|
||||
if (commaIndex > 0) {
|
||||
authHeaderValue = authHeaderValue.substring(0, commaIndex);
|
||||
}
|
||||
return authHeaderValue;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* *从header 请求中的clientId:clientSecret
|
||||
*/
|
||||
public static String[] extractClient(HttpServletRequest request) {
|
||||
String header = request.getHeader("Authorization");
|
||||
if (header == null || !header.startsWith(BASIC)) {
|
||||
throw new UnapprovedClientAuthenticationException("请求头中client信息为空");
|
||||
}
|
||||
return extractHeaderClient(header);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从header 请求中的clientId:clientSecret
|
||||
*
|
||||
* @param header header中的参数
|
||||
*/
|
||||
public static String[] extractHeaderClient(String header) {
|
||||
byte[] base64Client = header.substring(BASIC.length()).getBytes(StandardCharsets.UTF_8);
|
||||
byte[] decoded = Base64.getDecoder().decode(base64Client);
|
||||
String clientStr = new String(decoded, StandardCharsets.UTF_8);
|
||||
String[] clientArr = clientStr.split(CLIENT_STR_SEPERATOR);
|
||||
if (CLIENT_STR_ARRAY_LENGTH != clientArr.length) {
|
||||
throw new RuntimeException("Invalid basic authentication token");
|
||||
}
|
||||
return clientArr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
spring:
|
||||
application:
|
||||
name: uaa-auth
|
||||
profiles:
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
config:
|
||||
server-addr: localhost:8848
|
||||
file-extension: yaml
|
||||
# 共享配置文件,排序越高后,优先级越高。
|
||||
shared-configs:
|
||||
- data-id: application-dev.yaml
|
||||
group: DEFAULT_GROUP
|
||||
refresh: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!-- 本项目全部使用log4j2性能上有很大提升 -->
|
||||
|
||||
<!--monitorInterval="60" 自动检测配置文件更改时间 单位为秒 最小值为5 -->
|
||||
<!--Configuration后面的status,这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,你会看到log4j2内部各种详细输出。 -->
|
||||
<configuration monitorInterval="20" status="OFF">
|
||||
<!--日志变量 -->
|
||||
<properties>
|
||||
<!-- 日志主目录 ,需要保存到文件时请自己配置-->
|
||||
<property name="LOG_HOME">./zzlogs/uaa-auth</property>
|
||||
<!-- 日志备份目录 -->
|
||||
<property name="BACKUP_HOME">./zzlogs/uaa-auth/backup</property>
|
||||
<!-- 日志输出级别 -->
|
||||
<property name="OUTPUT_LOG_LEVEL">info</property>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="LOG_PATTERN">
|
||||
<!-- 输出格式%d{HH:mm:ss}时间24小时制 -->
|
||||
<!-- %-5p日志级别 5位左对齐 [%t]线程名 [%c]类名 -->
|
||||
<!--%l:输出日志事件的发生位置,相当于%c.%M(%F:%L)的组合,包括类全名、方法、文件名以及在代码中的行数。例如:test.TestLog4j.main(TestLog4j.java:10)。 -->
|
||||
<!-- 另一种输出风格<PatternLayout pattern="级别%-5p [%d{YYYY-MM-dd HH:mm:ss}] [%t] 位置[%l] - 信息:%msg%n" /> -->
|
||||
<!-- [%-5p][%d{yy-MM-dd HH:mm:ss}][%t]==>%m==>%c==>%L%n -->
|
||||
[%-5p] [%d{YYYY-MM-dd HH:mm:ss}] [%t] ==> %msg%n
|
||||
</property>
|
||||
<property name="LOG_PATTERN_EX">
|
||||
<!-- 下面注释中 %traceid 为SkyWalking 中的traceid -->
|
||||
[%-5p] [%d{YYYY-MM-dd HH:mm:ss}] [%t] ==> [%traceId] %msg%n
|
||||
</property>
|
||||
<!-- 日志保留天数 -->
|
||||
<property name="EVERY_FILE_COUNT">31</property>
|
||||
<!-- 日志切割的最小单位 -->
|
||||
<property name="EVERY_FILE_SIZE">20M</property>
|
||||
</properties>
|
||||
|
||||
<appenders>
|
||||
<!--Kafka输出 -->
|
||||
<Kafka name="kafka_log" topic="zz-log-topic" syncSend="false" ignoreExceptions="false">
|
||||
<PatternLayout pattern="${LOG_PATTERN_EX}"/>
|
||||
<Property name="bootstrap.servers">localhost:9092</Property>
|
||||
<Property name="max.block.ms">10000</Property>
|
||||
</Kafka>
|
||||
<!--控制台输出 -->
|
||||
<console name="console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="${LOG_PATTERN}"/>
|
||||
</console>
|
||||
<!--每次大小超过size,则这size大小的日志会自动进行压缩,作为存档 -->
|
||||
<rollingFile name="file_log" fileName="${LOG_HOME}/uaa-auth.log"
|
||||
filePattern="${LOG_HOME}/uaa-auth-%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<PatternLayout charset="UTF-8" pattern="${LOG_PATTERN_EX}"/>
|
||||
<!-- 日志切割的最小单位 -->
|
||||
<SizeBasedTriggeringPolicy size="${EVERY_FILE_SIZE}"/>
|
||||
<!-- 默认的日志文件数量 -->
|
||||
<DefaultRolloverStrategy max="${EVERY_FILE_COUNT}"/>
|
||||
</rollingFile>
|
||||
</appenders>
|
||||
|
||||
<!-- 然后定义logger,只有定义了logger并引入的appender,appender才会生效 -->
|
||||
<!-- 这里我们把输出到控制台appender的日志级别设置为DEBUG,便于调试。但是输出文件我们缺省为INFO,两者均可随时修改。-->
|
||||
<Loggers>
|
||||
<Root level="${OUTPUT_LOG_LEVEL}">
|
||||
<AppenderRef ref="console"/>
|
||||
</Root>
|
||||
<!-- AsyncLogger 是基于Disruptor的全量异步队列,性能极高,队列默认大小4096。-->
|
||||
<!-- 队列默认值可通过JVM参数设置,参考博客:https://www.jianshu.com/p/82469047acbf -->
|
||||
<AsyncLogger name="com.orangeforms" additivity="false" level="info">
|
||||
<AppenderRef ref="console"/>
|
||||
<AppenderRef ref="kafka_log"/>
|
||||
<AppenderRef ref="file_log"/>
|
||||
</AsyncLogger>
|
||||
<!-- 这里将dao的日志级别设置为DEBUG,是为了SQL语句的输出 -->
|
||||
<AsyncLogger name="com.orangeforms.uaaauth.dao" additivity="false" level="debug">
|
||||
<AppenderRef ref="console"/>
|
||||
<AppenderRef ref="kafka_log"/>
|
||||
<AppenderRef ref="file_log"/>
|
||||
</AsyncLogger>
|
||||
</Loggers>
|
||||
</configuration>
|
||||
@@ -0,0 +1,173 @@
|
||||
header{
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background: #1e1b29;
|
||||
border-bottom: solid 4px red;
|
||||
}
|
||||
.member_wrap{
|
||||
|
||||
}
|
||||
.header_item{
|
||||
overflow: hidden;
|
||||
}
|
||||
.header_item{
|
||||
|
||||
width: 980px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.menu_head{
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 100px;
|
||||
border: solid 3px #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
.menu_head img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.menu_info{
|
||||
width:840px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.info_name{
|
||||
font-size: 18px;
|
||||
line-height: 40px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
.info_name_box{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.level{
|
||||
font-size: 14px;
|
||||
color: #f60;
|
||||
font-weight: bold;
|
||||
}
|
||||
.info_desc{
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
color: #FFF;
|
||||
}
|
||||
.banner_menu{
|
||||
width: 980px;
|
||||
height: 50px;
|
||||
margin: 20px auto;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
|
||||
.nav_box{
|
||||
margin-top: 50px;
|
||||
}
|
||||
.nav_box ul {
|
||||
overflow: hidden;
|
||||
}
|
||||
.nav_box ul li{
|
||||
display: block;
|
||||
padding: 0 20px;
|
||||
}
|
||||
.nav_box ul li a{
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
}
|
||||
.nav_box ul li a:hover{
|
||||
color: red;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.login_wrap{
|
||||
background: url(/images/logo_bg.jpg) no-repeat center;
|
||||
/*background-size: 100%;*/
|
||||
}
|
||||
.logo{
|
||||
width: 500px;
|
||||
height: 150px;
|
||||
margin: 0px auto;
|
||||
background: url(/images/logowz.png) no-repeat center;
|
||||
}
|
||||
.login_box{
|
||||
width: 360px;
|
||||
background: #FFFFFF;
|
||||
margin: 0px auto;
|
||||
}
|
||||
.login_title{
|
||||
font-size: 25px;
|
||||
text-align: center;
|
||||
color: #FF7F50;
|
||||
padding: 15px 0;
|
||||
width: 300px;
|
||||
margin: 0 auto;
|
||||
border-bottom: solid 1px #CCCCCC;
|
||||
}
|
||||
.form_text_ipt{
|
||||
width: 300px;
|
||||
height: 40px;
|
||||
border: solid 1px #CCCCCC;
|
||||
margin: 20px auto 0 auto;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
.form_check_ipt{
|
||||
width: 300px;
|
||||
margin: 10px auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
.form_text_ipt input{
|
||||
width: 290px;
|
||||
height: 30px;
|
||||
margin: 5px;
|
||||
border: none;
|
||||
font-family: "微软雅黑";
|
||||
font-size: 15px;
|
||||
color: #666;
|
||||
}
|
||||
.check_left label{
|
||||
cursor: pointer;
|
||||
}
|
||||
.check_left label input{
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
.form_btn{
|
||||
width: 300px;
|
||||
height: 40px;
|
||||
margin: 10px auto;
|
||||
}
|
||||
.form_btn button{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
color: #FFFFFF;
|
||||
font-size: 14px;
|
||||
background: #FF7F50;
|
||||
cursor: pointer;
|
||||
}
|
||||
.form_reg_btn{
|
||||
width: 300px;
|
||||
margin: 0 auto;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
.other_login{
|
||||
overflow: hidden;
|
||||
width: 300px;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
.other_left{
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.other_right a{
|
||||
margin:5px;
|
||||
color:#636363;
|
||||
}
|
||||
|
||||
.other_right a:hover{
|
||||
color:#AEEEEE;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*reset*/
|
||||
*{padding: 0;margin: 0;}
|
||||
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, menu, nav, section, time, mark, audio, video, details, summary {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font-size: 100%;
|
||||
font-weight: normal;
|
||||
vertical-align: baseline;
|
||||
background: transparent;
|
||||
}
|
||||
article, aside, figure, footer, header, nav, section, details, summary {display: block;}
|
||||
html, body { height: 100%; color: #333; font-size: 12px; font-family: "微软雅黑",MicrosoftYaHei;}
|
||||
a { text-decoration: none; color: #3cf; -webkit-tap-highlight-color: transparent;}
|
||||
li{list-style: none;}
|
||||
table{border-collapse: collapse;}
|
||||
input {outline: medium none;font-family: "微软雅黑",MicrosoftYaHei;font-size: 14px;}
|
||||
button{font-family:"微软雅黑",MicrosoftYaHei;}
|
||||
em {font-style: normal;}
|
||||
.wrap{max-width: 100%;min-height: 100%;overflow: hidden;margin: 0 auto;background: #ccc;}
|
||||
|
||||
.left{float: left;}
|
||||
.right{float: right;}
|
||||
.clear{clear:both;}
|
||||
.red{color: #f60;}
|
||||
|
||||
.ececk_warning{
|
||||
font-size: 13px;
|
||||
color: red;
|
||||
width: 300px;
|
||||
margin: 0 auto;
|
||||
display: none;
|
||||
}
|
||||
._warning{
|
||||
font-size: 13px;
|
||||
color: red;
|
||||
width: 300px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 331 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.8 KiB |
@@ -0,0 +1,50 @@
|
||||
$(function(){
|
||||
|
||||
$('.form_text_ipt input').focus(function(){
|
||||
$(this).parent().css({
|
||||
'box-shadow':'0 0 3px #bbb',
|
||||
});
|
||||
});
|
||||
$('.form_text_ipt input').blur(function(){
|
||||
$(this).parent().css({
|
||||
'box-shadow':'none',
|
||||
});
|
||||
});
|
||||
|
||||
$('.form_text_ipt input').bind('input propertychange',function(){
|
||||
if($(this).val()==""){
|
||||
$(this).css({
|
||||
'color':'red',
|
||||
});
|
||||
$(this).parent().css({
|
||||
'border':'solid 1px red',
|
||||
});
|
||||
$(this).parent().next().show();
|
||||
}else{
|
||||
$(this).css({
|
||||
'color':'#ccc',
|
||||
});
|
||||
$(this).parent().css({
|
||||
'border':'solid 1px #ccc',
|
||||
});
|
||||
$(this).parent().next().hide();
|
||||
}
|
||||
});
|
||||
|
||||
let query = location.search;
|
||||
if (query === '?error') {
|
||||
$('#loginError').show();
|
||||
}
|
||||
});
|
||||
|
||||
function checkForm(){
|
||||
var inputPwd = document.getElementById('input_pwd');
|
||||
var rsaPwd = document.getElementById('rsa_pwd');
|
||||
// 加密
|
||||
let encrypt = new JSEncrypt();
|
||||
var publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCpC4QMnbTrQOFriJJCCFFWhlruBJThAEBfRk7pRx1jsAhyNVL3CqJb0tRvpnbCnJhrRAEPdgFHXv5A0RrvFp+5Cw7QoFH6O9rKB8+0H7+aVQeKITMUHf/XMXioymw6Iq4QfWd8RhdtM1KM6eGTy8aU7SO2s69Mc1LXefg/x3yw6wIDAQAB';
|
||||
encrypt.setPublicKey(publicKey);
|
||||
rsaPwd.value= encodeURIComponent(encrypt.encrypt(inputPwd.value));
|
||||
//进行下一步
|
||||
return true;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>登录界面</title>
|
||||
<link rel="stylesheet" href="/css/reset.css"/>
|
||||
<link rel="stylesheet" href="/css/common.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap login_wrap">
|
||||
<div class="content">
|
||||
<div class="logo"></div>
|
||||
<div class="login_box">
|
||||
|
||||
<div class="login_form">
|
||||
<div class="login_title">
|
||||
登录
|
||||
</div>
|
||||
<form action="/uaa/login" method="post" onsubmit='return checkForm()'>
|
||||
<div class="form_text_ipt">
|
||||
<input name="username" type="text" placeholder="用户名" value="admin">
|
||||
</div>
|
||||
<div class="ececk_warning"><span>用户名不能为空</span></div>
|
||||
<div class="_warning"><span></span></div>
|
||||
<div class="form_text_ipt">
|
||||
<input type="password" id='input_pwd' placeholder="密码" value="123456">
|
||||
<input type='hidden' name='password' id='rsa_pwd' value=''/>
|
||||
</div>
|
||||
<div class="ececk_warning"><span>密码不能为空</span></div>
|
||||
<div class="form_btn">
|
||||
<button type="submit">登录</button>
|
||||
</div>
|
||||
<div id="loginError" class="ececk_warning" style="text-align: center;"><span>用户名或密码错误</span></div>
|
||||
<div class="form_reg_btn">
|
||||
<!--span>还没有帐号?</span><a href="/register">马上注册</a-->
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/js/jsencrypt.min.js"></script>
|
||||
<script type="text/javascript" src="/js/common.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<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$/target/generated-sources/annotations" isTestSource="false" generated="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="common-core" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.45" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: joda-time:joda-time:2.9.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-csv:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.6.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.76" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.jimmyshi:bean-query:1.1.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-all:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-oauth2:2.2.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-security:2.2.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-security:2.2.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-security:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.1.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-jwt:1.0.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security.oauth:spring-security-oauth2:2.3.8.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.session:spring-session-data-redis:2.3.3.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.session:spring-session-core:2.3.3.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.10.RELEASE" 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.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.3.7.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.63.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.16.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-freemarker:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.31" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-jul:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.12" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-starter-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.spring:spring-context-support:1.0.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-api:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-hystrix:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-httpclient:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-core:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava:1.3.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-serialization:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.fasterxml.jackson.module:jackson-module-afterburner:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-metrics-event-stream:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-javanica:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.mapstruct:mapstruct-processor:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-recipes:4.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.5.3-beta" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.luben:zstd-jni:1.4.3-1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.lz4:lz4-java:1.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.lmax:disruptor:3.4.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.skywalking:apm-toolkit-log4j-2.x:7.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" 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.16.1" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.3" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,155 @@
|
||||
<?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$/target/generated-sources/annotations" isTestSource="false" generated="true" />
|
||||
<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-freemarker:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.10.RELEASE" 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.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.31" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j2:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-jul:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.15.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.12" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-starter-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: de.codecentric:spring-boot-admin-client:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:2.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.spring:spring-context-support:1.0.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-client:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-common:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba.nacos:nacos-api:1.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.3.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.59" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-hystrix:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-httpclient:10.10.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-hystrix:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-archaius:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-core:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava:1.3.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-serialization:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.fasterxml.jackson.module:jackson-module-afterburner:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-metrics-event-stream:1.5.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-javanica:1.5.18" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.commons:commons-lang3:3.10" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex:rxjava-reactive-streams:1.2.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.mapstruct:mapstruct-processor:1.4.2.Final" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-recipes:4.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.5.3-beta" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.luben:zstd-jni:1.4.3-1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.lz4:lz4-java:1.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.12.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.lmax:disruptor:3.4.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.skywalking:apm-toolkit-log4j-2.x:7.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.10.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" 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.16.1" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.3" 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.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.22" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" 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.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.14.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
Reference in New Issue
Block a user