Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#6 Notion Database API 컨트롤러 작성 #8

Merged
merged 4 commits into from
Sep 22, 2022

Conversation

coke98
Copy link
Contributor

@coke98 coke98 commented Sep 21, 2022

What is the PR?

Changes

  • ApiResponse, ApiError, GlobalExceptionHandler 추가
  • MemberController 작성
  • Lead, Core Member, Member, Senior 순으로 정렬하여 멤버 리스트 반환
  • GdscNotion.java 수정

- given 수정
- "역할"로 sort 적용
- plainTestList => names, roles, emails로 분할
- members리스트를 Lead, Core Member, Member, Senior 순으로 정렬하는 함수 추가
- 테이블 순서에따라 member클래스 변수를 name, role, email 순서로 변경
@coke98 coke98 added the enhancement New feature or request label Sep 21, 2022
@coke98 coke98 requested a review from dmswjdchl September 21, 2022 18:57
@coke98 coke98 self-assigned this Sep 21, 2022
@coke98 coke98 changed the title Feature/#6 Feature/#6 Notion Database API 컨트롤러 작성 Sep 21, 2022
Copy link
Collaborator

@dmswjdchl dmswjdchl left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

Comment on lines +100 to +124
private void sortMembers() {
// members를 Lead, Core Member, Member, Senior 순으로 정렬
members.sort((o1, o2) -> {
if (o1.getRole().equals("Lead")) {
return -1;
} else if (o2.getRole().equals("Lead")) {
return 1;
} else if (o1.getRole().equals("Core Member")) {
return -1;
} else if (o2.getRole().equals("Core Member")) {
return 1;
} else if (o1.getRole().equals("Member")) {
return -1;
} else if (o2.getRole().equals("Member")) {
return 1;
} else if (o1.getRole().equals("Senior")) {
return -1;
} else if (o2.getRole().equals("Senior")) {
return 1;
} else {
return 0;
}
});

}
Copy link
Collaborator

Choose a reason for hiding this comment

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

sort 함수로 이렇게도 정렬이 가능하네요. 감사합니다~

@@ -22,6 +22,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.jraf:klibnotion:1.11.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: "3.4"
Copy link
Collaborator

Choose a reason for hiding this comment

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

이건 어디에 사용되는건가요?

@dmswjdchl dmswjdchl merged commit 434b78f into GDSC-PKNU-Official:develop Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants