Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
597af8c2
Commit
597af8c2
authored
Mar 23, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不记录系统日志
parent
6bc18684
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
25 deletions
+33
-25
ArrayHelper.java
...rc/main/java/com/yanzuoguang/util/helper/ArrayHelper.java
+24
-0
BaseRequestAspect.java
...ain/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
+9
-25
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/ArrayHelper.java
View file @
597af8c2
...
@@ -87,6 +87,30 @@ public class ArrayHelper {
...
@@ -87,6 +87,30 @@ public class ArrayHelper {
return
list
;
return
list
;
}
}
/**
* 将数组添加到列表中
*
* @param from
* @param <T>
*/
public
static
final
<
T
extends
Object
>
List
<
T
>
mergeList
(
T
[]...
from
)
{
List
<
T
>
list
=
new
ArrayList
<>();
addList
(
list
,
from
);
return
list
;
}
/**
* 将数组添加到列表中
*
* @param from
* @param <T>
*/
public
static
final
<
T
extends
Object
>
List
<
T
>
mergeList
(
List
<
T
>...
from
)
{
List
<
T
>
list
=
new
ArrayList
<>();
addList
(
list
,
from
);
return
list
;
}
/**
/**
* 将数组添加到列表中
* 将数组添加到列表中
*
*
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
View file @
597af8c2
...
@@ -300,37 +300,21 @@ public class BaseRequestAspect {
...
@@ -300,37 +300,21 @@ public class BaseRequestAspect {
if
(
feignClient
!=
null
)
{
if
(
feignClient
!=
null
)
{
sb
.
append
(
feignClient
.
value
());
sb
.
append
(
feignClient
.
value
());
}
}
if
(
classRequests
!=
null
)
{
List
<
RequestMapping
>
reqList
=
ArrayHelper
.
mergeList
(
classRequests
,
requests
);
for
(
RequestMapping
item
:
classRequests
)
{
List
<
PostMapping
>
postList
=
ArrayHelper
.
mergeList
(
classPosts
,
posts
);
List
<
GetMapping
>
getList
=
ArrayHelper
.
mergeList
(
classGets
,
gets
);
for
(
RequestMapping
item
:
reqList
)
{
if
(
item
.
value
()
!=
null
&&
item
.
value
().
length
>
0
)
{
sb
.
append
(
item
.
value
()[
0
]);
sb
.
append
(
item
.
value
()[
0
]);
}
}
}
}
if
(
classPosts
!=
null
)
{
for
(
PostMapping
item
:
postList
)
{
for
(
PostMapping
item
:
classPosts
)
{
if
(
item
.
value
()
!=
null
&&
item
.
value
().
length
>
0
)
{
sb
.
append
(
item
.
value
()[
0
]);
sb
.
append
(
item
.
value
()[
0
]);
}
}
}
}
for
(
GetMapping
item
:
getList
)
{
if
(
classGets
!=
null
)
{
if
(
item
.
value
()
!=
null
&&
item
.
value
().
length
>
0
)
{
for
(
GetMapping
item
:
classGets
)
{
sb
.
append
(
item
.
value
()[
0
]);
}
}
if
(
requests
!=
null
)
{
for
(
RequestMapping
item
:
requests
)
{
sb
.
append
(
item
.
value
()[
0
]);
}
}
if
(
posts
!=
null
)
{
for
(
PostMapping
item
:
posts
)
{
sb
.
append
(
item
.
value
()[
0
]);
}
}
if
(
gets
!=
null
)
{
for
(
GetMapping
item
:
gets
)
{
sb
.
append
(
item
.
value
()[
0
]);
sb
.
append
(
item
.
value
()[
0
]);
}
}
}
}
...
...
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