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:
31
backend/app/models/university.py
Normal file
31
backend/app/models/university.py
Normal file
@ -0,0 +1,31 @@
|
||||
"""大学模型"""
|
||||
|
||||
from datetime import datetime
|
||||
from sqlalchemy import Column, Integer, String, DateTime, Text
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from ..database import Base
|
||||
|
||||
|
||||
class University(Base):
|
||||
"""大学表"""
|
||||
|
||||
__tablename__ = "universities"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
name = Column(String(255), nullable=False, index=True)
|
||||
url = Column(String(500), nullable=False)
|
||||
country = Column(String(100))
|
||||
description = Column(Text)
|
||||
status = Column(String(50), default="pending") # pending, analyzing, ready, error
|
||||
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
||||
|
||||
# 关联
|
||||
scripts = relationship("ScraperScript", back_populates="university", cascade="all, delete-orphan")
|
||||
jobs = relationship("ScrapeJob", back_populates="university", cascade="all, delete-orphan")
|
||||
results = relationship("ScrapeResult", back_populates="university", cascade="all, delete-orphan")
|
||||
|
||||
def __repr__(self):
|
||||
return f"<University(id={self.id}, name='{self.name}')>"
|
||||
Reference in New Issue
Block a user