feat: deal attributes with select and options
This commit is contained in:
43
schemas/attr_select.py
Normal file
43
schemas/attr_select.py
Normal file
@ -0,0 +1,43 @@
|
||||
from typing import Any
|
||||
|
||||
from schemas.base import BaseSchema
|
||||
|
||||
|
||||
# region Entity
|
||||
|
||||
|
||||
class AttrSelectSchema(BaseSchema):
|
||||
id: int
|
||||
label: str
|
||||
is_built_in: bool
|
||||
|
||||
|
||||
class AttrOptionSchema(BaseSchema):
|
||||
id: int
|
||||
label: str
|
||||
value: Any
|
||||
|
||||
|
||||
class AttrSelectWithOptionsSchema(AttrSelectSchema):
|
||||
options: list[AttrOptionSchema]
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Request
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Response
|
||||
|
||||
|
||||
class GetAllAttrSelectsResponse(BaseSchema):
|
||||
items: list[AttrSelectSchema]
|
||||
|
||||
|
||||
class GetAllAttrSelectOptionsResponse(BaseSchema):
|
||||
items: list[AttrOptionSchema]
|
||||
|
||||
|
||||
# endregion
|
||||
Reference in New Issue
Block a user