feat: cb message eventName
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user