feat: add api of body record 4
continuous-integration/drone/push Build is passing Details

This commit is contained in:
BryantHe 2023-08-12 20:30:02 +08:00
parent 6ece569ce0
commit 539deb18d2
2 changed files with 2 additions and 7 deletions

View File

@ -37,13 +37,12 @@ def get_record(record_id):
@record.get('/list')
@record.input(BodyRecordsIn, location='query')
@record.output(BodyRecordsOut)
@record.doc(summary='查询身体记录列表', description='查询身体记录列表')
@login_required
def get_records(query_data):
def get_records():
try:
result = rpc.body_record.get_all_by_user(query_data['user_id'])
result = rpc.body_record.get_all_by_user(session['user_id'])
except Exception as e:
raise BodyRecordNotFound()
return result

View File

@ -17,9 +17,5 @@ class BodyRecordOut(Schema):
update_time = fields.String(allow_none=True)
class BodyRecordsIn(Schema):
user_id = fields.String()
class BodyRecordsOut(Schema):
records = fields.Nested(BodyRecordOut)