33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
"""Schemas for Feishu API endpoints."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Dict, List, Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class FeishuConfigRequest(BaseModel):
|
|
"""飞书配置请求。"""
|
|
|
|
app_id: str = Field(..., description="飞书 App ID")
|
|
app_secret: str = Field(..., description="飞书 App Secret")
|
|
encrypt_key: Optional[str] = Field(None, description="已废弃字段,保留仅为兼容旧客户端")
|
|
verification_token: Optional[str] = Field(None, description="已废弃字段,保留仅为兼容旧客户端")
|
|
event_mode: str = Field("long_connection", description="事件接收模式,现仅支持 long_connection")
|
|
|
|
|
|
class FeishuSendMessageRequest(BaseModel):
|
|
"""发送消息请求。"""
|
|
|
|
chat_id: str = Field(..., description="群聊 ID")
|
|
message: str = Field(..., description="消息内容")
|
|
|
|
|
|
class FeishuSendCardRequest(BaseModel):
|
|
"""发送卡片请求。"""
|
|
|
|
chat_id: str = Field(..., description="群聊 ID")
|
|
title: str = Field(..., description="卡片标题")
|
|
content: List[Dict[str, Any]] = Field(..., description="卡片内容")
|