Skip to content

Commit e67285b

Browse files
committed
Merge branch 'dev'
2 parents 0f086a4 + 4151ea5 commit e67285b

File tree

226 files changed

+2725
-10446
lines changed

Some content is hidden

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

226 files changed

+2725
-10446
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<p align="center">
66
<img src="https://img.shields.io/badge/Pig-2.8-success.svg" alt="Build Status">
77
<img src="https://img.shields.io/badge/Avue-2.6-green.svg" alt="Build Status">
8-
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxto.SR5-blue.svg" alt="Coverage Status">
8+
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxto.SR6-blue.svg" alt="Coverage Status">
99
<img src="https://img.shields.io/badge/Spring%20Boot-2.3.RELEASE-blue.svg" alt="Downloads">
1010
</p>
1111

@@ -36,12 +36,13 @@
3636

3737
dependencies | version
3838
---|---
39-
Spring Boot | 2.3.1.RELEASE
40-
Spring Cloud | Hoxton.SR5
39+
Spring Boot | 2.3.2.RELEASE
40+
Spring Cloud | Hoxton.SR6
41+
Spring Cloud Alibaba | 2.2.1.RELEASE
4142
Spring Security OAuth2 | 2.3.6
4243
Mybatis Plus | 3.3.2
43-
hutool | 5.3.8
44-
Avue | 2.6.5
44+
hutool | 5.3.10
45+
Avue | 2.6.14
4546

4647

4748

@@ -76,7 +77,7 @@ pig
7677

7778
2. Welcome to submit [issue](https://gitee.com/log4j/pig/issues),Please clearly write down the cause of the problem, the development environment, and the steps to reproduce.
7879

79-
3. mail: <a href="mailto:pig4cloud@qq.com">pig4cloud@qq.com</a> | <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=3130998334&site=qq&menu=yes"> QQ: 3130998334</a>
80+
3. mail: <a href="mailto:pig4cloud@qq.com">pig4cloud@qq.com</a>
8081

8182
#### Free Class
8283

README.zh.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<p align="center">
55
<img src="https://img.shields.io/badge/Pig-2.8-success.svg" alt="Build Status">
66
<img src="https://img.shields.io/badge/Avue-2.6-green.svg" alt="Build Status">
7-
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxto.SR5-blue.svg" alt="Coverage Status">
7+
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxto.SR6-blue.svg" alt="Coverage Status">
88
<img src="https://img.shields.io/badge/Spring%20Boot-2.3.RELEASE-blue.svg" alt="Downloads">
99
</p>
1010

@@ -35,12 +35,13 @@
3535

3636
依赖 | 版本
3737
---|---
38-
Spring Boot | 2.3.1.RELEASE
39-
Spring Cloud | Hoxton.SR5
38+
Spring Boot | 2.3.2.RELEASE
39+
Spring Cloud | Hoxton.SR6
40+
Spring Cloud Alibaba | 2.2.1.RELEASE
4041
Spring Security OAuth2 | 2.3.6
4142
Mybatis Plus | 3.3.2
42-
hutool | 5.3.8
43-
Avue | 2.6.3
43+
hutool | 5.3.10
44+
Avue | 2.6.14
4445

4546

4647

@@ -76,7 +77,7 @@ pig
7677

7778
3. 不接受`功能请求`[issue](https://gitee.com/log4j/pig/issues),功能请求可能会被直接关闭。
7879

79-
4. mail: <a href="mailto:pig4cloud@qq.com">pig4cloud@qq.com</a> | <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=3130998334&site=qq&menu=yes"> QQ: 3130998334</a>
80+
4. mail: <a href="mailto:pig4cloud@qq.com">pig4cloud@qq.com</a>
8081

8182
#### 免费公开课
8283

pig-auth/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>com.pig4cloud</groupId>
2525
<artifactId>pig</artifactId>
26-
<version>2.8.0</version>
26+
<version>2.8.1</version>
2727
</parent>
2828

2929
<artifactId>pig-auth</artifactId>
@@ -46,19 +46,19 @@
4646
<dependency>
4747
<groupId>com.pig4cloud</groupId>
4848
<artifactId>pig-common-sentinel</artifactId>
49-
<version>2.8.0</version>
49+
<version>2.8.1</version>
5050
</dependency>
5151
<!--upms api、model 模块-->
5252
<dependency>
5353
<groupId>com.pig4cloud</groupId>
5454
<artifactId>pig-upms-api</artifactId>
55-
<version>2.8.0</version>
55+
<version>2.8.1</version>
5656
</dependency>
5757
<!--security-->
5858
<dependency>
5959
<groupId>com.pig4cloud</groupId>
6060
<artifactId>pig-common-security</artifactId>
61-
<version>2.8.0</version>
61+
<version>2.8.1</version>
6262
</dependency>
6363
<!--JDBC相关-->
6464
<dependency>

pig-common/pig-common-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>com.pig4cloud</groupId>
2525
<artifactId>pig-common</artifactId>
26-
<version>2.8.0</version>
26+
<version>2.8.1</version>
2727
</parent>
2828

2929
<artifactId>pig-common-core</artifactId>

pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/SecurityConstants.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,9 @@ public interface SecurityConstants {
111111
*/
112112
String DETAILS_LICENSE = "license";
113113

114+
/**
115+
* 验证码有效期,默认 60秒
116+
*/
117+
long CODE_TIME = 60;
118+
114119
}

pig-common/pig-common-datasource/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<artifactId>pig-common</artifactId>
2525
<groupId>com.pig4cloud</groupId>
26-
<version>2.8.0</version>
26+
<version>2.8.1</version>
2727
</parent>
2828
<modelVersion>4.0.0</modelVersion>
2929

pig-common/pig-common-log/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>com.pig4cloud</groupId>
2525
<artifactId>pig-common</artifactId>
26-
<version>2.8.0</version>
26+
<version>2.8.1</version>
2727
</parent>
2828

2929
<artifactId>pig-common-log</artifactId>
@@ -37,13 +37,13 @@
3737
<dependency>
3838
<groupId>com.pig4cloud</groupId>
3939
<artifactId>pig-common-core</artifactId>
40-
<version>2.8.0</version>
40+
<version>2.8.1</version>
4141
</dependency>
4242
<!--UPMS接口模块-->
4343
<dependency>
4444
<groupId>com.pig4cloud</groupId>
4545
<artifactId>pig-upms-api</artifactId>
46-
<version>2.8.0</version>
46+
<version>2.8.1</version>
4747
</dependency>
4848
<!--安全依赖获取上下文信息-->
4949
<dependency>

pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/aspect/SysLogAspect.java

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818

1919
package com.pig4cloud.pig.common.log.aspect;
2020

21+
import com.pig4cloud.pig.admin.api.entity.SysLog;
2122
import com.pig4cloud.pig.common.core.util.SpringContextHolder;
22-
import com.pig4cloud.pig.common.log.annotation.SysLog;
2323
import com.pig4cloud.pig.common.log.event.SysLogEvent;
24+
import com.pig4cloud.pig.common.log.util.LogTypeEnum;
2425
import com.pig4cloud.pig.common.log.util.SysLogUtils;
2526
import lombok.SneakyThrows;
2627
import lombok.extern.slf4j.Slf4j;
@@ -39,19 +40,32 @@ public class SysLogAspect {
3940

4041
@Around("@annotation(sysLog)")
4142
@SneakyThrows
42-
public Object around(ProceedingJoinPoint point, SysLog sysLog) {
43+
public Object around(ProceedingJoinPoint point, com.pig4cloud.pig.common.log.annotation.SysLog sysLog) {
4344
String strClassName = point.getTarget().getClass().getName();
4445
String strMethodName = point.getSignature().getName();
4546
log.debug("[类名]:{},[方法]:{}", strClassName, strMethodName);
4647

47-
com.pig4cloud.pig.admin.api.entity.SysLog logVo = SysLogUtils.getSysLog();
48+
SysLog logVo = SysLogUtils.getSysLog();
4849
logVo.setTitle(sysLog.value());
50+
4951
// 发送异步日志事件
5052
Long startTime = System.currentTimeMillis();
51-
Object obj = point.proceed();
52-
Long endTime = System.currentTimeMillis();
53-
logVo.setTime(endTime - startTime);
54-
SpringContextHolder.publishEvent(new SysLogEvent(logVo));
53+
Object obj;
54+
55+
try {
56+
obj = point.proceed();
57+
}
58+
catch (Exception e) {
59+
logVo.setType(LogTypeEnum.ERROR.getType());
60+
logVo.setException(e.getMessage());
61+
throw e;
62+
}
63+
finally {
64+
Long endTime = System.currentTimeMillis();
65+
logVo.setTime(endTime - startTime);
66+
SpringContextHolder.publishEvent(new SysLogEvent(logVo));
67+
}
68+
5569
return obj;
5670
}
5771

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.pig4cloud.pig.common.log.util;
2+
3+
import lombok.Getter;
4+
import lombok.RequiredArgsConstructor;
5+
6+
/**
7+
* @author lengleng
8+
* @date 2020/7/30
9+
* <p>
10+
* 日志类型
11+
*/
12+
@Getter
13+
@RequiredArgsConstructor
14+
public enum LogTypeEnum {
15+
16+
/**
17+
* 正常日志类型
18+
*/
19+
NORMAL("0", "正常日志"),
20+
21+
/**
22+
* 错误日志类型
23+
*/
24+
ERROR("9", "错误日志");
25+
26+
/**
27+
* 类型
28+
*/
29+
private final String type;
30+
31+
/**
32+
* 描述
33+
*/
34+
private final String description;
35+
36+
}

pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/util/SysLogUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import cn.hutool.extra.servlet.ServletUtil;
2323
import cn.hutool.http.HttpUtil;
2424
import com.pig4cloud.pig.admin.api.entity.SysLog;
25-
import com.pig4cloud.pig.common.core.constant.CommonConstants;
2625
import lombok.experimental.UtilityClass;
2726
import org.springframework.security.core.Authentication;
2827
import org.springframework.security.core.context.SecurityContextHolder;
@@ -46,7 +45,7 @@ public SysLog getSysLog() {
4645
.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
4746
SysLog sysLog = new SysLog();
4847
sysLog.setCreateBy(Objects.requireNonNull(getUsername()));
49-
sysLog.setType(CommonConstants.STATUS_NORMAL);
48+
sysLog.setType(LogTypeEnum.NORMAL.getType());
5049
sysLog.setRemoteAddr(ServletUtil.getClientIP(request));
5150
sysLog.setRequestUri(URLUtil.getPath(request.getRequestURI()));
5251
sysLog.setMethod(request.getMethod());

0 commit comments

Comments
 (0)