Add university scraper system with backend, frontend, and configs
- Add src/university_scraper module with scraper, analyzer, and CLI - Add backend FastAPI service with API endpoints and database models - Add frontend React app with university management pages - Add configs for Harvard, Manchester, and UCL universities - Add artifacts with various scraper implementations - Add Docker compose configuration for deployment - Update .gitignore to exclude generated files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
48
backend/app/schemas/university.py
Normal file
48
backend/app/schemas/university.py
Normal file
@ -0,0 +1,48 @@
|
||||
"""大学相关的Pydantic模型"""
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Optional, List
|
||||
from pydantic import BaseModel, HttpUrl
|
||||
|
||||
|
||||
class UniversityBase(BaseModel):
|
||||
"""大学基础字段"""
|
||||
name: str
|
||||
url: str
|
||||
country: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
|
||||
|
||||
class UniversityCreate(UniversityBase):
|
||||
"""创建大学请求"""
|
||||
pass
|
||||
|
||||
|
||||
class UniversityUpdate(BaseModel):
|
||||
"""更新大学请求"""
|
||||
name: Optional[str] = None
|
||||
url: Optional[str] = None
|
||||
country: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
|
||||
|
||||
class UniversityResponse(UniversityBase):
|
||||
"""大学响应"""
|
||||
id: int
|
||||
status: str
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
# 统计信息
|
||||
scripts_count: int = 0
|
||||
jobs_count: int = 0
|
||||
latest_result: Optional[dict] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class UniversityListResponse(BaseModel):
|
||||
"""大学列表响应"""
|
||||
total: int
|
||||
items: List[UniversityResponse]
|
||||
Reference in New Issue
Block a user