Skip to content

Commit

Permalink
fix: add missing character role (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 authored Dec 29, 2021
1 parent 9be823f commit e08ce9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pol/api/v0/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pydantic
from pydantic import Field, BaseModel

from pol.db.const import BloodType, PersonType
from pol.db.const import BloodType, PersonType, CharacterType
from .base import Paged

__all__ = [
Expand Down Expand Up @@ -113,7 +113,7 @@ class PersonDetail(BasePerson):
class BaseCharacter(BaseModel):
id: int
name: str
type: PersonType = Field(description="角色,机体,组织...")
type: CharacterType = Field(description="角色,机体,舰船,组织...")
images: Optional[PersonImages] = Field(
description="object with some size of images, this object maybe `null`"
)
Expand Down
10 changes: 10 additions & 0 deletions pol/db/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ def translate(self, _escape_table):
return self.value


class CharacterType(enum.IntEnum):
person = 1
airframe = 2
ship = 3
organization = 4

def translate(self, _escape_table):
return self.value


class PersonType(enum.IntEnum):
person = 1
company = 2
Expand Down

0 comments on commit e08ce9e

Please sign in to comment.