feat: 完善前端功能,添加爬虫页面和项目分页
- 新增 CrawlerView 爬虫页面 - 完善 HomeView 分页展示(9个/页) - 更新 ProjectCard 组件图标 - 优化 API 客户端和类型定义 - 重构样式文件结构到独立目录 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,7 @@ logger = logging.getLogger("yg_dataset.projects")
|
||||
project_crud = CRUDBase(Project)
|
||||
|
||||
|
||||
@router.get("", response_model=ApiResponse)
|
||||
@router.get("", response_model=PaginatedResponse)
|
||||
async def list_projects(
|
||||
page: int = Query(1, ge=1, description="Page number"),
|
||||
page_size: int = Query(20, ge=1, le=100, description="Page size"),
|
||||
|
||||
@@ -14,6 +14,7 @@ class Project(Base, UUIDMixin, TimestampMixin):
|
||||
|
||||
name = Column(String(255), nullable=False)
|
||||
description = Column(Text)
|
||||
type = Column(String(50), default="qa") # qa, table, database
|
||||
|
||||
# Relationships
|
||||
files = relationship("File", back_populates="project", cascade="all, delete-orphan")
|
||||
|
||||
@@ -11,6 +11,7 @@ class ProjectBase(BaseModel):
|
||||
"""Base project schema"""
|
||||
name: str = Field(..., min_length=1, max_length=255)
|
||||
description: Optional[str] = Field(None, max_length=2000)
|
||||
type: str = Field(default="qa") # qa, table, database
|
||||
|
||||
|
||||
class ProjectCreate(ProjectBase):
|
||||
@@ -22,6 +23,7 @@ class ProjectUpdate(BaseModel):
|
||||
"""Project update schema"""
|
||||
name: Optional[str] = Field(None, min_length=1, max_length=255)
|
||||
description: Optional[str] = Field(None, max_length=2000)
|
||||
type: Optional[str] = Field(None)
|
||||
|
||||
|
||||
class ProjectResponse(ProjectBase):
|
||||
|
||||
Reference in New Issue
Block a user