Commit a6d551eb authored by yanzg's avatar yanzg

修改公式和计算帮助类

parent dc1c8e38
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)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment