feat: PlatformChannel 支持 AdapterID/AdapterName — 多账号全链路区分
- PlatformChannel 新增 AdapterID + AdapterName 字段 - AddOrUpdatePlatformChannel 接受 adapter 信息参数 - channel_sync 传递 adapter_id/adapter_name - 消息处理路径传递 adapter_name Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,8 @@ func doSync(thinker *background.Thinker, client *http.Client, baseURL, token str
|
||||
ChannelType string `json:"channel_type"`
|
||||
ChannelID string `json:"channel_id"`
|
||||
ChannelName string `json:"channel_name,omitempty"`
|
||||
AdapterID string `json:"adapter_id,omitempty"`
|
||||
AdapterName string `json:"adapter_name,omitempty"`
|
||||
} `json:"channels"`
|
||||
}
|
||||
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
|
||||
@@ -56,7 +58,7 @@ func doSync(thinker *background.Thinker, client *http.Client, baseURL, token str
|
||||
}
|
||||
|
||||
for _, ch := range result.Channels {
|
||||
thinker.AddOrUpdatePlatformChannel(ch.Platform, ch.ChannelType, ch.ChannelID, ch.ChannelName)
|
||||
thinker.AddOrUpdatePlatformChannel(ch.Platform, ch.ChannelType, ch.ChannelID, ch.ChannelName, ch.AdapterID, ch.AdapterName)
|
||||
}
|
||||
|
||||
// Also fetch platforms to get bot UIDs.
|
||||
|
||||
Reference in New Issue
Block a user