From 539deb18d275444a776a69018abd366f422367b8 Mon Sep 17 00:00:00 2001 From: BryantHe Date: Sat, 12 Aug 2023 20:30:02 +0800 Subject: [PATCH] feat: add api of body record 4 --- app/api/v1/record.py | 5 ++--- app/api/v1/schema/record.py | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/api/v1/record.py b/app/api/v1/record.py index b64963e..98d7db0 100644 --- a/app/api/v1/record.py +++ b/app/api/v1/record.py @@ -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 diff --git a/app/api/v1/schema/record.py b/app/api/v1/schema/record.py index f87af68..196bdb1 100644 --- a/app/api/v1/schema/record.py +++ b/app/api/v1/schema/record.py @@ -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) \ No newline at end of file