├── .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