예제 #1
0
 def get(self, ):
     s = SelectQuery()
     account = s.get_user_by_id(current_user.id)
     return jsonify({
         'googleId': account.id,
         'username': account.username,
         'email': account.email,
         'userType': account.userType,
         'pushToken': account.pushToken
     })
예제 #2
0
 def insertUserOrNothing(self,googleId,username,email,accountType,pushToken):
     s = SelectQuery()
     i = InsertQuery()
     # controllare accountType not null
     user = s.get_user_by_id(googleId)
     if(user == None): # new user
         print(f"[server] New User {username}")
         i.create_account(email,username,accountType,googleId,pushToken) # push token ?
         # controllare se ritorna True
     user = User(googleId,username,email,accountType,pushToken)
     return user
예제 #3
0
 def lookup_user(self, id):
     s = SelectQuery()
     r = s.get_user_by_id(id)
     # controllare se user not null
     u  = User(r.id,r.username,r.email,r.userType,r.pushToken)
     return u