feat: diet schema add fields 2
continuous-integration/drone/push Build is passing Details

This commit is contained in:
BryantHe 2023-09-19 14:59:17 +08:00
parent 82258e8386
commit 7f21fac864
1 changed files with 15 additions and 0 deletions

View File

@ -7,6 +7,19 @@ class DietRecordsIn(Schema):
current_date = fields.String() 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): class DietRecordOut(Schema):
diet_id = fields.String(attribute='_id') diet_id = fields.String(attribute='_id')
category = fields.String() category = fields.String()
@ -14,6 +27,8 @@ class DietRecordOut(Schema):
diet_image_url = fields.URL() diet_image_url = fields.URL()
heart_count = fields.Integer() heart_count = fields.Integer()
comment_count = fields.Integer() comment_count = fields.Integer()
hearts = fields.List(fields.Nested(heartOut))
comments = fields.List(fields.Nested(CommentOut))
create_time = fields.String() create_time = fields.String()
update_time = fields.String(allow_none=True) update_time = fields.String(allow_none=True)