Skip to content

Conversation

@starbro7046
Copy link
Collaborator

교수진 페이지 완성 및 테스트 완료

학과별 교수 조회
교수 상세정보 조회
교수 정보 변경
교수 삭제

교수 직급,이름별 정렬 기능 추가

기능 추가

}
}

@PostMapping("/test")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

테스트 관련 코드는 모두 지워주세요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.build();
}
}
@PutMapping("/admin/{uuid}") //수정
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

professor controller에서 path 매개변수에 admin을 포함할 것인가 말 것인가 고려를 해야 할 것 같습니다.
추가할 거면 post의 것도 추가를 하고 아니면 put이나 delete쪽의 path 매개변수를 모두 빼주세요.

}
}

@GetMapping("/{department}") //학과별 교수진
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

department를 path 변수로 가져가기 보단, 기본은 루트 path를 사용하고 파라미터로 학과를 받을 시 동적 쿼리나 분기를 가져가는 것이 좋을 것 같은데 의견 부탁드립니다.

private final S3Writer s3Writer;
private final ProfessorRepository professorRepository;

private static final List<String> SORT_POSITION=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sort_position을 사용하는 이유가 무엇인가요?

Copy link
Collaborator Author

@starbro7046 starbro7046 May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정렬 기준이 되는 상수입니다
Index가 낮을수록 우선순위가 높습니다
position(SORT_POSITION 기반) 우선, 다음은 name(사전순) 기준으로 정렬됩니다
교수진 정보를 줄 때 정렬된 데이터가 전달됩니다

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요청 사항에 position에 따른 정렬 요구사항이 없긴 하지만, 정해진 postion이 있고, 필요시 별도 postion 테이블 구성 후 낮은 int의 key에 우선순위를 주고 기존 교수 테이블과 fk로 연결 시켜 조회 시 postion테이블의 key 값으로 정렬하면 될 것 같습니다.
request 객체의 경우 enum으로 선언하여 프론트에 필드 관련 정보를 주면 될 것 같습니다.

// 교수 UUID 생성

// S3에 프로필 이미지 업로드
String imgObjectKey = s3Writer.writeFile(updateProfessorRequest.getImage(), uuid + "/profile-image");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요청에 이미지가 있을 때만 이미지를 업로드하는 형식이 좋을 것 같은데 의견 부탁드립니다.

}

public ProfessorEntity updateProfessor(String professorUUID, String imgObjectKey, UpdateProfessorRequest request, int sortOrder) {
ProfessorEntity professorEntity = new ProfessorEntity();
Copy link
Collaborator

@ZZunyoung ZZunyoung May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요청에 모든 필드에 대한 값을 받기보단, 업데이트할 필드의 값만 받고 그 값들만 업데이트 하는 것이 좋을 것 같은데 의견 부탁드립니다.
request에서 work나 award 객체를 받아 업데이트 시, 기존 데이터를 지우고, 새로운 raw를 쓰고 있는데 이보단 기존 객체에는 변함이 없을 시, 그대로 유지하는 것이 좋을 것 같은데 의견 부탁드립니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants