|
@@ -129,6 +129,7 @@ def protected(request: Request, Authorize: AuthJWT = Depends()):
|
|
|
Authorize.jwt_required()
|
|
|
current_user = Authorize.get_jwt_subject()
|
|
|
user_obj = first(db.query('SELECT * FROM users where username ="'+str(current_user)+'"'))
|
|
|
+ print(user_obj)
|
|
|
email = user_obj.email
|
|
|
video_num = first(db.query('SELECT COUNT(*) FROM history_input WHERE user_id ='+user_obj.id))
|
|
|
total_sec = first(db.query('SELECT SUM(duration) FROM history_input where user_id='+user_obj.id))
|
|
@@ -138,7 +139,7 @@ def protected(request: Request, Authorize: AuthJWT = Depends()):
|
|
|
statement = 'SELECT * FROM history_input WHERE user_id='+user_obj.id;
|
|
|
for row in db.query(statement):
|
|
|
video_info_list.append({'id':row['id'],'title':row['name'],'duration':row['duration'],'url':row['url']})
|
|
|
-
|
|
|
+
|
|
|
return {'user_info':{'userName':current_user,'email':email,'video_num':video_num,'total_sec':total_sec,'left_sec':left_sec}
|
|
|
,'video_info':video_info_list}
|
|
|
|