Merge branch 'develop' into frontend/robin
This commit is contained in:
commit
4774b6d111
@ -950,27 +950,8 @@ public class Controller {
|
|||||||
})
|
})
|
||||||
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
|
@CrossOrigin(origins = "http://localhost:8081") // only for dev purpose
|
||||||
@RequestMapping(value = "/api/getRankingPlace", method = RequestMethod.GET, produces = "application/json")
|
@RequestMapping(value = "/api/getRankingPlace", method = RequestMethod.GET, produces = "application/json")
|
||||||
public ResponseEntity getRankingPlace(@RequestParam String token) {
|
public ResponseEntity getRankingPlace(@RequestParam String email) {
|
||||||
|
return ResponseEntity.status(200).body(userRepository.getRankingPlaceFromUser(email));
|
||||||
// verify user
|
|
||||||
ResponseEntity verifyToken = VerificationUtil.verifyToken(token);
|
|
||||||
|
|
||||||
if (verifyToken.getStatusCodeValue() != 200) {
|
|
||||||
return verifyToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
//get User
|
|
||||||
Claims claims = (Claims) verifyToken.getBody();
|
|
||||||
|
|
||||||
ResponseEntity getUser = FinderUtil.findUserFromClaim(claims);
|
|
||||||
|
|
||||||
if (getUser.getStatusCodeValue() != 200) {
|
|
||||||
return getUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
User user = (User) getUser.getBody();
|
|
||||||
|
|
||||||
return ResponseEntity.status(200).body(userRepository.getRankingPlaceFromUser(user.getEmail()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "Returns startstations and all other stations the user already visited as POIS")
|
@ApiOperation(value = "Returns startstations and all other stations the user already visited as POIS")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user