- 后端新增: Project CRUD / Brief CRUD / 组织关系管理 / 工作台统计 / SSE 推送 / 认证依赖注入 - 后端完善: 任务 API 全流程(创建/审核/申诉) + Task Service + Task Schema - 前端修复: login 页面 localStorage key 错误 (miaosi_auth -> miaosi_user) - 前端对齐: types/task.ts 与后端 TaskStage/TaskResponse 完全对齐 - 前端新增: project/brief/organization/dashboard 类型定义 - 前端补全: api.ts 新增 30+ API 方法覆盖所有后端接口 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
88 lines
1.6 KiB
Python
88 lines
1.6 KiB
Python
"""
|
|
组织关系相关 Schema
|
|
"""
|
|
from typing import Optional, List
|
|
from datetime import datetime
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
# ===== 通用 =====
|
|
|
|
class BrandSummary(BaseModel):
|
|
"""品牌方摘要"""
|
|
id: str
|
|
name: str
|
|
logo: Optional[str] = None
|
|
contact_name: Optional[str] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class AgencySummary(BaseModel):
|
|
"""代理商摘要"""
|
|
id: str
|
|
name: str
|
|
logo: Optional[str] = None
|
|
contact_name: Optional[str] = None
|
|
force_pass_enabled: bool = True
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class CreatorSummary(BaseModel):
|
|
"""达人摘要"""
|
|
id: str
|
|
name: str
|
|
avatar: Optional[str] = None
|
|
douyin_account: Optional[str] = None
|
|
xiaohongshu_account: Optional[str] = None
|
|
bilibili_account: Optional[str] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
# ===== 请求 =====
|
|
|
|
class InviteAgencyRequest(BaseModel):
|
|
"""邀请代理商"""
|
|
agency_id: str
|
|
|
|
|
|
class InviteCreatorRequest(BaseModel):
|
|
"""邀请达人"""
|
|
creator_id: str
|
|
|
|
|
|
class UpdateAgencyPermissionRequest(BaseModel):
|
|
"""更新代理商权限"""
|
|
force_pass_enabled: bool
|
|
|
|
|
|
# ===== 响应 =====
|
|
|
|
class OrganizationListResponse(BaseModel):
|
|
"""组织列表通用响应"""
|
|
items: list
|
|
total: int
|
|
|
|
|
|
class BrandListResponse(BaseModel):
|
|
"""品牌方列表"""
|
|
items: List[BrandSummary]
|
|
total: int
|
|
|
|
|
|
class AgencyListResponse(BaseModel):
|
|
"""代理商列表"""
|
|
items: List[AgencySummary]
|
|
total: int
|
|
|
|
|
|
class CreatorListResponse(BaseModel):
|
|
"""达人列表"""
|
|
items: List[CreatorSummary]
|
|
total: int
|