pzx-web-api/app/api/v1/schema/user.py

21 lines
445 B
Python
Raw Normal View History

2023-08-15 17:49:05 +08:00
from apiflask import Schema
2023-08-23 10:57:14 +08:00
from apiflask.fields import String, Float, URL, Boolean
2023-08-15 17:49:05 +08:00
class UserInfoIn(Schema):
nickname = String()
height = Float()
2023-08-23 10:57:14 +08:00
is_hidden_weight = Boolean()
2023-08-15 17:49:05 +08:00
2023-08-23 11:11:15 +08:00
class UserIdIn(Schema):
user_id = String()
2023-08-15 17:49:05 +08:00
class UserInfoOut(Schema):
2023-08-23 10:57:14 +08:00
user_id = String(attribute='_id')
2023-08-15 17:49:05 +08:00
nickname = String()
avatar_id = String()
avatar_url = URL()
2023-08-23 10:57:14 +08:00
height = Float(allow_nan=True)
is_hidden_weight = Boolean()