GitLabInboundMapper
public final class GitLabInboundMapper
io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:42–119GitLab 入站 Mapper,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.gitlab 包。核心成员包括 extractNoteId、extractAuthorId、map、GitLabInboundMapper。
Maps a GitLab Note Hook payload into an InboundMessage.
Only Issue and MergeRequest notes are mapped in MVP; Commit and Snippet notes are dropped.
System notes (label changes, status changes) are skipped via object_attributes.system.
Peer model:
-
peerKind=PeerKind#THREAD -
peerId="<project.path_with_namespace>#<iid>:<noteable_type>"— the trailing:Issue|MergeRequestis essential for the outbound dispatcher to pick the correct endpoint.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public GitLabInboundMapper(String channelId) | 初始化 `GitLabInboundMapper` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static Optional<Long> extractNoteId(JsonNode payload)static | 设置该参数。 Returns the `object_attributes.id` used as the idempotency key. |
public static Optional<Long> extractAuthorId(JsonNode payload)static | 设置该参数。 Returns the `user.id` used for bot-loop self-detection. |
public Optional<InboundMessage> map(JsonNode payload) | 设置映射。 Maps a Note Hook payload into an `InboundMessage`. |
构造器详情Constructor Detail
GitLabInboundMapper
public GitLabInboundMapper(String channelId)
初始化 GitLabInboundMapper 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
channelId | String | 渠道标识(类型 `String`)。The channel id. |
io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:46–48方法详情Method Detail
extractNoteId
public static Optional<Long> extractNoteId(JsonNode payload)
设置该参数。
Returns the object_attributes.id used as the idempotency key.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
payload | JsonNode | 负载(类型 `JsonNode`)。The payload. |
Optional<Long>io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:51–57extractAuthorId
public static Optional<Long> extractAuthorId(JsonNode payload)
设置该参数。
Returns the user.id used for bot-loop self-detection.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
payload | JsonNode | 负载(类型 `JsonNode`)。The payload. |
Optional<Long>io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:60–66map
public Optional<InboundMessage> map(JsonNode payload)
设置映射。
Maps a Note Hook payload into an InboundMessage.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
payload | JsonNode | 负载(类型 `JsonNode`)。The payload. |
Optional<InboundMessage>io/agentscope/extensions/channel/gitlab/GitLabInboundMapper.java:72–118