This commit is contained in:
Marsway 2026-01-12 18:06:57 +08:00
parent e5dfb94318
commit beddeeb3ed
22 changed files with 2661 additions and 60 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +0,0 @@
1
/var/lib/postgresql/data
1767598673
5432
/var/run/postgresql
*
742 0
ready

View File

@ -1,3 +0,0 @@
#

View File

@ -1,16 +0,0 @@
from __future__ import annotations
from app.integrations.base import BaseClient
class ExampleClient(BaseClient):
"""
演示用 Client真实业务中应封装 OA/HR/ERP API
这里不做实际外部请求仅保留结构与调用方式
"""
def ping(self) -> dict:
# 真实情况return self.get_json("/ping")
return {"ok": True}

View File

@ -1,33 +0,0 @@
from __future__ import annotations
import logging
from typing import Any
from app.jobs.base import BaseJob
from extensions.example.client import ExampleClient
logger = logging.getLogger("connecthub.extensions.example")
class ExampleJob(BaseJob):
job_id = "example.hello"
def run(self, params: dict[str, Any], secrets: dict[str, Any]) -> dict[str, Any]:
# params: 明文配置,例如 {"name": "Mars"}
name = params.get("name", "World")
# secrets: 解密后的明文,例如 {"token": "..."}
token = secrets.get("token", "<missing>")
client = ExampleClient(base_url="https://baidu.com", headers={"Authorization": f"Bearer {token}"})
try:
pong = client.ping()
finally:
client.close()
logger.info("ExampleJob ran name=%s pong=%s", name, pong)
return {"hello": name, "pong": pong}