Skip to content

Commit 34e6217

Browse files
author
geekidea
committed
spring-boot-plus 2.0-SNAPSHOT
1 parent 340eeb0 commit 34e6217

File tree

321 files changed

+6795
-4162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

321 files changed

+6795
-4162
lines changed

CHANGELOG_TODO.md

-31
This file was deleted.

CODE_OF_CONDUCT.md

-78
This file was deleted.

CONTRIBUTING.md

-3
This file was deleted.

NOTICE

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
GEEKIDEA Spring-Boot-Plus
2+
Copyright 2019-2029 The Apache Software Foundation
3+
4+
This product includes software developed at
5+
The GEEKIDEA Organization (http://geekidea.io/).

bootstrap/.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/target/
2+
/classes
3+
!.mvn/wrapper/maven-wrapper.jar
4+
5+
### STS ###
6+
.apt_generated
7+
.classpath
8+
.factorypath
9+
.project
10+
.settings
11+
.springBeans
12+
.sts4-cache
13+
14+
### IntelliJ IDEA ###
15+
.idea
16+
*.iws
17+
*.iml
18+
*.ipr
19+
20+
### NetBeans ###
21+
/nbproject/private/
22+
/build/
23+
/nbbuild/
24+
/dist/
25+
/nbdist/
26+
/.nb-gradle/
27+
28+
.DS_Store
29+
30+
*.log
31+
logs
32+
33+
*.rdb
34+
35+
36+

bootstrap/pom.xml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2019-2029 geekidea(https://github.com/geekidea)
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~ http://www.apache.org/licenses/LICENSE-2.0
8+
~ Unless required by applicable law or agreed to in writing, software
9+
~ distributed under the License is distributed on an "AS IS" BASIS,
10+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
~ See the License for the specific language governing permissions and
12+
~ limitations under the License.
13+
-->
14+
15+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
16+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
17+
<modelVersion>4.0.0</modelVersion>
18+
19+
<parent>
20+
<groupId>io.geekidea.springbootplus</groupId>
21+
<artifactId>parent</artifactId>
22+
<version>2.0-SNAPSHOT</version>
23+
</parent>
24+
25+
<groupId>io.geekidea.springbootplus</groupId>
26+
<artifactId>bootstrap</artifactId>
27+
<version>2.0-SNAPSHOT</version>
28+
<name>bootstrap</name>
29+
<description>项目启动模块</description>
30+
31+
<dependencies>
32+
<!-- spring boot admin start -->
33+
<dependency>
34+
<groupId>de.codecentric</groupId>
35+
<artifactId>spring-boot-admin-starter-server</artifactId>
36+
<version>${spring-boot-admin.version}</version>
37+
<exclusions>
38+
<exclusion>
39+
<groupId>de.codecentric</groupId>
40+
<artifactId>spring-boot-admin-server-cloud</artifactId>
41+
</exclusion>
42+
</exclusions>
43+
</dependency>
44+
<dependency>
45+
<groupId>de.codecentric</groupId>
46+
<artifactId>spring-boot-admin-starter-client</artifactId>
47+
<version>${spring-boot-admin.version}</version>
48+
</dependency>
49+
<!-- spring boot admin end -->
50+
<dependency>
51+
<groupId>io.geekidea.springbootplus</groupId>
52+
<artifactId>framework</artifactId>
53+
<version>2.0-SNAPSHOT</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>io.geekidea.springbootplus</groupId>
57+
<artifactId>generator</artifactId>
58+
<version>2.0-SNAPSHOT</version>
59+
<scope>provided</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>io.geekidea.springbootplus</groupId>
63+
<artifactId>example</artifactId>
64+
<version>2.0-SNAPSHOT</version>
65+
</dependency>
66+
</dependencies>
67+
68+
<build>
69+
<plugins>
70+
<plugin>
71+
<groupId>org.springframework.boot</groupId>
72+
<artifactId>spring-boot-maven-plugin</artifactId>
73+
<version>${spring-boot.version}</version>
74+
<executions>
75+
<execution>
76+
<goals>
77+
<goal>repackage</goal>
78+
</goals>
79+
</execution>
80+
</executions>
81+
</plugin>
82+
</plugins>
83+
</build>
84+
85+
86+
</project>

src/main/java/io/geekidea/springbootplus/SpringBootPlusApplication.java renamed to bootstrap/src/main/java/io/geekidea/springbootplus/SpringBootPlusApplication.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
package io.geekidea.springbootplus;/*
1+
/*
22
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
3-
*
43
* Licensed under the Apache License, Version 2.0 (the "License");
54
* you may not use this file except in compliance with the License.
65
* You may obtain a copy of the License at
7-
*
86
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
107
* Unless required by applicable law or agreed to in writing, software
118
* distributed under the License is distributed on an "AS IS" BASIS,
129
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1310
* See the License for the specific language governing permissions and
1411
* limitations under the License.
1512
*/
1613

14+
package io.geekidea.springbootplus;
15+
1716
import de.codecentric.boot.admin.server.config.EnableAdminServer;
1817
import io.geekidea.springbootplus.framework.util.PrintApplicationInfo;
1918
import org.mybatis.spring.annotation.MapperScan;
@@ -22,10 +21,10 @@
2221
import org.springframework.boot.context.properties.EnableConfigurationProperties;
2322
import org.springframework.boot.web.servlet.ServletComponentScan;
2423
import org.springframework.context.ConfigurableApplicationContext;
25-
import org.springframework.context.annotation.ComponentScan;
2624
import org.springframework.scheduling.annotation.EnableAsync;
2725
import org.springframework.scheduling.annotation.EnableScheduling;
2826
import org.springframework.transaction.annotation.EnableTransactionManagement;
27+
import springfox.documentation.swagger2.annotations.EnableSwagger2;
2928

3029

3130
/**
@@ -37,8 +36,9 @@
3736
@EnableScheduling
3837
@EnableTransactionManagement
3938
@EnableConfigurationProperties
39+
@EnableSwagger2
4040
@EnableAdminServer
41-
@MapperScan({"io.geekidea.springbootplus.**.mapper"})
41+
@MapperScan({"io.geekidea.springbootplus.**.mapper","com.example.**.mapper"})
4242
@ServletComponentScan
4343
@SpringBootApplication(scanBasePackages = {"io.geekidea.springbootplus","com.example"})
4444
public class SpringBootPlusApplication {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*/
13+
14+
package io.geekidea.springbootplus.aop;
15+
16+
import io.geekidea.springbootplus.framework.common.exception.SpringBootPlusException;
17+
import io.geekidea.springbootplus.framework.log.aop.BaseLogAop;
18+
import io.geekidea.springbootplus.framework.log.bean.OperationLogInfo;
19+
import io.geekidea.springbootplus.framework.log.bean.RequestInfo;
20+
import lombok.extern.slf4j.Slf4j;
21+
import org.aspectj.lang.JoinPoint;
22+
import org.aspectj.lang.ProceedingJoinPoint;
23+
import org.aspectj.lang.annotation.After;
24+
import org.aspectj.lang.annotation.AfterThrowing;
25+
import org.aspectj.lang.annotation.Around;
26+
import org.aspectj.lang.annotation.Aspect;
27+
import org.springframework.stereotype.Component;
28+
29+
/**
30+
* <p>
31+
* Controller Aop
32+
* 获取响应结果信息
33+
* </p>
34+
*
35+
* @author geekidea
36+
* @date 2019-10-23
37+
*/
38+
@Slf4j
39+
@Aspect
40+
@Component
41+
public class LogAop extends BaseLogAop {
42+
43+
/**
44+
* 切点
45+
*/
46+
private static final String POINTCUT =
47+
"execution(public * io.geekidea.springbootplus..*.controller..*.*(..)) || " +
48+
"execution(public * com.example..*.controller..*.*(..))";
49+
50+
@Around(POINTCUT)
51+
@Override
52+
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
53+
return super.handle(joinPoint);
54+
}
55+
56+
@AfterThrowing(pointcut = POINTCUT, throwing = "exception")
57+
public void afterThrowing(JoinPoint joinPoint, Exception exception) {
58+
super.handleAfterThrowing(exception);
59+
}
60+
61+
@Override
62+
protected void getRequestInfo(RequestInfo requestInfo) {
63+
// 处理请求参数日志
64+
super.handleRequestInfo(requestInfo);
65+
}
66+
67+
@Override
68+
protected void getResponseResult(Object result) {
69+
// 处理响应结果日志
70+
super.handleResponseResult(result);
71+
}
72+
73+
@Override
74+
protected void finish(RequestInfo requestInfo, OperationLogInfo operationLogInfo, Object result, Exception exception) {
75+
// 异步保存日志
76+
super.saveSysOperationLog(requestInfo, operationLogInfo, result, exception);
77+
}
78+
79+
80+
}

0 commit comments

Comments
 (0)