WeComInboundMapper
public final class WeComInboundMapper
io/agentscope/extensions/channel/wecom/WeComInboundMapper.java:50–204WeCom 入站 Mapper,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.wecom 包。核心成员包括 map、extractMsgId、WeComInboundMapper。
Parses a decrypted WeCom callback XML body into an InboundMessage.
Text messages (MsgType=text, single-user app message) map to their content. Media
messages (MsgType image / voice / video) map to a neutral
marker text plus the ChannelMediaMetadata contract: the provider material identifiers
are preserved verbatim and decoding them (a token-authenticated media/get exchange,
valid for three days) is left to the application. Other inbound types (event, location, link,
...) are returned as Optional#empty() so the caller can ack the webhook without
dispatching to the agent.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public WeComInboundMapper(String channelId, String accountId) | 初始化 `WeComInboundMapper` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Optional<InboundMessage> map(String xml) | 构建`InboundMessage`来自已解密 WeCom 消息 XML。 Builds an `InboundMessage` from a decrypted WeCom message XML. |
public static Optional<String> extractMsgId(String xml)static | 设置该参数。 Returns the `MsgId` field if present, used by the idempotency store. |
构造器详情Constructor Detail
WeComInboundMapper
public WeComInboundMapper(String channelId, String accountId)
初始化 WeComInboundMapper 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
channelId | String | 渠道标识(类型 `String`)。The channel id. |
accountId | String | account 标识(类型 `String`)。The account id. |
io/agentscope/extensions/channel/wecom/WeComInboundMapper.java:57–60方法详情Method Detail
map
public Optional<InboundMessage> map(String xml)
构建InboundMessage来自已解密 WeCom 消息 XML。
Builds an InboundMessage from a decrypted WeCom message XML.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
xml | String | XML(类型 `String`)。The xml. |
Optional<InboundMessage>io/agentscope/extensions/channel/wecom/WeComInboundMapper.java:68–82extractMsgId
public static Optional<String> extractMsgId(String xml)
设置该参数。
Returns the MsgId field if present, used by the idempotency store.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
xml | String | XML(类型 `String`)。The xml. |
Optional<String>io/agentscope/extensions/channel/wecom/WeComInboundMapper.java:170–179