diff --git a/src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java b/src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java index 288019e..4d38c2e 100644 --- a/src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java +++ b/src/main/java/org/waterproofingdata/wpdauth/controller/UsersController.java @@ -78,8 +78,8 @@ public class UsersController { @ApiResponse(code = 500, message = "Expired or invalid JWT token")}) public UsersResponseDTO search(@ApiParam("Username") @PathVariable String username) { UsersResponseDTO urDTO = modelMapper.map(userService.search(username), UsersResponseDTO.class); - //urDTO.setEduCemadenOrganization(userService.findEduCemadenOrganizationById(urDTO.getId())); - //urDTO.setRolesProviderActivationKeys(userService.findRolesproviderActivationKeysById(urDTO.getId())); + urDTO.setEduCemadenOrganization(userService.findEduCemadenOrganizationById(urDTO.getId())); + urDTO.setRolesProviderActivationKeys(userService.findRolesproviderActivationKeysById(urDTO.getId())); return urDTO; } @@ -92,8 +92,8 @@ public class UsersController { @ApiResponse(code = 500, message = "Expired or invalid JWT token")}) public UsersResponseDTO whoami(HttpServletRequest req) { UsersResponseDTO urDTO = modelMapper.map(userService.whoami(req), UsersResponseDTO.class); - //urDTO.setEduCemadenOrganization(userService.findEduCemadenOrganizationById(urDTO.getId())); - //urDTO.setRolesProviderActivationKeys(userService.findRolesproviderActivationKeysById(urDTO.getId())); + urDTO.setEduCemadenOrganization(userService.findEduCemadenOrganizationById(urDTO.getId())); + urDTO.setRolesProviderActivationKeys(userService.findRolesproviderActivationKeysById(urDTO.getId())); return urDTO; } diff --git a/src/main/java/org/waterproofingdata/wpdauth/dto/UsersResponseDTO.java b/src/main/java/org/waterproofingdata/wpdauth/dto/UsersResponseDTO.java index a0fcc00..453b840 100644 --- a/src/main/java/org/waterproofingdata/wpdauth/dto/UsersResponseDTO.java +++ b/src/main/java/org/waterproofingdata/wpdauth/dto/UsersResponseDTO.java @@ -22,11 +22,9 @@ public class UsersResponseDTO { @ApiModelProperty(position = 2) List roles; - /* @ApiModelProperty(position = 3) EduCemadenOrganizations eduCemadenOrganization; @ApiModelProperty(position = 4) List rolesProviderActivationKeys; - */ } diff --git a/src/main/java/org/waterproofingdata/wpdauth/repository/EduCemadenOrganizationsRepository.java b/src/main/java/org/waterproofingdata/wpdauth/repository/EduCemadenOrganizationsRepository.java index bdcf654..ea51f49 100644 --- a/src/main/java/org/waterproofingdata/wpdauth/repository/EduCemadenOrganizationsRepository.java +++ b/src/main/java/org/waterproofingdata/wpdauth/repository/EduCemadenOrganizationsRepository.java @@ -10,10 +10,10 @@ import org.waterproofingdata.wpdauth.model.EduCemadenOrganizations; public interface EduCemadenOrganizationsRepository extends JpaRepository { EduCemadenOrganizations findByPhone(String phone); - @Query(value = "SELECT e.*, ueo.activationkey FROM educemaden_organizations e INNER JOIN users_educemaden_organizations ueo ON e.id = ueo.educemaden_organizations_id WHERE ueo.users_id = ?1;", nativeQuery = true) + @Query(value = "SELECT e.*, ueo.activationkey FROM educemaden_organizations e INNER JOIN users_educemaden_organizations ueo ON e.id = ueo.educemaden_organizations_id WHERE ueo.users_id = ?1", nativeQuery = true) EduCemadenOrganizations findByUserId(Integer userid); @Transactional - @Query(value = "INSERT INTO users_educemaden_organizations(id, users_id, educemaden_organizations_id, activationkey) VALUES (DEFAULT, ?1, ?2, ?3);", nativeQuery = true) + @Query(value = "INSERT INTO users_educemaden_organizations(id, users_id, educemaden_organizations_id, activationkey) VALUES (DEFAULT, ?1, ?2, ?3)", nativeQuery = true) void insertUsersEduCemadenOrganizations(Integer userid, Integer eduCemadenOrganizationsid, String activationkey); } diff --git a/src/main/java/org/waterproofingdata/wpdauth/service/UsersService.java b/src/main/java/org/waterproofingdata/wpdauth/service/UsersService.java index e78f850..eb9e082 100644 --- a/src/main/java/org/waterproofingdata/wpdauth/service/UsersService.java +++ b/src/main/java/org/waterproofingdata/wpdauth/service/UsersService.java @@ -85,7 +85,7 @@ public class UsersService { } public EduCemadenOrganizations findEduCemadenOrganizationById(Integer userid) { - return eduCemadenOrganizationsRepository.findByUserId(userid); + return eduCemadenOrganizationsRepository.findByUserId(userid); } public List findRolesproviderActivationKeysById(Integer usersid) {