Develop#4391
Conversation
…-api Add RunningHub channel integration (task adaptor, controller endpoints, and UI support)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
WalkthroughThis PR adds comprehensive support for the RunningHub channel type across the application stack, including new channel constants, API type mappings, controller handlers for model fetching and channel-specific operations, a task relay adaptor with request/response parsing, router endpoints, frontend UI components, and integration documentation. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Controller as FetchModels<br/>Handler
participant RunningHub as RunningHub API
participant Parser as Response Parser
Client->>Controller: GET /admin/channel/models<br/>(channelType=58, baseURL, key)
activate Controller
Controller->>RunningHub: POST /openapi/v2/resource/list<br/>(empty JSON)
activate RunningHub
RunningHub-->>Controller: {code: 0, data: {records: [{resourceName: "..."}]}}
deactivate RunningHub
Controller->>Parser: Parse response
activate Parser
Parser->>Parser: Extract resourceName values<br/>and trim whitespace
Parser-->>Controller: []string{models...}
deactivate Parser
Controller-->>Client: {data: {models: [...]}, success: true}
deactivate Controller
sequenceDiagram
participant Client
participant TaskAdaptor as TaskAdaptor
participant Validator as Request<br/>Validator
participant Builder as Request<br/>Builder
participant RunningHub as RunningHub API
participant ResponseHandler as Response<br/>Handler
Client->>TaskAdaptor: POST /v1/video/generations<br/>(task request)
activate TaskAdaptor
TaskAdaptor->>Validator: ValidateRequestAndSetAction()
activate Validator
Validator->>Validator: Extract api_path<br/>from metadata
Validator-->>TaskAdaptor: Set UpstreamModelName
deactivate Validator
TaskAdaptor->>Builder: BuildRequestURL, Header, Body
activate Builder
Builder->>Builder: Build Bearer auth<br/>Extract/map fields<br/>(prompt, image, size, etc.)
Builder-->>TaskAdaptor: {url, header, body}
deactivate Builder
TaskAdaptor->>RunningHub: HTTP Request<br/>(method, url, auth, body)
activate RunningHub
RunningHub-->>TaskAdaptor: {taskId, data, ...}
deactivate RunningHub
TaskAdaptor->>ResponseHandler: DoResponse()
activate ResponseHandler
ResponseHandler->>ResponseHandler: Extract/rewrite taskId<br/>to PublicTaskID
ResponseHandler-->>TaskAdaptor: taskID, taskData
deactivate ResponseHandler
TaskAdaptor-->>Client: HTTP 200<br/>(JSON response with taskId)
deactivate TaskAdaptor
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Important
📝 变更描述 / Description
(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)
Summary by CodeRabbit
Release Notes
New Features
Documentation