from sqlalchemy import VARCHAR
from sqlalchemy.dialects.mysql import BIGINT
from sqlmodel import Field

from .base import BaseModel


class ReportUrlModel(BaseModel, table=True):
    """存储举报 URL 的模型"""

    __tablename__ = 'report_url'

    # 域名ID
    domain_id: int = Field(alias='domain_id', default=0, sa_type=BIGINT(unsigned=True))

    # 域名内容
    domain: str = Field(alias="domain", default="", sa_type=VARCHAR(1024))

    # SURL
    surl: str = Field(alias="surl", default="", sa_type=VARCHAR(2048))  # 待举报的 URL

    # 举报 token
    token: str = Field(alias="token", default="", sa_type=VARCHAR(64))

    # 标题
    title: str = Field(alias="title", default="", sa_type=VARCHAR(1024))

    # 搜索关键词
    q: str = Field(alias="q", default="", sa_type=VARCHAR(1024))  # TODO: 这是干啥的？

    # 举报渠道状态
    is_report_by_one: bool = Field(alias="is_report_by_one", default=False)
    is_report_by_site: bool = Field(alias="is_report_by_site", default=False)
    is_report_by_wap: bool = Field(alias="is_report_by_wap", default=False)

    # 证据状态
    has_evidence: bool = Field(alias="has_evidence", default=False)
