from pydantic import BaseModel, Field


class GetDomainListRequest(BaseModel):
    """获取域名列表"""

    # 分页参数
    page: int = Field(default=1, gt=0)
    size: int = Field(default=50, gt=0)

    # 过滤条件
    domain: str = ""
    status: int = 0


class AddDomainRequest(BaseModel):
    """添加域名到数据库的请求参数"""
    crawl_interval: int
    crawl_now: bool = True
    domains: list[str]


class ImportDomainFormRequest(BaseModel):
    """通过文件导入的"""
    crawl_interval: int
    crawl_now: bool = True


class DeleteDomainRequest(BaseModel):
    """删除域名的请求"""
    domain_ids: list[int]
    remove_surl: bool = False


class UpdateDomainRequest(BaseModel):
    """更新域名的请求"""
    domain_ids: list[int]
    crawl_interval: int


class CrawlNowRequest(BaseModel):
    """立即爬取的请求"""
    domain_ids: list[int]


class ToggleDomainRequest(BaseModel):
    """暂停某个域名的爬取"""
    domain_ids: list[int]
