feat: 列表页接口增加 current date 参数
continuous-integration/drone/push Build is passing Details

This commit is contained in:
BryantHe 2023-08-23 15:43:45 +08:00
parent 1bb276939a
commit cfdf372138
2 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,10 @@ def get_record(record_id):
def get_records(query_data): def get_records(query_data):
try: try:
sort = query_data.get('sort', '-create_time') sort = query_data.get('sort', '-create_time')
results = rpc.body_record.get_all_by_user(session['user_id'], sort) current_date = query_data.get('current_date', None)
results = rpc.body_record.get_all_by_user(session['user_id'],
sort=sort,
current_date=current_date)
except Exception as e: except Exception as e:
raise BodyRecordNotFound(extra_data={'error_docs': str(e)}) raise BodyRecordNotFound(extra_data={'error_docs': str(e)})
return {'records': results} return {'records': results}

View File

@ -19,6 +19,7 @@ class BodyRecordOut(Schema):
class BodyRecordsIn(Schema): class BodyRecordsIn(Schema):
sort = fields.String() sort = fields.String()
current_date = fields.String()
class BodyRecordsOut(Schema): class BodyRecordsOut(Schema):