feat: 列表页接口增加 current date 参数
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
1bb276939a
commit
cfdf372138
|
@ -47,7 +47,10 @@ def get_record(record_id):
|
|||
def get_records(query_data):
|
||||
try:
|
||||
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:
|
||||
raise BodyRecordNotFound(extra_data={'error_docs': str(e)})
|
||||
return {'records': results}
|
||||
|
|
|
@ -19,6 +19,7 @@ class BodyRecordOut(Schema):
|
|||
|
||||
class BodyRecordsIn(Schema):
|
||||
sort = fields.String()
|
||||
current_date = fields.String()
|
||||
|
||||
|
||||
class BodyRecordsOut(Schema):
|
||||
|
|
Loading…
Reference in New Issue