2023-08-12 20:00:38 +08:00
|
|
|
from apiflask import Schema
|
|
|
|
from apiflask import fields
|
|
|
|
|
|
|
|
|
|
|
|
class BodyRecordIn(Schema):
|
|
|
|
height = fields.Float()
|
|
|
|
weight = fields.Float()
|
|
|
|
bmi = fields.Float()
|
|
|
|
|
|
|
|
|
|
|
|
class BodyRecordOut(Schema):
|
|
|
|
record_id = fields.String(attribute='_id')
|
|
|
|
height = fields.Float()
|
|
|
|
weight = fields.Float()
|
|
|
|
bmi = fields.Float()
|
|
|
|
create_time = fields.String()
|
|
|
|
update_time = fields.String(allow_none=True)
|
|
|
|
|
|
|
|
|
|
|
|
class BodyRecordsOut(Schema):
|
2023-08-12 20:36:23 +08:00
|
|
|
records = fields.List(fields.Nested(BodyRecordOut))
|