Skip to content

Commit

Permalink
Merge pull request #176 from Funssion-SWM/employer
Browse files Browse the repository at this point in the history
feat: employer가 employee받아올 때 email정보도 추가
  • Loading branch information
goathoon authored Nov 7, 2023
2 parents e533daa + fceeb7c commit 9aa8d33
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public List<Long> getEmployersLikedUser(Long likedUserId) {
public List<Employee> 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 " +
Expand All @@ -50,7 +50,7 @@ public List<Employee> getInterviewEmployees(Boolean isDone){
public List<EmployeeWithStatus> 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 " +
Expand Down Expand Up @@ -133,6 +133,7 @@ private RowMapper<Employee> 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"))
Expand All @@ -148,6 +149,7 @@ private RowMapper<EmployeeWithStatus> 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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public List<UserProfileForEmployer> 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) +
Expand Down Expand Up @@ -148,6 +148,7 @@ private RowMapper<UserProfileForEmployer> 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"))
Expand Down

0 comments on commit 9aa8d33

Please sign in to comment.