add: workers/ 进程插件目录 + demo 示例(external 模式经 Zenoh 注册路由)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user