feat: 集成飞书通知和机器人对话系统
- 新增通知系统 (notifications 表、服务、API) - 新增飞书定时任务结果推送 (webhook + 应用消息) - 新增飞书应用消息发送服务 (feishu_app_service) - 新增飞书 WebSocket 长连接事件监听 (苹果应用) - 新增飞书账号绑定/解绑 API - 新增橙子飞书机器人 (独立 WS 连接,固定路由到橙子助手 Agent) - 执行记录添加 schedule_id,用户添加飞书绑定字段 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,7 @@ class ScheduleCreate(BaseModel):
|
||||
cron_expression: str = Field(..., description="标准 5 位 cron,如 0 9 * * *")
|
||||
input_message: str = Field(..., description="每次触发时发给 Agent 的消息")
|
||||
timezone: str = "Asia/Shanghai"
|
||||
webhook_url: Optional[str] = Field(None, description="飞书机器人 Webhook URL(可选)")
|
||||
|
||||
|
||||
class ScheduleUpdate(BaseModel):
|
||||
@@ -40,6 +41,7 @@ class ScheduleUpdate(BaseModel):
|
||||
input_message: Optional[str] = None
|
||||
timezone: Optional[str] = None
|
||||
enabled: Optional[bool] = None
|
||||
webhook_url: Optional[str] = None
|
||||
|
||||
|
||||
class ScheduleResponse(BaseModel):
|
||||
@@ -50,6 +52,7 @@ class ScheduleResponse(BaseModel):
|
||||
input_message: str
|
||||
timezone: str
|
||||
enabled: bool
|
||||
webhook_url: Optional[str] = None
|
||||
last_run_at: Optional[datetime] = None
|
||||
last_run_status: Optional[str] = None
|
||||
next_run_at: datetime
|
||||
@@ -104,6 +107,7 @@ async def create_schedule(
|
||||
cron_expression=data.cron_expression,
|
||||
input_message=data.input_message,
|
||||
timezone=data.timezone or "Asia/Shanghai",
|
||||
webhook_url=data.webhook_url,
|
||||
enabled=True,
|
||||
next_run_at=next_run,
|
||||
user_id=current_user.id,
|
||||
@@ -146,6 +150,8 @@ async def update_schedule(
|
||||
schedule.timezone = data.timezone
|
||||
if data.enabled is not None:
|
||||
schedule.enabled = data.enabled
|
||||
if data.webhook_url is not None:
|
||||
schedule.webhook_url = data.webhook_url
|
||||
|
||||
schedule.updated_at = datetime.utcnow()
|
||||
db.commit()
|
||||
|
||||
Reference in New Issue
Block a user