update api

This commit is contained in:
GME 2019-06-10 19:50:42 +02:00
parent d130dd9b2e
commit 0eed15427a
2 changed files with 2 additions and 3 deletions

View file

@ -92,7 +92,6 @@ public class UserImplementation {
public User getUserWithEmail(String email) throws Exception{ public User getUserWithEmail(String email) throws Exception{
UserDao userDao = new UserDao(); UserDao userDao = new UserDao();
return userDao.getUserWithEmail(dataEncryption.encryptData(email)); return userDao.getUserWithEmail(dataEncryption.encryptData(email));
} }
public User getUserWithPhone(String phone) throws Exception{ public User getUserWithPhone(String phone) throws Exception{

View file

@ -134,7 +134,7 @@ public class UserResource {
try { try {
UserImplementation userImplementation = new UserImplementation(); UserImplementation userImplementation = new UserImplementation();
User r = userImplementation.getUserWithEmail(email); User r = userImplementation.getUserWithEmail(email);
String response = "{\"name\":\""+r.getName()+"\",\"firstname\":\""+r.getFirstname()+"\",\"user_hash\":\""+r.getUser_hash()+"\"}"; String response = "{\"name\":\""+r.getName()+"\",\"firstname\":\""+r.getFirstname()+"\",\"user_hash\":\""+r.getUser_hash()+"\",\"approved\":\""+r.isApproved()+"\"}";
return ResponseEntity.status(HttpStatus.OK).body(response); return ResponseEntity.status(HttpStatus.OK).body(response);
}catch (Exception e){ }catch (Exception e){
String r = "{\"response\":\""+e.getMessage()+"\"}"; String r = "{\"response\":\""+e.getMessage()+"\"}";
@ -148,7 +148,7 @@ public class UserResource {
try { try {
UserImplementation userImplementation = new UserImplementation(); UserImplementation userImplementation = new UserImplementation();
User r = userImplementation.getUserWithPhone(phone); User r = userImplementation.getUserWithPhone(phone);
String response = "{\"name\":\""+r.getName()+"\",\"firstname\":\""+r.getFirstname()+"\",\"user_hash\":\""+r.getUser_hash()+"\"}"; String response = "{\"name\":\""+r.getName()+"\",\"firstname\":\""+r.getFirstname()+"\",\"user_hash\":\""+r.getUser_hash()+"\",\"approved\":\""+r.isApproved()+"\"}";
return ResponseEntity.status(HttpStatus.OK).body(response); return ResponseEntity.status(HttpStatus.OK).body(response);
}catch (Exception e){ }catch (Exception e){
String r = "{\"response\":\""+e.getMessage()+"\"}"; String r = "{\"response\":\""+e.getMessage()+"\"}";