diff --git a/src/main/java/Funssion/Inforum/domain/employer/domain/Employee.java b/src/main/java/Funssion/Inforum/domain/employer/domain/Employee.java index 9ac84aa9..b22e0f91 100644 --- a/src/main/java/Funssion/Inforum/domain/employer/domain/Employee.java +++ b/src/main/java/Funssion/Inforum/domain/employer/domain/Employee.java @@ -10,6 +10,7 @@ public class Employee { private final Long userId; private final String username; + private final String email; private final String imagePath; private final String rank; private final String introduce; diff --git a/src/main/java/Funssion/Inforum/domain/employer/domain/EmployeeWithStatus.java b/src/main/java/Funssion/Inforum/domain/employer/domain/EmployeeWithStatus.java index 321762a2..a1fa1a48 100644 --- a/src/main/java/Funssion/Inforum/domain/employer/domain/EmployeeWithStatus.java +++ b/src/main/java/Funssion/Inforum/domain/employer/domain/EmployeeWithStatus.java @@ -11,6 +11,7 @@ public class EmployeeWithStatus { private final Long userId; private final String username; + private final String email; private final String imagePath; private final String rank; private final String introduce; diff --git a/src/main/java/Funssion/Inforum/domain/employer/repository/EmployerRepository.java b/src/main/java/Funssion/Inforum/domain/employer/repository/EmployerRepository.java index 49dbe260..4322a0eb 100644 --- a/src/main/java/Funssion/Inforum/domain/employer/repository/EmployerRepository.java +++ b/src/main/java/Funssion/Inforum/domain/employer/repository/EmployerRepository.java @@ -33,7 +33,7 @@ public List getEmployersLikedUser(Long likedUserId) { public List getInterviewEmployees(Boolean isDone){ Long employerId = SecurityContextUtils.getAuthorizedUserId(); String sql = - "SELECT U.id, U.name, U.image_path, U.rank, EMP.introduce, EMP.development_area, EMP.description, EMP.tech_stack, EMP.is_visible " + + "SELECT U.id, U.name, U.email, U.image_path, U.rank, EMP.introduce, EMP.development_area, EMP.description, EMP.tech_stack, EMP.is_visible " + "FROM member.info U, member.professional_profile EMP " + "WHERE U.id = EMP.user_id " + "AND (SELECT status " + @@ -50,7 +50,7 @@ public List getInterviewEmployees(Boolean isDone){ public List getLikeEmployees() { Long employerId = SecurityContextUtils.getAuthorizedUserId(); String sql = - "SELECT U.id, U.name, U.image_path, U.rank, EMP.introduce, EMP.development_area, EMP.description, EMP.tech_stack, EMP.is_visible, INTER.status " + + "SELECT U.id, U.name, U.email, U.image_path, U.rank, EMP.introduce, EMP.development_area, EMP.description, EMP.tech_stack, EMP.is_visible, INTER.status " + "FROM member.info U " + "INNER JOIN member.professional_profile EMP " + "ON U.id = EMP.user_id " + @@ -133,6 +133,7 @@ private RowMapper employeeListRowMapper(){ Employee.builder() .userId(rs.getLong("id")) .username(rs.getString("name")) + .email(rs.getString("email")) .imagePath(rs.getString("image_path")) .rank(rs.getString("rank")) .developmentArea(rs.getString("development_area")) @@ -148,6 +149,7 @@ private RowMapper employeeWithStatusListRowMapper(){ EmployeeWithStatus.builder() .userId(rs.getLong("id")) .username(rs.getString("name")) + .email(rs.getString("email")) .imagePath(rs.getString("image_path")) .rank(rs.getString("rank")) .developmentArea(rs.getString("development_area")) diff --git a/src/main/java/Funssion/Inforum/domain/profile/dto/response/UserProfileForEmployer.java b/src/main/java/Funssion/Inforum/domain/profile/dto/response/UserProfileForEmployer.java index 87b41508..796a4d38 100644 --- a/src/main/java/Funssion/Inforum/domain/profile/dto/response/UserProfileForEmployer.java +++ b/src/main/java/Funssion/Inforum/domain/profile/dto/response/UserProfileForEmployer.java @@ -9,6 +9,7 @@ public class UserProfileForEmployer { private final Long id; private final String name; + private final String email; private final String imagePath; private final String rank; private final String introduce; diff --git a/src/main/java/Funssion/Inforum/domain/profile/repository/ProfileRepositoryImpl.java b/src/main/java/Funssion/Inforum/domain/profile/repository/ProfileRepositoryImpl.java index 96f9d94b..c78ada35 100644 --- a/src/main/java/Funssion/Inforum/domain/profile/repository/ProfileRepositoryImpl.java +++ b/src/main/java/Funssion/Inforum/domain/profile/repository/ProfileRepositoryImpl.java @@ -110,7 +110,7 @@ public List findUserProfilesForEmployer(TechStackDto tec paramList.add(techStackDto.getDevelopmentArea()); String sql = "SELECT *, CASE WHEN EMPLOYER_LIKE.employee_id IS NOT NULL THEN 'true' ELSE 'false' END AS i_like " + "FROM (" + - " SELECT m.id, m.name, m.image_path, m.rank, p.introduce, p.development_area, p.tech_stack, p.description, (" + + " SELECT m.id, m.name, m.email, m.image_path, m.rank, p.introduce, p.development_area, p.tech_stack, p.description, (" + " SELECT 2*count(stack_element)" + " FROM jsonb_array_elements(p.tech_stack) AS stack_element" + " WHERE p.development_area = ? AND stack_element->>'stack' in " + techStackElements(techStackDto.getTechStacks(), paramList) + @@ -148,6 +148,7 @@ private RowMapper userProfileRowMapperForEmployer() { return (rs, rowNum) -> UserProfileForEmployer.builder() .id(rs.getLong("id")) .name(rs.getString("name")) + .email(rs.getString("email")) .isLike(rs.getBoolean("i_like")) .imagePath(rs.getString("image_path")) .rank(rs.getString("rank"))