[Enhance] Add API about songs

- Add some API endpoints, including creating, changing, deleting song info.
This commit is contained in:
Lost-MSth
2023-01-22 18:39:15 +08:00
parent 9c90d6ef89
commit 9636722709
7 changed files with 99 additions and 13 deletions

View File

@@ -78,7 +78,7 @@ def users_user_get(user, user_id):
@bp.route('/<int:user_id>', methods=['PUT'])
@role_required(request, ['change'])
@request_json_handle(request, optional_keys=['name', 'password', 'user_code', 'ticket', 'email'])
@request_json_handle(request, optional_keys=['name', 'password', 'user_code', 'ticket', 'email'], must_change=True)
@api_try
def users_user_put(data, user, user_id):
'''修改一个用户'''
@@ -103,8 +103,7 @@ def users_user_put(data, user, user_id):
raise InputError('Ticket must be int')
u.ticket = data['ticket']
r['ticket'] = u.ticket
if r:
u.update_columns(d=r)
u.update_columns(d=r)
return success_return(r)