feat(REQ-3114) - MQ 转发的钉钉消息增加环境标识

This commit is contained in:
wangli 2024-10-28 17:41:44 +08:00
parent c2ea87f894
commit 7312f9cf4e
2 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import java.io.Serializable;
public class DingtalkReceiveMqModel implements Serializable {
private final static long serialVersionUID = 1L;
private String traceId;
private String activeProfile;
/**
* 会话 ID

View File

@ -14,6 +14,7 @@ import cn.axzo.riven.dingtalk.repository.entity.ThirdDingtalkConversation;
import cn.axzo.riven.dingtalk.service.ThirdDingtalkConversationService;
import com.dingtalk.open.app.api.models.bot.ChatbotMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
@ -36,6 +37,8 @@ import java.util.stream.Collectors;
public class TransferToMQStrategy extends AbstractRobotHandleStrategy {
@Resource
private RocketMQEventProducer producer;
@Value("${spring.profiles.active}")
private String activeProfile;
@Resource
private ThirdDingtalkConversationService thirdDingtalkConversationService;
private final Map</*会话 ID*/String, ThirdDingtalkConversation> conversationMap = new HashMap<>();
@ -68,6 +71,7 @@ public class TransferToMQStrategy extends AbstractRobotHandleStrategy {
}
DingtalkReceiveMqModel model = new DingtalkReceiveMqModel();
model.setActiveProfile(activeProfile);
model.setTraceId(messageQueue.getTraceId());
model.setConversationId(chatbotMessage.getConversationId());
model.setMsgId(chatbotMessage.getMsgId());