from pydantic import BaseModel, Field, validator

class Config(BaseModel):
    recall_delay: int = Field(default=110, ge=1, env="RECALL_DELAY")
    qqpush_recall_delay: int = Field(default=3600, ge=1, env="QQPUSH_RECALL_DELAY")

    @validator("recall_delay", "qqpush_recall_delay")
    def delay_must_be_positive(cls, v: int) -> int:
        if v < 1:
            raise ValueError("撤回延迟必须大于0秒")
        return v