🚸 向下兼容 pydantic 1.10

This commit is contained in:
Chen_Xu233 2024-06-20 16:31:19 +08:00
parent 66822db011
commit c181d6ae93

View File

@ -13,13 +13,6 @@ class ScopedConfig(BaseModel):
excluded_people: List[str] = [] # 排除的人的QQ号 excluded_people: List[str] = [] # 排除的人的QQ号
visualization_type: Literal["饼图", "圆环图", "柱状图"] = "圆环图" # 可视化方案 visualization_type: Literal["饼图", "圆环图", "柱状图"] = "圆环图" # 可视化方案
@field_validator("get_num")
@classmethod
def check_priority(cls, v: int) -> int:
if v >= 1:
return v
raise ValueError("表中的人数必须大于一")
class Config(BaseModel): class Config(BaseModel):
dialectlist: ScopedConfig = ScopedConfig() dialectlist: ScopedConfig = ScopedConfig()