|
|
@ -7,7 +7,6 @@ import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.dto.form.mq.EventClassDto; |
|
|
|
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; |
|
|
|
import com.epmet.commons.tools.dto.form.mq.MqReturnBaseResult; |
|
|
|
import com.epmet.commons.tools.enums.EnvEnum; |
|
|
|
import com.epmet.commons.tools.enums.MqMethodPathEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.ValidateException; |
|
|
@ -40,7 +39,7 @@ public class SendMqMsgUtils { |
|
|
|
if (mqConfig == null) { |
|
|
|
mqConfig = SpringContextUtils.getBean(MqConfig.class); |
|
|
|
} |
|
|
|
log.debug("sendMsg param:{}", JSON.toJSONString(msg)); |
|
|
|
log.info("sendMsg param:{}", JSON.toJSONString(msg)); |
|
|
|
try { |
|
|
|
// TODO
|
|
|
|
ValidatorUtils.validateEntity(msg, DefaultGroup.class); |
|
|
@ -52,7 +51,7 @@ public class SendMqMsgUtils { |
|
|
|
msg.setToken(mqConfig.getToken()); |
|
|
|
try { |
|
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByHttps(msg.getRequestUrl(), JSON.toJSONString(msg)); |
|
|
|
log.debug("sendMsg result:{}", JSON.toJSONString(result)); |
|
|
|
log.info("sendMsg result:{}", JSON.toJSONString(result)); |
|
|
|
if (result.success()) { |
|
|
|
MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); |
|
|
|
if (resultResult.getErrCode().equals(NumConstant.ZERO)) { |
|
|
@ -68,7 +67,7 @@ public class SendMqMsgUtils { |
|
|
|
resultResult.setInternalMsg(result.getInternalMsg()); |
|
|
|
return resultResult; |
|
|
|
} catch (Exception e) { |
|
|
|
log.debug("sendMsg exception", e); |
|
|
|
log.error("sendMsg exception", e); |
|
|
|
return new Result<String>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); |
|
|
|
} |
|
|
|
} |
|
|
@ -90,7 +89,7 @@ public class SendMqMsgUtils { |
|
|
|
|
|
|
|
try { |
|
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByHttps(requestUrl, JSON.toJSONString(param)); |
|
|
|
log.debug("getEventClassList result:{}", JSON.toJSONString(result)); |
|
|
|
log.info("getEventClassList result:{}", JSON.toJSONString(result)); |
|
|
|
if (result.success()) { |
|
|
|
MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); |
|
|
|
if (resultResult.getErrCode().equals(NumConstant.ZERO)) { |
|
|
@ -106,7 +105,7 @@ public class SendMqMsgUtils { |
|
|
|
resultResult.setInternalMsg(result.getInternalMsg()); |
|
|
|
return resultResult; |
|
|
|
} catch (Exception e) { |
|
|
|
log.debug("sendMsg exception", e); |
|
|
|
log.error("sendMsg exception", e); |
|
|
|
return new Result<List<EventClassDto>>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); |
|
|
|
} |
|
|
|
} |
|
|
|