Commit 2dda2170 authored by 赵啸非's avatar 赵啸非

修改配置文件

parent e69f2546
package com.lilosoft.api.controller;
import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.lilosoft.api.api.RobotApi;
import com.lilosoft.api.bean.RobotCaseRecord;
import com.lilosoft.api.service.ApplyService;
import com.lilosoft.core.utils.ObjectUtils;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -17,12 +19,9 @@ import java.util.Date;
import java.util.HashMap;
@Service
@Slf4j
public class MqConsumer {
/**
* 日志对象
*/
public Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private ApplyService applyService;
......@@ -35,6 +34,9 @@ public class MqConsumer {
@JmsListener(destination = "${api.mq}", containerFactory = "jmsListenerContainerQueue")
public void receiveMsg(HashMap<String, String> text) {
log.info("receive msg==>{}", JSONUtil.toJsonStr(text));
RobotCaseRecord caseRecord = new RobotCaseRecord();
caseRecord.setId(IdUtil.simpleUUID());
caseRecord.setContent(text.get("content"));
......@@ -45,7 +47,7 @@ public class MqConsumer {
robotApi.saveRecord(caseRecord);
HashMap<String, Object> entries = JSONUtil.toBean(text.get("content"), HashMap.class);
String apply = applyService.webApply(entries);
if(ObjectUtils.isEmpty(apply)){
if (ObjectUtils.isEmpty(apply)) {
caseRecord.setSendFlag("2");
caseRecord.setMsg("success");
} else {
......@@ -57,7 +59,7 @@ public class MqConsumer {
caseRecord.setSendFlag("1");
caseRecord.setMsg(e.getMessage());
robotApi.saveRecord(caseRecord);
logger.error(e.getMessage());
log.error(e.getMessage());
}
......
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