| 1234567891011121314151617181920 |
- from sqlalchemy import Column, Integer, String, DateTime
- from sqlalchemy.sql import func
- from datetime import datetime
- from app.core.database import Base
- class ProxyPool(Base):
- __tablename__ = "proxy_pool"
- id = Column(Integer, primary_key=True, index=True, autoincrement=True)
- pool_name = Column(String(32), nullable=False, comment="所属代理池")
- proto = Column(String(10), nullable=False, default="http", comment="代理协议")
- ip = Column(String(39), nullable=False, comment="代理IP")
- port = Column(Integer, nullable=False, comment="端口")
- username = Column(String(64), default=None, comment="代理用户名")
- password = Column(String(64), default=None, comment="代理密码")
- next_use_time = Column(DateTime, nullable=False, default=func.now(), comment="下次允许使用的时间")
- status = Column(String(16), nullable=False, default="active", comment="active=可用, disable=禁用")
-
- created_at = Column(DateTime, default=datetime.utcnow)
- updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|