add: workers/ 进程插件目录 + demo 示例(external 模式经 Zenoh 注册路由)

This commit is contained in:
2026-08-14 17:44:19 +08:00
parent b9498750ff
commit 1f727bcdd7
12 changed files with 183 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
"""
自动生成的 Pydantic 模型 — demo
来源: config/workers/demo/
"""
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel, Field
class HelloGetRequest(BaseModel):
"""进程插件示例:问候 — 请求体"""
name: str = Field(...)
class HelloGetResponse(BaseModel):
"""进程插件示例:问候 — 响应体"""
greeting: str = Field(...)
worker_id: Optional[str] = Field(default='')
timestamp: float = Field(...)
# 所有响应模型的联合类型
DemoResponse = HelloGetResponse