Use OpenOlat endpoint to fetch user information
This commit is contained in:
parent
b1afde6755
commit
ba4e9e7eca
2 changed files with 7 additions and 5 deletions
|
@ -332,14 +332,14 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
|
||||||
}
|
}
|
||||||
|
|
||||||
private ExamineeAccountDetails getExamineeById(final RestTemplate restTemplate, final String id) {
|
private ExamineeAccountDetails getExamineeById(final RestTemplate restTemplate, final String id) {
|
||||||
final String url = String.format("/restapi/users/%s/name_username", id);
|
final String url = String.format("/restapi/users/%s", id);
|
||||||
final UserData u = this.apiGet(restTemplate, url, UserData.class);
|
final UserData u = this.apiGet(restTemplate, url, UserData.class);
|
||||||
final Map<String, String> attrs = new HashMap<>();
|
final Map<String, String> attrs = new HashMap<>();
|
||||||
return new ExamineeAccountDetails(
|
return new ExamineeAccountDetails(
|
||||||
String.valueOf(u.key),
|
String.valueOf(u.key),
|
||||||
u.lastName + ", " + u.firstName,
|
u.lastName + ", " + u.firstName,
|
||||||
u.username,
|
u.login,
|
||||||
"OLAT API does not provide email addresses",
|
u.email,
|
||||||
attrs);
|
attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,13 +48,15 @@ public final class OlatLmsData {
|
||||||
* "firstName": "OpenOLAT",
|
* "firstName": "OpenOLAT",
|
||||||
* "key": 360448,
|
* "key": 360448,
|
||||||
* "lastName": "Administrator",
|
* "lastName": "Administrator",
|
||||||
* "username": "administrator"
|
* "login": "administrator",
|
||||||
|
* "email": "admin@example.org"
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
public long key;
|
public long key;
|
||||||
public String firstName;
|
public String firstName;
|
||||||
public String lastName;
|
public String lastName;
|
||||||
public String username;
|
public String login;
|
||||||
|
public String email;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
|
Loading…
Add table
Reference in a new issue