Master mergerd

This commit is contained in:
Filip Izydorczyk 2021-01-13 15:53:29 +01:00
commit 1506270dec
12 changed files with 30 additions and 29 deletions

View File

View File

View File

@ -55,15 +55,16 @@ public class UsosApiService {
final OAuthRequest request = new OAuthRequest(Verb.GET, apiUrl + "/services/users/user?user_id=" + usosId);
service.signRequest(new OAuth1AccessToken("", ""), request);
try (Response response = service.execute(request)) {
final String json = response.getBody();
if (!json.equals("null")){
final ObjectMapper mapper = new ObjectMapper();
Map<String, String> map = mapper.readValue(json, new TypeReference<Map<String, String>>() {
});
apiResponse.setName(map.get(NAME_FIELD));
apiResponse.setSurname(map.get(SURNAME_FIELD));
}
}
} catch (IOException | InterruptedException | ExecutionException e) {
e.printStackTrace();
}