18 @ns.route('/user/info')
19 class Information(Resource):
21 description=
'Info route, returns json with user information.',
22 responses={200:
'OK', 400:
'Invalid Argument', 500:
'Mapping Key Error'})
26 @vt.require_valid_token
30 current_user = get_jwt_identity()
32 connection = SQLC.SQLConAdmin()
34 connection.execute_query(SQLQ.SQLQueries.use_users_database())
36 user_info = SQLQ.SQLQueries.get_user_information_by_id(current_user[
'user_id'])
39 result = connection.execute_query(user_info)
40 connection.cnx.commit()
46 created_timestamp = row[6].strftime(
'%Y-%m-%d %H:%M:%S')
if row[6]
else None
47 updated_timestamp = row[7].strftime(
'%Y-%m-%d %H:%M:%S')
if row[7]
else None
52 'accountType': row[2],
54 'created_timestamp': created_timestamp,
55 'updater_timestamp': updated_timestamp