use of com.odysseusinc.arachne.commons.api.v1.dto.CommonArachneUserStatusDTO in project ArachneCentralAPI by OHDSI.
the class BaseUserController method findUserStatus.
@ApiOperation("Get status of registered user")
@GetMapping(value = "/api/v1/auth/status/{userUuid}")
public JsonResult<CommonArachneUserStatusDTO> findUserStatus(@PathVariable("userUuid") String uuid) throws UserNotFoundException {
JsonResult<CommonArachneUserStatusDTO> result;
IUser user = userService.getByUuid(uuid);
if (user == null) {
throw new UserNotFoundException("userUuid", "user not found");
} else {
result = new JsonResult<>(JsonResult.ErrorCode.NO_ERROR);
result.setResult(user.getEnabled() ? CommonArachneUserStatusDTO.APPROVED : CommonArachneUserStatusDTO.PENDING);
}
return result;
}
Aggregations