├── .gitignore ├── README.md ├── api-gateway ├── build.gradle └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── geektop │ │ │ └── gateway │ │ │ └── GatewayApplication.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── net │ └── geektop │ └── gateway │ └── GatewayApplicationTests.java ├── build.gradle ├── buildSrc ├── build.gradle └── src │ └── main │ └── groovy │ ├── insight.java-application-conventions.gradle │ ├── insight.java-common-conventions.gradle │ └── insight.java-library-conventions.gradle ├── common-lib-web ├── build.gradle └── src │ ├── main │ ├── java │ │ └── net │ │ │ └── geektop │ │ │ └── web │ │ │ └── CommonWebApplication.java │ └── resources │ │ └── logback.xml │ └── test │ └── java │ └── net │ └── geektop │ └── web │ └── CommonWebApplicationTests.java ├── common-lib ├── build.gradle └── src │ ├── main │ └── java │ │ └── net │ │ └── geektop │ │ └── common │ │ └── CommonApplication.java │ └── test │ └── java │ └── net │ └── geektop │ └── common │ ├── CommonApplicationTests.java │ ├── aop │ └── LogAspectTest.java │ ├── benchmark │ └── SnowflakeBenchmark.java │ ├── compress │ └── CompressTest.java │ ├── encryption │ ├── DESEncryptionTest.java │ └── PGPEncryptHelperTest.java │ ├── excel │ └── WriteExcelTest.java │ ├── http │ └── UserAgentTest.java │ ├── sequence │ ├── SequenceUtilTest.java │ └── SnowflakeImplTest.java │ └── string │ └── StringUtilTest.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | *.log 8 | 9 | ### STS ### 10 | .apt_generated 11 | .classpath 12 | .factorypath 13 | .project 14 | .settings 15 | .springBeans 16 | .sts4-cache 17 | 18 | ### IntelliJ IDEA ### 19 | .idea 20 | *.iws 21 | *.iml 22 | *.ipr 23 | out/ 24 | 25 | ### NetBeans ### 26 | /nbproject/private/ 27 | /nbbuild/ 28 | /dist/ 29 | /nbdist/ 30 | /.nb-gradle/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | bin/ 35 | 36 | ### logs ### 37 | logs/ 38 | 39 | ### system file ### 40 | .DS_Store 41 | 42 | ### python ### 43 | venv 44 | *.py[co] 45 | 46 | ### node ### 47 | node_modules 48 | package-lock.json 49 | /invest/invest-desktop/dist 50 | 51 | ### xcode ### 52 | reading/reading-mac/Pods/ 53 | reading/reading-mac/Carthage/ 54 | reading/reading-mac/build/ 55 | *.pbxuser 56 | *.perspective 57 | *.perspectivev3 58 | *.swp 59 | *~.nib 60 | *.xcuserstate 61 | 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Multi-cloud asset management system 2 | 3 | The Multi-Cloud Asset Management System is a robust solution designed to streamline and centralize the management of assets across multiple cloud environments. Developed using Java and Python, the system leverages their unique strengths to provide a scalable and efficient platform for modern cloud infrastructure needs. 4 | 5 | Key features include: 6 | 7 | - **Unified Asset Visibility**: Gain a comprehensive view of resources across diverse cloud providers. 8 | - **Automation and Optimization**: Simplify operations with automated workflows and intelligent asset allocation. 9 | - **Integration Support**: Seamlessly connect with existing tools and frameworks to enhance operational efficiency. 10 | 11 | The system employs **Gradle Multi-Repo** for managing dependencies and builds, ensuring modular, maintainable, and scalable project architecture. This approach allows development teams to manage separate repositories effectively while enabling smooth collaboration and streamlined deployment pipelines. 12 | 13 | Built for enterprises embracing multi-cloud strategies, this system bridges operational silos and enhances resource utilization, paving the way for effective cloud governance and optimized infrastructure management. 14 | -------------------------------------------------------------------------------- /api-gateway/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'insight.java-application-conventions' 3 | id 'org.springframework.boot' 4 | id 'io.spring.dependency-management' 5 | id 'java' 6 | } 7 | 8 | java { 9 | sourceCompatibility = JavaVersion.VERSION_17 10 | targetCompatibility = JavaVersion.VERSION_17 11 | } 12 | 13 | 14 | //group = 'net.geektop' 15 | //version = '0.0.1-SNAPSHOT' 16 | //sourceCompatibility = '11' 17 | 18 | configurations { 19 | compileOnly { 20 | extendsFrom annotationProcessor 21 | } 22 | } 23 | 24 | repositories { 25 | mavenCentral() 26 | } 27 | 28 | ext { 29 | set('springCloudVersion', "${springCloudVersion}") 30 | } 31 | 32 | dependencies { 33 | implementation 'org.springframework.cloud:spring-cloud-starter-gateway' 34 | compileOnly 'org.projectlombok:lombok' 35 | annotationProcessor 'org.projectlombok:lombok' 36 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 37 | } 38 | 39 | dependencyManagement { 40 | imports { 41 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" 42 | } 43 | } 44 | 45 | test { 46 | useJUnitPlatform() 47 | } 48 | -------------------------------------------------------------------------------- /api-gateway/src/main/java/net/geektop/gateway/GatewayApplication.java: -------------------------------------------------------------------------------- 1 | package net.geektop.gateway; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class GatewayApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(GatewayApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /api-gateway/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: gateway-service 4 | 5 | cloud: 6 | gateway: 7 | routes: 8 | - id: account-service 9 | uri: http://localhost:8091 10 | -------------------------------------------------------------------------------- /api-gateway/src/test/java/net/geektop/gateway/GatewayApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.geektop.gateway; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GatewayApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version "${springBootVersion}" apply false 3 | id 'io.spring.dependency-management' version "${springDependencyManagement}" apply false 4 | id 'org.asciidoctor.convert' version "${sciidoctorConvert}" apply false 5 | id 'java' 6 | } 7 | 8 | group = 'net.geektop' 9 | version = "${projectVersion}" 10 | 11 | repositories { 12 | maven { 13 | url 'https://maven.aliyun.com/repository/central' 14 | } 15 | maven { 16 | url 'https://maven.aliyun.com/repository/spring/' 17 | } 18 | mavenLocal() 19 | mavenCentral() 20 | maven { url "https://jitpack.io" } 21 | maven { url 'https://repo.spring.io/snapshot' } 22 | maven { url 'https://repo.spring.io/milestone' } 23 | } 24 | 25 | allprojects { 26 | repositories { 27 | maven { 28 | url 'https://maven.aliyun.com/repository/central' 29 | } 30 | maven { 31 | url 'https://maven.aliyun.com/repository/spring/' 32 | } 33 | mavenLocal() 34 | mavenCentral() 35 | maven { url "https://jitpack.io" } 36 | maven { url 'https://repo.spring.io/snapshot' } 37 | maven { url 'https://repo.spring.io/milestone' } 38 | } 39 | } 40 | 41 | subprojects { 42 | configurations.all { 43 | exclude group:'org.springframework.boot', module: 'spring-boot-starter-logging' 44 | exclude module: 'logback-classic' 45 | exclude module: 'logback-core' 46 | } 47 | } 48 | 49 | //ext.libraries = [ 50 | //] 51 | 52 | java { 53 | sourceCompatibility = JavaVersion.VERSION_17 54 | targetCompatibility = JavaVersion.VERSION_17 55 | } 56 | -------------------------------------------------------------------------------- /buildSrc/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | */ 4 | 5 | plugins { 6 | // Support convention plugins written in Groovy. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. 7 | id 'groovy-gradle-plugin' 8 | } 9 | 10 | repositories { 11 | // Use the plugin portal to apply community plugins in convention plugins. 12 | gradlePluginPortal() 13 | } 14 | -------------------------------------------------------------------------------- /buildSrc/src/main/groovy/insight.java-application-conventions.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | */ 4 | 5 | plugins { 6 | // Apply the common convention plugin for shared build configuration between library and application projects. 7 | id 'insight.java-common-conventions' 8 | 9 | // Apply the application plugin to add support for building a CLI application in Java. 10 | id 'application' 11 | } 12 | 13 | java { 14 | sourceCompatibility = JavaVersion.VERSION_21 15 | targetCompatibility = JavaVersion.VERSION_21 16 | } 17 | -------------------------------------------------------------------------------- /buildSrc/src/main/groovy/insight.java-common-conventions.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | */ 4 | 5 | plugins { 6 | // Apply the java Plugin to add support for Java. 7 | id 'java' 8 | } 9 | 10 | 11 | java { 12 | sourceCompatibility = JavaVersion.VERSION_21 13 | targetCompatibility = JavaVersion.VERSION_21 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | mavenLocal() 19 | mavenCentral() 20 | maven { url "https://jitpack.io" } 21 | maven { url 'https://repo.spring.io/milestone' } 22 | } 23 | } 24 | 25 | subprojects { 26 | configurations.all { 27 | exclude group:'org.springframework.boot', module: 'spring-boot-starter-logging' 28 | exclude module: 'logback-classic' 29 | exclude module: 'logback-core' 30 | } 31 | } 32 | 33 | dependencies { 34 | constraints { 35 | 36 | // https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter 37 | implementation 'com.baomidou:mybatis-plus-boot-starter:3.5.5' 38 | 39 | // https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-spring-boot3-starter 40 | implementation 'com.baomidou:mybatis-plus-spring-boot3-starter:3.5.5' 41 | 42 | // https://mvnrepository.com/artifact/org.mybatis/mybatis-spring 43 | implementation group: 'org.mybatis', name: 'mybatis-spring', version: '3.0.3' 44 | 45 | // https://mvnrepository.com/artifact/com.baomidou/dynamic-datasource-spring-boot-starter 46 | implementation 'com.baomidou:dynamic-datasource-spring-boot-starter:4.2.0' 47 | 48 | implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.2' 49 | 50 | // https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api 51 | implementation 'javax.xml.bind:jaxb-api:2.3.1' 52 | 53 | // https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-core 54 | implementation 'com.sun.xml.bind:jaxb-core:3.0.2' 55 | 56 | // https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl 57 | implementation 'com.sun.xml.bind:jaxb-impl:3.0.2' 58 | 59 | // https://mvnrepository.com/artifact/com.nimbusds/nimbus-jose-jwt 60 | implementation 'com.nimbusds:nimbus-jose-jwt:9.22' 61 | 62 | // https://mvnrepository.com/artifact/com.nimbusds/oauth2-oidc-sdk 63 | // can be runtimeOnly 64 | implementation 'com.nimbusds:oauth2-oidc-sdk:9.35' 65 | runtimeOnly 'com.nimbusds:oauth2-oidc-sdk:9.35' 66 | 67 | // https://mvnrepository.com/artifact/com.github.dozermapper/dozer-spring-boot-starter 68 | implementation 'com.github.dozermapper:dozer-spring-boot-starter:6.5.2' 69 | 70 | // https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 71 | implementation 'io.springfox:springfox-swagger2:3.0.0' 72 | 73 | // https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui 74 | implementation 'io.springfox:springfox-swagger-ui:3.0.0' 75 | 76 | // https://mvnrepository.com/artifact/io.springfox/springfox-boot-starter 77 | implementation 'io.springfox:springfox-boot-starter:3.0.0' 78 | 79 | // https://mvnrepository.com/artifact/org.mybatis/mybatis-typehandlers-jsr310 80 | implementation 'org.mybatis:mybatis-typehandlers-jsr310:1.0.2' 81 | 82 | // https://mvnrepository.com/artifact/org.springframework.shell/spring-shell-starter 83 | implementation 'org.springframework.shell:spring-shell-starter:2.0.1.RELEASE' 84 | 85 | // https://mvnrepository.com/artifact/javax/javaee-api 86 | implementation 'javax:javaee-api:8.0.1' 87 | 88 | // https://mvnrepository.com/artifact/io.sentry/sentry 89 | implementation 'io.sentry:sentry:6.23.0' 90 | 91 | // https://mvnrepository.com/artifact/io.sentry/sentry-spring-boot-starter 92 | implementation 'io.sentry:sentry-spring-boot-starter:6.24.0' 93 | 94 | implementation 'io.sentry:sentry-spring-boot-starter-jakarta:6.24.0' 95 | 96 | // https://mvnrepository.com/artifact/io.sentry/sentry-log4j2 97 | implementation 'io.sentry:sentry-log4j2:6.24.0' 98 | 99 | // https://mvnrepository.com/artifact/cn.hutool/hutool-all 100 | implementation 'cn.hutool:hutool-all:5.7.16' 101 | 102 | // https://mvnrepository.com/artifact/commons-io/commons-io 103 | implementation 'commons-io:commons-io:2.11.0' 104 | 105 | // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 106 | implementation 'org.apache.commons:commons-lang3:3.12.0' 107 | 108 | // https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 109 | implementation 'org.apache.commons:commons-collections4:4.4' 110 | 111 | // https://mvnrepository.com/artifact/org.apache.commons/commons-compress 112 | implementation 'org.apache.commons:commons-compress:1.21' 113 | 114 | // https://mvnrepository.com/artifact/commons-net/commons-net 115 | implementation 'commons-net:commons-net:3.8.0' 116 | 117 | // https://mvnrepository.com/artifact/org.apache.commons/commons-math3 118 | implementation 'org.apache.commons:commons-math3:3.6.1' 119 | 120 | // https://mvnrepository.com/artifact/commons-codec/commons-codec 121 | implementation 'commons-codec:commons-codec:1.16.0' 122 | 123 | // https://mvnrepository.com/artifact/org.apache.commons/commons-text 124 | implementation 'org.apache.commons:commons-text:1.9' 125 | 126 | // https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 127 | implementation 'org.apache.commons:commons-pool2:2.11.1' 128 | 129 | // https://mvnrepository.com/artifact/org.apache.commons/commons-vfs2 130 | implementation 'org.apache.commons:commons-vfs2:2.9.0' 131 | 132 | // https://mvnrepository.com/artifact/org.apache.commons/commons-rng-simple 133 | implementation 'org.apache.commons:commons-rng-simple:1.4' 134 | 135 | // https://mvnrepository.com/artifact/org.apache.commons/commons-rdf-jena 136 | implementation 'org.apache.commons:commons-rdf-jena:0.5.0' 137 | 138 | // https://mvnrepository.com/artifact/org.apache.commons/commons-rdf-api 139 | implementation 'org.apache.commons:commons-rdf-api:0.5.0' 140 | 141 | // https://mvnrepository.com/artifact/org.apache.commons/commons-numbers-core 142 | implementation 'org.apache.commons:commons-numbers-core:1.0' 143 | 144 | // https://mvnrepository.com/artifact/org.apache.commons/commons-exec 145 | implementation 'org.apache.commons:commons-exec:1.3' 146 | 147 | // https://mvnrepository.com/artifact/commons-daemon/commons-daemon 148 | implementation 'commons-daemon:commons-daemon:1.2.4' 149 | 150 | // https://mvnrepository.com/artifact/org.apache.commons/commons-csv 151 | implementation 'org.apache.commons:commons-csv:1.9.0' 152 | 153 | // https://mvnrepository.com/artifact/org.apache.commons/commons-crypto 154 | implementation 'org.apache.commons:commons-crypto:1.1.0' 155 | 156 | // https://mvnrepository.com/artifact/commons-cli/commons-cli 157 | implementation 'commons-cli:commons-cli:1.5.0' 158 | 159 | // https://mvnrepository.com/artifact/org.apache.commons/commons-imaging 160 | implementation 'org.apache.commons:commons-imaging:1.0-alpha2' 161 | 162 | // https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils 163 | implementation 'commons-beanutils:commons-beanutils:1.9.4' 164 | 165 | // https://mvnrepository.com/artifact/org.apache.tika/tika-core 166 | implementation 'org.apache.tika:tika-core:2.1.0' 167 | 168 | // https://mvnrepository.com/artifact/org.apache.tika/tika-parsers 169 | implementation 'org.apache.tika:tika-parsers:2.1.0' 170 | 171 | // https://mvnrepository.com/artifact/org.apache.tika/tika-langdetect 172 | implementation 'org.apache.tika:tika-langdetect:2.1.0' 173 | 174 | // https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient 175 | implementation 'org.apache.httpcomponents:httpclient:4.5.13' 176 | 177 | // https://mvnrepository.com/artifact/org.jetbrains/annotations 178 | implementation 'org.jetbrains:annotations:23.1.0' 179 | 180 | // https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp 181 | implementation 'com.squareup.okhttp3:okhttp:4.9.2' 182 | 183 | // https://mvnrepository.com/artifact/org.jsoup/jsoup 184 | implementation 'org.jsoup:jsoup:1.16.1' 185 | 186 | // https://mvnrepository.com/artifact/com.alibaba/fastjson 187 | implementation 'com.alibaba:fastjson:1.2.80' 188 | 189 | // https://mvnrepository.com/artifact/com.google.guava/guava 190 | implementation 'com.google.guava:guava:32.1.3-jre' 191 | 192 | // https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox 193 | implementation 'org.apache.pdfbox:pdfbox:2.0.24' 194 | 195 | // https://mvnrepository.com/artifact/com.itextpdf/itextpdf 196 | implementation 'com.itextpdf:itextpdf:5.5.13.2' 197 | 198 | // https://mvnrepository.com/artifact/com.itextpdf/kernel 199 | implementation 'com.itextpdf:kernel:7.2.2' 200 | 201 | // https://mvnrepository.com/artifact/com.itextpdf/itext7-core 202 | implementation 'com.itextpdf:itext7-core:7.2.2' 203 | 204 | // https://mvnrepository.com/artifact/com.itextpdf/io 205 | implementation 'com.itextpdf:io:7.2.2' 206 | 207 | // https://mvnrepository.com/artifact/org.openjfx/javafx-base 208 | // javafx_base: 'org.openjfx:javafx-base:14.0.1', 209 | 210 | // https://mvnrepository.com/artifact/io.netty/netty-all 211 | implementation 'io.netty:netty-all:4.1.76.Final' 212 | 213 | // https://mvnrepository.com/artifact/com.squareup.okio/okio 214 | implementation 'com.squareup.okio:okio:2.10.0' 215 | 216 | // https://mvnrepository.com/artifact/com.github.oshi/oshi-core 217 | implementation 'com.github.oshi:oshi-core:5.8.3' 218 | 219 | // https://mvnrepository.com/artifact/com.google.zxing/core 220 | implementation 'com.google.zxing:core:3.4.1' 221 | 222 | // https://mvnrepository.com/artifact/org.greenrobot/eventbus 223 | implementation 'org.greenrobot:eventbus:3.2.0' 224 | 225 | // https://mvnrepository.com/artifact/com.squareup/javapoet 226 | implementation 'com.squareup:javapoet:1.13.0' 227 | 228 | // https://mvnrepository.com/artifact/org.mockito/mockito-core 229 | implementation 'org.mockito:mockito-core:3.9.0' 230 | 231 | // https://mvnrepository.com/artifact/com.google.code.gson/gson 232 | implementation 'com.google.code.gson:gson:2.8.6' 233 | 234 | // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind 235 | implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.1' 236 | 237 | // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core 238 | implementation 'com.fasterxml.jackson.core:jackson-core:2.16.1' 239 | 240 | // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations 241 | implementation 'com.fasterxml.jackson.core:jackson-annotations:2.16.1' 242 | 243 | // https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jsr310 244 | implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1' 245 | 246 | // https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml 247 | implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.1' 248 | 249 | // https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-toml 250 | implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-toml', version: '2.16.1' 251 | 252 | 253 | // https://mvnrepository.com/artifact/tk.mybatis/mapper-spring-boot-starter 254 | implementation 'tk.mybatis:mapper-spring-boot-starter:4.2.2' 255 | 256 | // https://mvnrepository.com/artifact/net.oschina.j2cache/j2cache-core 257 | implementation 'net.oschina.j2cache:j2cache-core:2.8.2-release' 258 | 259 | // https://mvnrepository.com/artifact/net.oschina.j2cache/j2cache-mybatis 260 | implementation 'net.oschina.j2cache:j2cache-mybatis:2.8.0-release' 261 | 262 | // https://mvnrepository.com/artifact/net.oschina.j2cache/j2cache-spring-boot2-starter 263 | implementation 'net.oschina.j2cache:j2cache-spring-boot2-starter:2.8.0-release' 264 | 265 | // https://mvnrepository.com/artifact/org.apache.mina/mina-core 266 | implementation 'org.apache.mina:mina-core:2.1.4' 267 | 268 | // https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4 269 | implementation 'org.powermock:powermock-module-junit4:2.0.7' 270 | 271 | // https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter 272 | implementation 'org.mockito:mockito-junit-jupiter:3.5.0' 273 | 274 | // https://mvnrepository.com/artifact/io.projectreactor/reactor-core 275 | implementation 'io.projectreactor:reactor-core:3.3.6.RELEASE' 276 | 277 | // https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on 278 | implementation 'org.bouncycastle:bcprov-jdk15on:1.67' 279 | 280 | // https://mvnrepository.com/artifact/org.bouncycastle/bcpg-jdk15on 281 | implementation 'org.bouncycastle:bcpg-jdk15on:1.67' 282 | 283 | // https://mvnrepository.com/artifact/com.lmax/disruptor 284 | implementation 'com.lmax:disruptor:3.4.2' 285 | 286 | // https://mvnrepository.com/artifact/org.springframework.statemachine/spring-statemachine-core 287 | implementation 'org.springframework.statemachine:spring-statemachine-core:3.0.0' 288 | 289 | // https://mvnrepository.com/artifact/org.squirrelframework/squirrel-foundation 290 | implementation 'org.squirrelframework:squirrel-squirrel:0.3.8' 291 | 292 | // https://mvnrepository.com/artifact/org.apache.poi/poi 293 | implementation 'org.apache.poi:poi:4.1.2' 294 | 295 | // https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml 296 | implementation 'org.apache.poi:poi-ooxml:5.0.0' 297 | 298 | // https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-schemas 299 | implementation 'org.apache.poi:poi-ooxml-schemas:4.1.2' 300 | 301 | // https://mvnrepository.com/artifact/org.apache.poi/poi-scratchpad 302 | implementation 'org.apache.poi:poi-scratchpad:4.1.2' 303 | 304 | // https://mvnrepository.com/artifact/org.apache.poi/poi-excelant 305 | implementation 'org.apache.poi:poi-excelant:4.1.2' 306 | 307 | // https://mvnrepository.com/artifact/it.unimi.dsi/fastutil 308 | implementation 'it.unimi.dsi:fastutil:8.5.6' 309 | 310 | // https://mvnrepository.com/artifact/org.bytedeco/javacv 311 | implementation 'org.bytedeco:javacv:1.5.5' 312 | 313 | // https://mvnrepository.com/artifact/io.micrometer.prometheus/prometheus-rsocket-spring 314 | implementation 'io.micrometer.prometheus:prometheus-rsocket-spring:1.3.0' 315 | 316 | // https://mvnrepository.com/artifact/com.aliyun.oss/aliyun-sdk-oss 317 | implementation 'com.aliyun.oss:aliyun-sdk-oss:3.12.0' 318 | 319 | // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java 320 | implementation 'org.seleniumhq.selenium:selenium-java:4.1.3' 321 | 322 | // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-firefox-driver 323 | implementation 'org.seleniumhq.selenium:selenium-firefox-driver:4.1.3' 324 | 325 | // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver 326 | implementation 'org.seleniumhq.selenium:selenium-chrome-driver:4.1.3' 327 | 328 | // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-safari-driver 329 | implementation 'org.seleniumhq.selenium:selenium-safari-driver:4.1.3' 330 | 331 | // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-ie-driver 332 | implementation 'org.seleniumhq.selenium:selenium-ie-driver:4.1.3' 333 | 334 | // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-edge-driver 335 | implementation 'org.seleniumhq.selenium:selenium-edge-driver:4.1.3' 336 | 337 | // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-opera-driver 338 | implementation 'org.seleniumhq.selenium:selenium-opera-driver:4.1.3' 339 | 340 | // https://mvnrepository.com/artifact/com.password4j/password4j 341 | implementation 'com.password4j:password4j:1.7.0' 342 | 343 | // https://mvnrepository.com/artifact/org.passay/passay 344 | implementation group: 'org.passay', name: 'passay', version: '1.6.3' 345 | 346 | // https://mvnrepository.com/artifact/org.zalando/problem-spring-web 347 | implementation 'org.zalando:problem-spring-web:0.27.0' 348 | 349 | // https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api 350 | implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5' 351 | 352 | // https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-impl 353 | runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5' 354 | 355 | // https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-jackson 356 | runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5' 357 | 358 | // https://mvnrepository.com/artifact/io.bootique/bootique 359 | implementation 'io.bootique:bootique:1.2' 360 | 361 | // https://mvnrepository.com/artifact/com.shekhargulati/strman 362 | implementation 'com.shekhargulati:strman:0.4.0' 363 | 364 | // https://mvnrepository.com/artifact/org.tukaani/xz 365 | implementation 'org.tukaani:xz:1.9' 366 | 367 | // https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core 368 | implementation 'org.apache.logging.log4j:log4j-core:2.17.1' 369 | 370 | // https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api 371 | implementation 'org.apache.logging.log4j:log4j-api:2.17.1' 372 | 373 | // https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl 374 | implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.19.0' 375 | 376 | // https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl 377 | testImplementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.19.0' 378 | 379 | // https://mvnrepository.com/artifact/org.apache.shiro/shiro-spring-boot-starter 380 | implementation 'org.apache.shiro:shiro-spring-boot-starter:1.8.0' 381 | 382 | // https://mvnrepository.com/artifact/javax.mail/javax.mail-api 383 | implementation 'javax.mail:javax.mail-api:1.6.2' 384 | 385 | // https://mvnrepository.com/artifact/org.projectlombok/lombok 386 | implementation 'org.projectlombok:lombok:1.18.30' 387 | compileOnly 'org.projectlombok:lombok:1.18.30' 388 | annotationProcessor 'org.projectlombok:lombok:1.18.30' 389 | 390 | // https://mvnrepository.com/artifact/org.slf4j/slf4j-api 391 | implementation 'org.slf4j:slf4j-api:1.7.36' 392 | 393 | // https://mvnrepository.com/artifact/org.slf4j/slf4j-simple 394 | testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.6' 395 | 396 | 397 | // https://mvnrepository.com/artifact/io.vertx/vertx-mail-client 398 | implementation 'io.vertx:vertx-mail-client:4.0.3' 399 | 400 | // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api 401 | implementation 'org.junit.jupiter:junit-jupiter-api:5.7.1' 402 | 403 | // https://mvnrepository.com/artifact/com.sun.mail/jakarta.mail 404 | implementation 'com.sun.mail:jakarta.mail:2.0.1' 405 | 406 | // https://mvnrepository.com/artifact/com.jfoenix/jfoenix 407 | implementation 'com.jfoenix:jfoenix:9.0.10' 408 | 409 | // https://mvnrepository.com/artifact/org.openjdk.jmh/jmh-core 410 | implementation 'org.openjdk.jmh:jmh-core:1.29' 411 | 412 | // https://mvnrepository.com/artifact/org.openjdk.jmh/jmh-generator-annprocess 413 | implementation 'org.openjdk.jmh:jmh-generator-annprocess:1.29' 414 | 415 | // https://mvnrepository.com/artifact/org.springframework.security.oauth.boot/spring-security-oauth2-autoconfigure 416 | implementation 'org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.6.6' 417 | 418 | // https://mvnrepository.com/artifact/eu.bitwalker/UserAgentUtils 419 | implementation 'eu.bitwalker:UserAgentUtils:1.21' 420 | 421 | // https://mtedone.github.io/podam/index.html 422 | // https://mvnrepository.com/artifact/uk.co.jemos.podam/podam 423 | implementation 'uk.co.jemos.podam:podam:7.2.7.RELEASE' 424 | testImplementation 'uk.co.jemos.podam:podam:7.2.7.RELEASE' 425 | 426 | // https://mvnrepository.com/artifact/com.github.javafaker/javafaker 427 | implementation 'com.github.javafaker:javafaker:1.0.2' 428 | // https://github.com/libgdx/libgdx.git Desktop/Android/HTML5/iOS Java game development framework 429 | 430 | // https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf 431 | implementation 'org.thymeleaf:thymeleaf:3.0.14.RELEASE' 432 | 433 | // https://mvnrepository.com/artifact/org.xhtmlrenderer/flying-saucer-pdf 434 | implementation 'org.xhtmlrenderer:flying-saucer-pdf:9.1.22' 435 | 436 | // https://mvnrepository.com/artifact/org.apache.oltu.oauth2/org.apache.oltu.oauth2.authzserver 437 | implementation 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.authzserver:1.0.2' 438 | 439 | // https://mvnrepository.com/artifact/org.apache.oltu.oauth2/org.apache.oltu.oauth2.resourceserver 440 | implementation 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.resourceserver:1.0.2' 441 | 442 | // https://mvnrepository.com/artifact/org.codehaus.plexus/plexus-utils 443 | implementation 'org.codehaus.plexus:plexus-utils:3.4.1' 444 | 445 | // https://mvnrepository.com/artifact/org.springframework.retry/spring-retry 446 | implementation 'org.springframework.retry:spring-retry:2.0.1' 447 | 448 | // https://mvnrepository.com/artifact/org.asciidoctor/asciidoclet 449 | implementation 'org.asciidoctor:asciidoclet:1.+' 450 | 451 | // https://mvnrepository.com/artifact/net.java.dev.javacc/javacc 452 | implementation 'net.java.dev.javacc:javacc:7.0.10' 453 | 454 | // https://mvnrepository.com/artifact/org.antlr/antlr4-runtime 455 | implementation 'org.antlr:antlr4-runtime:4.9.3' 456 | 457 | // https://mvnrepository.com/artifact/org.mybatis/mybatis 458 | implementation 'org.mybatis:mybatis:3.5.10' 459 | 460 | // https://mvnrepository.com/artifact/com.alibaba/easyexcel 461 | implementation 'com.alibaba:easyexcel:3.3.2' 462 | 463 | // https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit 464 | implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '6.2.0.202206071550-r' 465 | 466 | // https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit.ssh.jsch 467 | implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit.ssh.jsch', version: '6.2.0.202206071550-r' 468 | 469 | // https://mvnrepository.com/artifact/dnsjava/dnsjava 470 | implementation group: 'dnsjava', name: 'dnsjava', version: '3.5.1' 471 | 472 | // https://mvnrepository.com/artifact/org.bytedeco/javacv 473 | implementation group: 'org.bytedeco', name: 'javacv', version: '1.5.7' 474 | 475 | // https://mvnrepository.com/artifact/org.bytedeco/javacpp 476 | implementation group: 'org.bytedeco', name: 'javacpp', version: '1.5.7' 477 | 478 | // web jars 479 | implementation 'org.webjars.npm:alpinejs:3.10.5' 480 | 481 | // https://mvnrepository.com/artifact/com.github.penggle/kaptcha 482 | implementation group: 'com.github.penggle', name: 'kaptcha', version: '2.3.2' 483 | 484 | // https://mvnrepository.com/artifact/org.webjars/AdminLTE 485 | implementation group: 'org.webjars', name: 'AdminLTE', version: '3.2.0' 486 | 487 | // https://mvnrepository.com/artifact/org.webjars/bootstrap 488 | implementation group: 'org.webjars', name: 'bootstrap', version: '4.6.2' 489 | 490 | // https://mvnrepository.com/artifact/net.datafaker/datafaker 491 | implementation group: 'net.datafaker', name: 'datafaker', version: '1.8.0' 492 | 493 | // https://mvnrepository.com/artifact/com.pig4cloud.plugin/captcha-spring-boot-starter 494 | implementation group: 'com.pig4cloud.plugin', name: 'captcha-spring-boot-starter', version: '2.2.2' 495 | 496 | // https://mvnrepository.com/artifact/com.tencentcloudapi/tencentcloud-sdk-java-sms 497 | implementation group: 'com.tencentcloudapi', name: 'tencentcloud-sdk-java-sms', version: '3.1.853' 498 | 499 | // https://mvnrepository.com/artifact/cn.xuyanwu/spring-file-storage 500 | implementation group: 'cn.xuyanwu', name: 'spring-file-storage', version: '0.7.0' 501 | 502 | // https://mvnrepository.com/artifact/com.qcloud/cos_api 503 | implementation group: 'com.qcloud', name: 'cos_api', version: '5.6.143' 504 | 505 | // https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-ecs 506 | implementation group: 'com.aliyun', name: 'aliyun-java-sdk-ecs', version: '4.24.62' 507 | 508 | // https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-core 509 | implementation group: 'com.aliyun', name: 'aliyun-java-sdk-core', version: '4.6.3' 510 | 511 | // https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2 512 | implementation group: 'com.alibaba.fastjson2', name: 'fastjson2', version: '2.0.31' 513 | 514 | // https://mvnrepository.com/artifact/com.jcraft/jsch 515 | implementation group: 'com.jcraft', name: 'jsch', version: '0.1.55' 516 | 517 | // https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-bssopenapi 518 | implementation group: 'com.aliyun', name: 'aliyun-java-sdk-bssopenapi', version: '1.8.9' 519 | 520 | // https://mvnrepository.com/artifact/com.aliyun.oss/aliyun-sdk-oss 521 | implementation group: 'com.aliyun.oss', name: 'aliyun-sdk-oss', version: '3.16.3' 522 | 523 | // https://mvnrepository.com/artifact/com.alipay.sdk/alipay-sdk-java 524 | implementation group: 'com.alipay.sdk', name: 'alipay-sdk-java', version: '4.35.171.ALL' 525 | 526 | // https://mvnrepository.com/artifact/com.alipay.sdk/alipay-easysdk 527 | implementation group: 'com.alipay.sdk', name: 'alipay-easysdk', version: '2.2.3' 528 | 529 | // https://mvnrepository.com/artifact/org.modelmapper/modelmapper 530 | implementation group: 'org.modelmapper', name: 'modelmapper', version: '3.1.1' 531 | 532 | // https://mvnrepository.com/artifact/cn.zhxu/bean-searcher-boot-starter 533 | implementation group: 'cn.zhxu', name: 'bean-searcher-boot-starter', version: '4.2.0' 534 | 535 | // https://mvnrepository.com/artifact/com.github.wechatpay-apiv3/wechatpay-apache-httpclient 536 | implementation group: 'com.github.wechatpay-apiv3', name: 'wechatpay-apache-httpclient', version: '0.4.9' 537 | 538 | implementation 'com.github.wechatpay-apiv3:wechatpay-java:0.2.12' 539 | 540 | // https://mvnrepository.com/artifact/com.github.sonus21/rqueue-spring-boot-starter 541 | implementation group: 'com.github.sonus21', name: 'rqueue-spring-boot-starter', version: '3.1.0-RELEASE', ext: 'pom' 542 | 543 | // https://mvnrepository.com/artifact/org.redisson/redisson-spring-boot-starter 544 | implementation group: 'org.redisson', name: 'redisson-spring-boot-starter', version: '3.23.2' 545 | 546 | // https://mvnrepository.com/artifact/com.github.sonus21/rqueue-core 547 | implementation group: 'com.github.sonus21', name: 'rqueue-core', version: '3.1.0-RELEASE', ext: 'pom' 548 | 549 | // https://mvnrepository.com/artifact/com.github.sonus21/rqueue-spring 550 | implementation group: 'com.github.sonus21', name: 'rqueue-spring', version: '3.1.0-RELEASE', ext: 'pom' 551 | 552 | // https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api 553 | implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '4.0.0' 554 | 555 | // https://mvnrepository.com/artifact/com.theokanning.openai-gpt3-java/api 556 | implementation group: 'com.theokanning.openai-gpt3-java', name: 'api', version: '0.18.2' 557 | 558 | // https://mvnrepository.com/artifact/com.theokanning.openai-gpt3-java/service 559 | implementation group: 'com.theokanning.openai-gpt3-java', name: 'service', version: '0.18.2' 560 | 561 | // https://mvnrepository.com/artifact/com.knuddels/jtokkit 562 | implementation group: 'com.knuddels', name: 'jtokkit', version: '0.6.1' 563 | 564 | // https://mvnrepository.com/artifact/org.junit/junit-bom 565 | testImplementation group: 'org.junit', name: 'junit-bom', version: '5.10.1', ext: 'pom' 566 | 567 | // https://mvnrepository.com/artifact/com.squareup.retrofit2/retrofit 568 | implementation group: 'com.squareup.retrofit2', name: 'retrofit', version: '2.9.0' 569 | 570 | // https://mvnrepository.com/artifact/com.squareup.retrofit2/adapter-rxjava2 571 | implementation group: 'com.squareup.retrofit2', name: 'adapter-rxjava2', version: '2.9.0' 572 | 573 | // https://mvnrepository.com/artifact/com.squareup.retrofit2/converter-jackson 574 | implementation group: 'com.squareup.retrofit2', name: 'converter-jackson', version: '2.9.0' 575 | 576 | // https://mvnrepository.com/artifact/com.kjetland/mbknor-jackson-jsonschema 577 | implementation group: 'com.kjetland', name: 'mbknor-jackson-jsonschema_2.13', version: '1.0.39' 578 | 579 | // https://mvnrepository.com/artifact/com.squareup.retrofit2/retrofit-mock 580 | testImplementation group: 'com.squareup.retrofit2', name: 'retrofit-mock', version: '2.9.0' 581 | 582 | // https://mvnrepository.com/artifact/io.springboot.ai/spring-ai-core 583 | implementation group: 'io.springboot.ai', name: 'spring-ai-core', version: '1.0.3' 584 | 585 | // https://mvnrepository.com/artifact/io.springboot.ai/spring-ai-openai 586 | implementation group: 'io.springboot.ai', name: 'spring-ai-openai', version: '1.0.3' 587 | 588 | // https://mvnrepository.com/artifact/io.springboot.ai/spring-ai-retry 589 | implementation group: 'io.springboot.ai', name: 'spring-ai-retry', version: '1.0.3' 590 | 591 | // https://mvnrepository.com/artifact/org.mapstruct/mapstruct 592 | implementation group: 'org.mapstruct', name: 'mapstruct', version: '1.6.2' 593 | 594 | // https://mvnrepository.com/artifact/org.mapstruct/mapstruct-processor 595 | annotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.6.2' 596 | 597 | testAnnotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.6.2' 598 | 599 | } 600 | 601 | // Use JUnit Jupiter for testing. 602 | testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2' 603 | } 604 | 605 | tasks.named('test') { 606 | // Use JUnit Platform for unit tests. 607 | useJUnitPlatform() 608 | } 609 | -------------------------------------------------------------------------------- /buildSrc/src/main/groovy/insight.java-library-conventions.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | */ 4 | 5 | plugins { 6 | // Apply the common convention plugin for shared build configuration between library and application projects. 7 | id 'insight.java-common-conventions' 8 | 9 | // Apply the java-library plugin for API and implementation separation. 10 | id 'java-library' 11 | } 12 | 13 | java { 14 | sourceCompatibility = JavaVersion.VERSION_21 15 | targetCompatibility = JavaVersion.VERSION_21 16 | } 17 | -------------------------------------------------------------------------------- /common-lib-web/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'insight.java-application-conventions' 3 | id 'org.springframework.boot' 4 | id 'io.spring.dependency-management' 5 | id 'java' 6 | } 7 | 8 | java { 9 | sourceCompatibility = JavaVersion.VERSION_17 10 | targetCompatibility = JavaVersion.VERSION_17 11 | } 12 | 13 | 14 | ext { 15 | set('snippetsDir', file("build/generated-snippets")) 16 | } 17 | 18 | dependencies { 19 | implementation 'org.springframework.boot:spring-boot-starter-web' 20 | implementation 'org.springframework.boot:spring-boot-starter-aop' 21 | implementation 'org.springframework.boot:spring-boot-starter-validation' 22 | 23 | compileOnly 'org.projectlombok:lombok' 24 | annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' 25 | annotationProcessor 'org.projectlombok:lombok' 26 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 27 | testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc' 28 | } 29 | 30 | jar.enabled = true 31 | -------------------------------------------------------------------------------- /common-lib-web/src/main/java/net/geektop/web/CommonWebApplication.java: -------------------------------------------------------------------------------- 1 | package net.geektop.web; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class CommonWebApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(CommonWebApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /common-lib-web/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ${CONTEXT_NAME} 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | ${CONSOLE_LOG_PATTERN} 44 | 45 | 46 | 47 | 48 | 49 | 50 | ${FILE_LOG_PATTERN} 51 | 52 | ${LOG_PATH}/spring-boot.log 53 | 54 | ${LOG_PATH}/spring-boot-%d{yyyy-MM-dd}.%i.log 55 | ${MAX_FILE_SIZE} 56 | ${MAX_HISTORY} 57 | 58 | 59 | 60 | 61 | 62 | 63 | ${FILE_LOG_PATTERN} 64 | 65 | ${LOG_PATH}/spring-boot-error.log 66 | 67 | ${LOG_PATH}/spring-boot-error-%d{yyyy-MM-dd}.%i.log 68 | ${MAX_FILE_SIZE} 69 | ${MAX_HISTORY} 70 | 71 | 72 | ERROR 73 | ACCEPT 74 | DENY 75 | 76 | 77 | 78 | 79 | 80 | 0 81 | 1024 82 | 83 | 84 | 85 | 0 86 | 1024 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /common-lib-web/src/test/java/net/geektop/web/CommonWebApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.geektop.web; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CommonWebApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /common-lib/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'insight.java-application-conventions' 3 | id 'org.springframework.boot' 4 | id 'io.spring.dependency-management' 5 | id 'java' 6 | } 7 | 8 | java { 9 | sourceCompatibility = JavaVersion.VERSION_21 10 | targetCompatibility = JavaVersion.VERSION_21 11 | } 12 | 13 | 14 | dependencies { 15 | implementation 'org.springframework.boot:spring-boot-starter' 16 | 17 | 18 | compileOnly 'org.projectlombok:lombok' 19 | annotationProcessor 'org.projectlombok:lombok' 20 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 21 | 22 | } 23 | 24 | jar.enabled = true 25 | 26 | test { 27 | useJUnitPlatform() 28 | } 29 | -------------------------------------------------------------------------------- /common-lib/src/main/java/net/geektop/common/CommonApplication.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class CommonApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(CommonApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/CommonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | public class CommonApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/aop/LogAspectTest.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.aop; 2 | 3 | import org.springframework.boot.test.context.SpringBootTest; 4 | 5 | import static org.junit.jupiter.api.Assertions.*; 6 | 7 | /** 8 | * @author Alex 9 | * @version V1.0 10 | * @Package net.geektop.common.aop 11 | * @date 2020/1/12 20:34 12 | */ 13 | //@SpringBootTest 14 | public class LogAspectTest { 15 | 16 | } -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/benchmark/SnowflakeBenchmark.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.benchmark; 2 | 3 | /** 4 | * @author Alex 5 | * @version V1.0 6 | * @Package net.geektop.common.benchmark 7 | * @date 2020/11/24 19:23 8 | */ 9 | public class SnowflakeBenchmark { 10 | public static void main(String[] args) { 11 | System.out.println("Hello"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/compress/CompressTest.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.compress; 2 | 3 | import org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry; 4 | import org.apache.commons.compress.archivers.sevenz.SevenZFile; 5 | import org.apache.commons.compress.archivers.sevenz.SevenZOutputFile; 6 | import org.apache.commons.compress.archivers.tar.TarArchiveEntry; 7 | import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; 8 | import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; 9 | import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; 10 | import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream; 11 | import org.apache.commons.io.IOUtils; 12 | import org.junit.jupiter.api.Test; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | import org.springframework.boot.test.context.SpringBootTest; 16 | 17 | import java.io.*; 18 | 19 | /** 20 | * @author Alex 21 | * @version V1.0 22 | * @Package net.geektop.common.compress 23 | * @date 2020/9/4 14:37 24 | */ 25 | @SpringBootTest 26 | class CompressTest { 27 | 28 | private static final Logger logger = LoggerFactory.getLogger(CompressTest.class); 29 | 30 | 31 | @Test 32 | void compressFilesToZIP() { 33 | 34 | } 35 | 36 | @Test 37 | void compressDirToZIP() throws IOException { 38 | String dirPath = "/Users/light/print_20190725"; 39 | 40 | try (FileOutputStream fileOutStream = new FileOutputStream("/Users/light/print_20190725.zip"); 41 | BufferedOutputStream bufferedOutStream = new BufferedOutputStream(fileOutStream); 42 | final ZipArchiveOutputStream zipArchiveOutputStream = new ZipArchiveOutputStream(bufferedOutStream)) { 43 | addFileToZIP(zipArchiveOutputStream, dirPath, ""); 44 | } 45 | } 46 | 47 | 48 | private void addFileToZIP(ZipArchiveOutputStream zipArchiveOutputStream, String path, String base) throws IOException { 49 | final File file = new File(path); 50 | if (!file.exists()) { 51 | return; 52 | } 53 | 54 | final String entryName = base + file.getName(); 55 | final ZipArchiveEntry archiveEntry = new ZipArchiveEntry(file, entryName); 56 | zipArchiveOutputStream.putArchiveEntry(archiveEntry); 57 | if (file.isFile()) { 58 | try (final InputStream in = new BufferedInputStream(new FileInputStream(file))) { 59 | IOUtils.copy(in, zipArchiveOutputStream); 60 | zipArchiveOutputStream.closeArchiveEntry(); 61 | } 62 | } else { 63 | zipArchiveOutputStream.closeArchiveEntry(); 64 | final File[] childFiles = file.listFiles(); 65 | if (childFiles != null) { 66 | for (File child: childFiles) { 67 | addFileToZIP(zipArchiveOutputStream, child.getAbsolutePath(), entryName + "/"); 68 | } 69 | } 70 | } 71 | } 72 | 73 | @Test 74 | void compressDirTo7Z() throws IOException { 75 | String dirPath = "/Users/light/print_20190725"; 76 | 77 | final File archiveSevenZFile = new File("/Users/light/print_20190725.7z"); 78 | try (final SevenZOutputFile sevenZOutputFile = new SevenZOutputFile(archiveSevenZFile)) { 79 | addFileToSevenZ(sevenZOutputFile, dirPath, ""); 80 | } 81 | } 82 | 83 | private void addFileToSevenZ(SevenZOutputFile sevenZOutputFile, String path, String base) throws IOException { 84 | final File file = new File(path); 85 | if (!file.exists()) { 86 | return; 87 | } 88 | 89 | final String entryName = base + file.getName(); 90 | final SevenZArchiveEntry archiveEntry = sevenZOutputFile.createArchiveEntry(file, entryName); 91 | sevenZOutputFile.putArchiveEntry(archiveEntry); 92 | if (file.isFile()) { 93 | final byte[] buffer = new byte[1024]; 94 | int len; 95 | try (final InputStream in = new BufferedInputStream(new FileInputStream(file))) { 96 | while ((len = in.read(buffer)) > 0) { 97 | sevenZOutputFile.write(buffer, 0, len); 98 | } 99 | } 100 | sevenZOutputFile.closeArchiveEntry(); 101 | } else { 102 | sevenZOutputFile.closeArchiveEntry(); 103 | final File[] childFiles = file.listFiles(); 104 | if (childFiles != null) { 105 | for (File child : childFiles) { 106 | addFileToSevenZ(sevenZOutputFile, child.getAbsolutePath(), entryName + "/"); 107 | } 108 | } 109 | } 110 | } 111 | 112 | @Test 113 | void compressFilesTo7Z() { 114 | } 115 | 116 | @Test 117 | void compressFileToXZ() { 118 | } 119 | 120 | @Test 121 | void compressFilesToTarXZ() { 122 | } 123 | 124 | @Test 125 | void compressDirToTarXZ() throws IOException { 126 | String dirPath = "/Users/light/print_20190725"; 127 | 128 | try (FileOutputStream fileOutStream = new FileOutputStream("/Users/light/print_20190725.tar.xz"); 129 | BufferedOutputStream bufferedOutStream = new BufferedOutputStream(fileOutStream); 130 | XZCompressorOutputStream xzCompressorOutputStream = new XZCompressorOutputStream(bufferedOutStream); 131 | TarArchiveOutputStream tarOutStream = new TarArchiveOutputStream(xzCompressorOutputStream)) { 132 | addFileToTar(tarOutStream, dirPath, ""); 133 | } 134 | } 135 | 136 | @Test 137 | void archiveDirToTar() throws IOException { 138 | String dirPath = "/Users/light/print_20190725"; 139 | 140 | try (FileOutputStream fileOutStream = new FileOutputStream("/Users/light/print_20190725.tar"); 141 | BufferedOutputStream bufferedOutStream = new BufferedOutputStream(fileOutStream); 142 | TarArchiveOutputStream tarOutStream = new TarArchiveOutputStream(bufferedOutStream)) { 143 | addFileToTar(tarOutStream, dirPath, ""); 144 | } 145 | } 146 | 147 | private void addFileToTar(TarArchiveOutputStream tarOutStream, String path, String base) throws IOException { 148 | final File file = new File(path); 149 | if (!file.exists()) { 150 | return; 151 | } 152 | 153 | final String entryName = base + file.getName(); 154 | final TarArchiveEntry archiveEntry = new TarArchiveEntry(file, entryName); 155 | tarOutStream.putArchiveEntry(archiveEntry); 156 | if (file.isFile()) { 157 | try (final InputStream in = new BufferedInputStream(new FileInputStream(file))) { 158 | IOUtils.copy(in, tarOutStream); 159 | tarOutStream.closeArchiveEntry(); 160 | } 161 | } else { 162 | tarOutStream.closeArchiveEntry(); 163 | final File[] childFiles = file.listFiles(); 164 | if (childFiles != null) { 165 | for (File child: childFiles) { 166 | addFileToTar(tarOutStream, child.getAbsolutePath(), entryName + "/"); 167 | } 168 | } 169 | } 170 | } 171 | 172 | } 173 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/encryption/DESEncryptionTest.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.encryption; 2 | 3 | import cn.hutool.core.util.CharsetUtil; 4 | import cn.hutool.crypto.symmetric.SymmetricAlgorithm; 5 | import cn.hutool.crypto.symmetric.SymmetricCrypto; 6 | import org.junit.jupiter.api.Test; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | 11 | import java.util.Arrays; 12 | 13 | /** 14 | * @author Alex 15 | * @version V1.0 16 | * @Package net.geektop.common.encryption 17 | * @date 2020/6/15 16:33 18 | */ 19 | @SpringBootTest 20 | public class DESEncryptionTest { 21 | 22 | private static final Logger logger = LoggerFactory.getLogger(DESEncryptionTest.class); 23 | 24 | 25 | @Test 26 | void testEncrypt() { 27 | String content = "dfsdfsdfsd中文fwewerrrerwerwrwerwe"; 28 | 29 | //随机生成密钥 30 | byte[] key = "8kEV4S94X5hlTTTu".getBytes(); 31 | System.out.println(Arrays.toString(key)); 32 | System.out.println(key.length); 33 | 34 | //构建 35 | SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, key); 36 | 37 | //加密 38 | byte[] encrypt = aes.encrypt(content); 39 | //解密 40 | byte[] decrypt = aes.decrypt(encrypt); 41 | 42 | //加密为16进制表示 43 | String encryptHex = aes.encryptHex(content); 44 | System.out.println("encryptHex content: " + encryptHex); 45 | //解密为字符串 46 | String decryptStr = aes.decryptStr(encryptHex, CharsetUtil.CHARSET_UTF_8); 47 | 48 | System.out.println(decryptStr); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/encryption/PGPEncryptHelperTest.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.encryption; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | 7 | /** 8 | * @author Alex 9 | * @version V1.0 10 | * @Package net.geektop.common.encryption 11 | * @date 2020/9/9 18:41 12 | */ 13 | @SpringBootTest 14 | class PGPEncryptHelperTest { 15 | 16 | private static final Logger logger = LoggerFactory.getLogger(PGPEncryptHelperTest.class); 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/excel/WriteExcelTest.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.excel; 2 | 3 | import com.alibaba.excel.EasyExcel; 4 | import com.alibaba.excel.ExcelWriter; 5 | import com.alibaba.excel.metadata.Sheet; 6 | import com.alibaba.excel.support.ExcelTypeEnum; 7 | import org.junit.jupiter.api.Test; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | import java.io.FileOutputStream; 12 | import java.io.IOException; 13 | import java.io.OutputStream; 14 | import java.util.ArrayList; 15 | import java.util.Date; 16 | import java.util.List; 17 | 18 | /** 19 | * @author Alex 20 | * @version V1.0 21 | * @Package net.geektop.common.excel 22 | * @date 2020/2/19 00:53 23 | */ 24 | //@SpringBootTest 25 | public class WriteExcelTest { 26 | 27 | private static final Logger logger = LoggerFactory.getLogger(WriteExcelTest.class); 28 | 29 | @Test 30 | public void writeTest() throws IOException { 31 | try (final OutputStream out = new FileOutputStream("/tmp/withoutHeader.xlsx")) { 32 | final ExcelWriter writer = new ExcelWriter(out, ExcelTypeEnum.XLSX, false); 33 | final Sheet sheet1 = new Sheet(1, 0); 34 | List> data = new ArrayList<>(); 35 | for (int i = 0; i < 100; i++) { 36 | List item = new ArrayList<>(); 37 | item.add("item0" + i); 38 | item.add("item1" + i); 39 | item.add("item2" + i); 40 | data.add(item); 41 | } 42 | writer.write0(data, sheet1); 43 | writer.finish(); 44 | } 45 | } 46 | 47 | @Test 48 | public void writeExcelNew() throws IOException { 49 | String fileName = "/tmp/tt1.xlsx"; 50 | EasyExcel.write(fileName).head(head()).sheet("模板").doWrite(dataList()); 51 | } 52 | 53 | private List> dataList() { 54 | List> list = new ArrayList>(); 55 | for (int i = 0; i < 10; i++) { 56 | List data = new ArrayList(); 57 | data.add("字符串" + i); 58 | data.add(new Date()); 59 | data.add(0.56); 60 | list.add(data); 61 | } 62 | return list; 63 | } 64 | 65 | private List> head() { 66 | List> list = new ArrayList>(); 67 | List head0 = new ArrayList(); 68 | head0.add("字符串" + System.currentTimeMillis()); 69 | List head1 = new ArrayList(); 70 | head1.add("数字" + System.currentTimeMillis()); 71 | List head2 = new ArrayList(); 72 | head2.add("日期" + System.currentTimeMillis()); 73 | list.add(head0); 74 | list.add(head1); 75 | list.add(head2); 76 | return list; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/http/UserAgentTest.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.http; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | import static org.junit.jupiter.api.Assertions.*; 7 | 8 | /** 9 | * @author Alex 10 | * @version V1.0 11 | * @Package net.geektop.common.http 12 | * @date 2020/12/10 01:02 13 | */ 14 | @SpringBootTest 15 | class UserAgentTest { 16 | 17 | @Test 18 | void fake() { 19 | final String fakeAgent = UserAgent.fake(); 20 | assertFalse(fakeAgent.contains("%s")); 21 | assertFalse(fakeAgent.contains("{")); 22 | } 23 | 24 | @Test 25 | void testFake() { 26 | } 27 | 28 | @Test 29 | void fakeMobile() { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/sequence/SequenceUtilTest.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.sequence; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | import static org.junit.jupiter.api.Assertions.*; 8 | 9 | /** 10 | * @author Alex 11 | * @version V1.0 12 | * @Package net.geektop.common.sequence 13 | * @date 2020/11/23 16:36 14 | */ 15 | class SequenceUtilTest { 16 | 17 | private static final Logger logger = LoggerFactory.getLogger(SequenceUtilTest.class); 18 | 19 | @Test 20 | void randomString() { 21 | } 22 | 23 | @Test 24 | void testRandomString() { 25 | } 26 | 27 | @Test 28 | void testRandomString1() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/sequence/SnowflakeImplTest.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.sequence; 2 | 3 | import org.junit.jupiter.api.BeforeAll; 4 | import org.junit.jupiter.api.Test; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | 9 | import java.util.Random; 10 | import java.util.Set; 11 | import java.util.concurrent.ConcurrentHashMap; 12 | 13 | import static org.junit.jupiter.api.Assertions.assertTrue; 14 | 15 | /** 16 | * @author Alex 17 | * @version V1.0 18 | * @Package net.geektop.common.sequence 19 | * @date 2020/11/23 16:30 20 | */ 21 | @SpringBootTest 22 | class SnowflakeImplTest { 23 | 24 | private static final Logger logger = LoggerFactory.getLogger(SnowflakeImplTest.class); 25 | private static SnowflakeImpl snowflake; 26 | 27 | @BeforeAll 28 | public static void init() { 29 | long[] dataCenterIds = new long[]{0, 1, 2, 3}; 30 | int rnd = new Random().nextInt(dataCenterIds.length); 31 | snowflake = new SnowflakeImpl(dataCenterIds[rnd]); 32 | } 33 | 34 | @Test 35 | void nextId() { 36 | final Long aLong = snowflake.nextId(); 37 | logger.info("Get the next long id is: {}", aLong); 38 | } 39 | 40 | @Test 41 | void duplicateTest() throws InterruptedException { 42 | assertTrue(multiThreadDuplicateTest(snowflake)); 43 | } 44 | 45 | @Test 46 | void duplicateClockTest() throws InterruptedException { 47 | final SnowflakeImpl newSnowVersion = new SnowflakeImpl(0, true, false); 48 | assertTrue(multiThreadDuplicateTest(newSnowVersion)); 49 | } 50 | 51 | private boolean multiThreadDuplicateTest(SnowflakeImpl snowflake) throws InterruptedException { 52 | int generateCount = 10000; 53 | final Set idSet = ConcurrentHashMap.newKeySet(); 54 | final Thread t1 = new Thread(() -> addIdToSet(idSet, snowflake, generateCount)); 55 | final Thread t2 = new Thread(() -> addIdToSet(idSet, snowflake, generateCount)); 56 | final Thread t3 = new Thread(() -> addIdToSet(idSet, snowflake, generateCount)); 57 | final Thread t4 = new Thread(() -> addIdToSet(idSet, snowflake, generateCount)); 58 | final long start = System.currentTimeMillis(); 59 | t1.start(); 60 | t2.start(); 61 | t3.start(); 62 | t4.start(); 63 | t1.join(); 64 | t2.join(); 65 | t3.join(); 66 | t4.join(); 67 | final long end = System.currentTimeMillis(); 68 | logger.info("consume time is: {}", end - start); 69 | return idSet.size() == generateCount*4; 70 | } 71 | 72 | private void addIdToSet(Set idSet, SnowflakeImpl snowflake, int generateCount) { 73 | logger.info("start the thread: {}", Thread.currentThread().getName()); 74 | for (int i = 0; i < generateCount; i++) { 75 | final Long aLong = snowflake.nextId(); 76 | idSet.add(aLong); 77 | } 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /common-lib/src/test/java/net/geektop/common/string/StringUtilTest.java: -------------------------------------------------------------------------------- 1 | package net.geektop.common.string; 2 | 3 | import com.google.common.collect.ImmutableMap; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | 10 | import java.util.Map; 11 | import java.util.Random; 12 | 13 | import static org.junit.jupiter.api.Assertions.assertFalse; 14 | import static org.junit.jupiter.api.Assertions.assertTrue; 15 | 16 | /** 17 | * @author Alex 18 | * @version V1.0 19 | * @Package net.geektop.common.string 20 | * @date 2020/11/23 20:36 21 | */ 22 | @SpringBootTest 23 | class StringUtilTest { 24 | 25 | private static final Logger logger = LoggerFactory.getLogger(StringUtilTest.class); 26 | 27 | @Test 28 | void isNotBlank() { 29 | assertFalse(StringUtil.isNotBlank(StringPool.SPACE)); 30 | assertFalse(StringUtil.isNotBlank(StringPool.TAB)); 31 | assertFalse(StringUtil.isNotBlank(StringPool.NEWLINE)); 32 | assertFalse(StringUtil.isNotBlank(StringPool.SPACE + StringPool.NEWLINE + StringPool.TAB)); 33 | assertTrue(StringUtil.isNotBlank(StringPool.SPACE + StringPool.TAB + "abc")); 34 | } 35 | 36 | @Test 37 | void isBlank() { 38 | Map of = ImmutableMap.of( 39 | "aaa", "fff", 40 | "ddd", "345"); 41 | } 42 | 43 | @Test 44 | void isEmpty() { 45 | } 46 | 47 | @Test 48 | void isNotEmpty() { 49 | } 50 | 51 | @Test 52 | void randomString() { 53 | final String s = StringUtil.randomString(new Random().nextLong()); 54 | Assertions.assertTrue(s.length() > 1); 55 | } 56 | 57 | @Test 58 | void testRandomString() { 59 | final String s = StringUtil.randomString(); 60 | Assertions.assertTrue(s.length() > 20); 61 | } 62 | 63 | @Test 64 | void format() { 65 | } 66 | 67 | @Test 68 | void repeat() { 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | springBootVersion=3.3.3 2 | springDependencyManagement=1.1.6 3 | asciidoctorJvmConvert=3.3.2 4 | springCloudVersion=2023.0.3 5 | springCloudAlibabaVersion=2.2.2.RELEASE 6 | projectVersion=0.0.2-SNAPSHOT 7 | javaVersion=21 8 | org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError 9 | org.gradle.parallel=true 10 | org.gradle.caching=true 11 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alexcn/OneStack/0ca76bd53d092b3fe3d59e9666eeec2d4a4c967c/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Stop when "xargs" is not available. 209 | if ! command -v xargs >/dev/null 2>&1 210 | then 211 | die "xargs is not available" 212 | fi 213 | 214 | # Use "xargs" to parse quoted args. 215 | # 216 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 217 | # 218 | # In Bash we could simply go: 219 | # 220 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 221 | # set -- "${ARGS[@]}" "$@" 222 | # 223 | # but POSIX shell has neither arrays nor command substitution, so instead we 224 | # post-process each arg (as a line of input to sed) to backslash-escape any 225 | # character that might be a shell metacharacter, then use eval to reverse 226 | # that process (while maintaining the separation between arguments), and wrap 227 | # the whole thing up as a single "set" statement. 228 | # 229 | # This will of course break if any of these variables contains a newline or 230 | # an unmatched quote. 231 | # 232 | 233 | eval "set -- $( 234 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 235 | xargs -n1 | 236 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 237 | tr '\n' ' ' 238 | )" '"$@"' 239 | 240 | exec "$JAVACMD" "$@" 241 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if %ERRORLEVEL% equ 0 goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if %ERRORLEVEL% equ 0 goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | set EXIT_CODE=%ERRORLEVEL% 84 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 85 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 86 | exit /b %EXIT_CODE% 87 | 88 | :mainEnd 89 | if "%OS%"=="Windows_NT" endlocal 90 | 91 | :omega 92 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'onestack-project' 2 | include(':common-lib') 3 | include(':common-lib-web') 4 | include(':api-gateway') 5 | --------------------------------------------------------------------------------