Skip to content

Commit

Permalink
lock
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Dec 19, 2024
1 parent 0107677 commit f6632c8
Show file tree
Hide file tree
Showing 6 changed files with 466 additions and 537 deletions.
10 changes: 5 additions & 5 deletions models/avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ class YattaAvatarCV(BaseModel):


class YattaAvatarFetter(BaseModel):
faction: Optional[str]
description: Optional[str]
cv: Optional[YattaAvatarCV]
faction: Optional[str] = None
description: Optional[str] = None
cv: Optional[YattaAvatarCV] = None


class YattaAvatarEidolon(BaseModel):
id: int
rank: int
name: Optional[str]
description: Optional[str]
name: Optional[str] = None
description: Optional[str] = None
icon: str

@property
Expand Down
5 changes: 3 additions & 2 deletions models/relic_affix.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from decimal import Decimal
from typing import Optional, Dict

from pydantic import BaseModel, root_validator
from pydantic import model_validator, BaseModel

from .enums import RelicAffix, RelicPosition

Expand Down Expand Up @@ -38,7 +38,8 @@ class RelicAffixAll(BaseModel):
sub_affix: Dict[str, SingleRelicAffix]
""" 副词条 """

@root_validator(pre=True)
@model_validator(mode="before")
@classmethod
def transform_dicts(cls, values):
for data in ["main_affix", "sub_affix"]:
affix = values.get(data)
Expand Down
Loading

0 comments on commit f6632c8

Please sign in to comment.