feat: cb message eventName

This commit is contained in:
zhangsz
2025-07-08 14:46:32 +08:00
parent 8d76d68b96
commit a7a4efdcb2

View File

@@ -372,18 +372,8 @@ func (s *CBMessageService) sendDeactivateRequest(msg CBMessage) error {
// 提取eventName (从messageJson中获取如果没有eventName字段可能需要从其他地方获取)
eventName, ok := messageData["eventName"].(string)
if !ok {
// 如果messageJson中没有eventName尝试从messageIdProfile中获取
if messageIdProfile, exists := messageData["messageIdProfile"]; exists {
if profile, ok := messageIdProfile.(map[string]interface{}); ok {
if msgId, exists := profile["messageId"]; exists {
eventName = fmt.Sprintf("message_%v", msgId)
}
}
}
if eventName == "" {
return fmt.Errorf("eventName not found in message_json")
}
if !ok || eventName == "" {
return fmt.Errorf("eventName not found in message_json")
}
// 构造删除请求的payload只包含messageIdProfile和warningAreaList