diff --git a/app/api/v1/schema/diet.py b/app/api/v1/schema/diet.py index e898e66..a1a6d73 100644 --- a/app/api/v1/schema/diet.py +++ b/app/api/v1/schema/diet.py @@ -7,6 +7,19 @@ class DietRecordsIn(Schema): current_date = fields.String() +class heartOut(Schema): + nickname = fields.String() + avatar_url = fields.String() + create_time = fields.String() + + +class CommentOut(Schema): + nickname = fields.String() + avatar_url = fields.String() + comment = fields.String() + create_time = fields.String() + + class DietRecordOut(Schema): diet_id = fields.String(attribute='_id') category = fields.String() @@ -14,6 +27,8 @@ class DietRecordOut(Schema): diet_image_url = fields.URL() heart_count = fields.Integer() comment_count = fields.Integer() + hearts = fields.List(fields.Nested(heartOut)) + comments = fields.List(fields.Nested(CommentOut)) create_time = fields.String() update_time = fields.String(allow_none=True)