Files
hose-use/src/ekb_cli/api/platform/platform_api.py
T
gitea 474349e7e4 feat(platform): 新增自建应用子域 API/Service 层
新增 api/platform/ 子包(对齐 api/sealai/ 结构):
- platform_api: list_platforms(DataLink Platform 列表)
- easo_client: EasoClient + get_easo_client()(EASO Bearer JWT 认证)
- workflow_api: list_workflows / get_workflow_stats / get_workflow_charge
- schemas: Platform / Workflow* 模型(从全局 schemas.py 独立出来)

新增 services/platform/ 子包:
- list_platforms / list_platforms_cmd
- list_workflows / get_workflow_stats / get_workflow_charge 及 _cmd 变体

全局 api/schemas.py 清理 platform/workflow 相关模型,只保留通用结构。
未实现子模块(entity/page/card/variable/log)在各层以 README 预留。
2026-04-16 17:54:35 +08:00

17 lines
567 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""自建应用(DataLink Platform)API 调用封装"""
from typing import List
from ekb_cli.api import EkbClient
from ekb_cli.api.platform.schemas import Platform
def list_platforms(client: EkbClient) -> List[Platform]:
"""获取企业下所有启用的自建应用。
对应接口:GET /api/v2/datalink/platform/search?scope=enable
响应结构:{"items": [...]}(非 EkbResponse 包装)
"""
raw = client.get("/v2/datalink/platform/search", scope="enable")
return [Platform.model_validate(item) for item in raw.get("items", [])]