Compare commits

..

No commits in common. "beddeeb3ed6070eba520db4064b320b9c7e48c84" and "21b477d8bf145ab7d5d995c837f18fcb100aeb14" have entirely different histories.

23 changed files with 60 additions and 2662 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

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

View File

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

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,16 @@
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}

33
extensions/example/job.py Normal file
View File

@ -0,0 +1,33 @@
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}

View File

@ -248,7 +248,6 @@ class SyncOAToDidiLegalEntitySyncJob(BaseJob):
seeyon.close() seeyon.close()
payload = json.loads(raw) if raw else {} payload = json.loads(raw) if raw else {}
logger.info(payload)
outer = payload.get("data") or {} outer = payload.get("data") or {}
inner = outer.get("data") or {} inner = outer.get("data") or {}
inner2 = inner.get("data") or {} inner2 = inner.get("data") or {}