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