mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-04 21:47:28 +08:00
[Refactor] Database initialization and migration
- Code refactoring for database initialization and migration
This commit is contained in:
@@ -30,7 +30,7 @@ def songs_get(data, user):
|
||||
B = ['song_id', 'name', 'rating_pst',
|
||||
'rating_prs', 'rating_ftr', 'rating_byn']
|
||||
with Connect() as c:
|
||||
query = Query(A, A, B).from_data(data)
|
||||
query = Query(A, A, B).from_dict(data)
|
||||
x = Sql(c).select('chart', query=query)
|
||||
r = []
|
||||
for i in x:
|
||||
|
||||
@@ -37,7 +37,7 @@ def users_get(data, user):
|
||||
B = ['user_id', 'name', 'user_code', 'join_date',
|
||||
'rating_ptt', 'time_played', 'ticket', 'world_rank_score']
|
||||
with Connect() as c:
|
||||
query = Query(A, A, B).from_data(data)
|
||||
query = Query(A, A, B).from_dict(data)
|
||||
x = Sql(c).select('user', query=query)
|
||||
r = []
|
||||
for i in x:
|
||||
@@ -111,7 +111,7 @@ def users_user_best_get(data, user, user_id):
|
||||
|
||||
with Connect() as c:
|
||||
x = UserScoreList(c, UserInfo(c, user_id))
|
||||
x.query.from_data(data)
|
||||
x.query.from_dict(data)
|
||||
x.select_from_user()
|
||||
r = x.to_dict_list()
|
||||
return success_return({'user_id': user_id, 'data': r})
|
||||
|
||||
Reference in New Issue
Block a user