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
a6d551eb
Commit
a6d551eb
authored
Mar 17, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改公式和计算帮助类
parent
dc1c8e38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
BaseRequestAspect.java
...ain/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
+21
-1
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
View file @
a6d551eb
package
com
.
yanzuoguang
.
cloud
.
aop
;
import
com.alibaba.fastjson.JSON
;
import
com.rabbitmq.client.Channel
;
import
com.yanzuoguang.util.contants.ResultConstants
;
import
com.yanzuoguang.util.exception.ExceptionHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
...
...
@@ -12,7 +13,6 @@ import org.aspectj.lang.ProceedingJoinPoint;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.amqp.core.Message
;
import
com.rabbitmq.client.Channel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
@@ -149,6 +149,21 @@ public class BaseRequestAspect {
return
para
;
}
/**
* 根据类型获取对象
*
* @param args
* @return
*/
protected
Message
getMessage
(
Object
[]
args
)
{
for
(
Object
item
:
args
)
{
if
(
item
instanceof
Message
)
{
return
(
Message
)
item
;
}
}
return
null
;
}
/**
* 获取JSON,当Json过长时,截断
*
...
...
@@ -285,6 +300,11 @@ public class BaseRequestAspect {
GetMapping
[]
gets
=
targetMethod
.
getAnnotationsByType
(
GetMapping
.
class
);
url
=
getFeignUrl
(
feignClient
,
classRequests
,
classPosts
,
classGets
,
requests
,
posts
,
gets
);
}
else
{
Message
message
=
getMessage
(
joinPoint
.
getArgs
());
if
(
message
!=
null
)
{
url
=
message
.
getMessageProperties
().
getConsumerQueue
();
}
}
if
(
StringHelper
.
isEmpty
(
url
))
{
...
...
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