Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
eb21af58
Commit
eb21af58
authored
Jul 20, 2021
by
hanghang.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切面成功志恒,返回成功编码改为String类型
parent
292dfd0b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
shopping-cart-application-service/src/main/java/cn/freemud/annotations/IgnoreFeignLogAnnotation.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/aop/WebAspect.java
+14
-14
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/ActivityClient.java
+1
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/annotations/IgnoreFeignLogAnnotation.java
View file @
eb21af58
...
...
@@ -20,7 +20,7 @@ public @interface IgnoreFeignLogAnnotation {
*
* @return
*/
int
[]
excludeStatusCodes
()
default
0
;
String
[]
excludeStatusCodes
()
default
"100"
;
String
statusCodeFieldName
()
default
"code"
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/aop/WebAspect.java
View file @
eb21af58
...
...
@@ -236,7 +236,7 @@ public class WebAspect {
if
(!
this
.
printFeignResponseBodyLog
||
logIgnore
.
printLog
())
{
//todo 当排除了这个状态码不打印响应的具体内容只会打印状态码和状态描述信息
int
[]
excludeStatusCodes
=
logIgnore
.
excludeStatusCodes
();
String
[]
excludeStatusCodes
=
logIgnore
.
excludeStatusCodes
();
if
(!
StringUtils
.
isEmpty
(
statusCodeValue
)
&&
this
.
containStatusCode
(
excludeStatusCodes
,
statusCodeValue
))
{
logReult
=
result
.
getClass
().
newInstance
();
org
.
apache
.
commons
.
beanutils
.
BeanUtils
.
setProperty
(
logReult
,
logIgnore
.
statusCodeFieldName
(),
statusCodeValue
);
...
...
@@ -324,7 +324,7 @@ public class WebAspect {
return
notFilterUrl
;
}
/*
private boolean containStatusCode(String[] excludeStatusCodes,
private
boolean
containStatusCode
(
String
[]
excludeStatusCodes
,
String
statusCodeValue
)
{
if
(
excludeStatusCodes
==
null
||
excludeStatusCodes
.
length
==
0
)
{
return
false
;
...
...
@@ -335,18 +335,18 @@ public class WebAspect {
}
}
return
false
;
}*/
private
boolean
containStatusCode
(
int
[]
excludeStatusCodes
,
String
statusCodeValue
)
{
if
(
excludeStatusCodes
==
null
||
excludeStatusCodes
.
length
==
0
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
excludeStatusCodes
.
length
;
i
++)
{
if
(
excludeStatusCodes
[
i
]
==
Integer
.
valueOf
(
statusCodeValue
))
{
return
true
;
}
}
return
false
;
}
// private boolean containStatusCode(int[] excludeStatusCodes, String statusCodeValue) {
// if (excludeStatusCodes == null || excludeStatusCodes.length == 0) {
// return false;
// }
// for (int i = 0; i < excludeStatusCodes.length; i++) {
// if (excludeStatusCodes[i] == Integer.valueOf(statusCodeValue)) {
// return true;
// }
// }
// return false;
// }
}
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/ActivityClient.java
View file @
eb21af58
...
...
@@ -30,7 +30,7 @@ public interface ActivityClient {
* 统一活动查询接口
*/
@PostMapping
(
"/activity/query"
)
//
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MSG)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
ActivityQueryResponseDto
query
(
ActivityQueryRequestDto
activityQueryRequestDto
);
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment