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

22 lines
568 B
Python
Raw Normal View History

2023-09-15 18:00:17 +08:00
from apiflask import Schema
from apiflask import fields
class DietRecordsIn(Schema):
sort = fields.String()
current_date = fields.String()
class DietRecordOut(Schema):
diet_id = fields.String(attribute='_id')
category = fields.String()
diet_image_id = fields.String()
diet_image_url = fields.URL()
2023-09-19 11:34:28 +08:00
heart_count = fields.Integer()
comment_count = fields.Integer()
2023-09-15 18:00:17 +08:00
create_time = fields.String()
update_time = fields.String(allow_none=True)
class DietRecordsOut(Schema):
records = fields.List(fields.Nested(DietRecordOut))