-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
- given 수정 - "역할"로 sort 적용 - plainTestList => names, roles, emails로 분할
- members리스트를 Lead, Core Member, Member, Senior 순으로 정렬하는 함수 추가 - 테이블 순서에따라 member클래스 변수를 name, role, email 순서로 변경
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
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; | ||
} | ||
}); | ||
|
||
} |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 어디에 사용되는건가요?
What is the PR?
Changes