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

๐Ÿ”€ :: ํšŒ์›๊ฐ€์ž… ์ˆ˜๋ฝ์‹œ์— UserRole ์ถ”๊ฐ€ #319

Merged

Conversation

Umjiseung
Copy link
Contributor

@Umjiseung Umjiseung commented Apr 30, 2024

๐Ÿ’ก ๋ฐฐ๊ฒฝ ๋ฐ ๊ฐœ์š”

signUpํ• ๋•Œ UserRole์„ ํ•™์ƒ์œผ๋กœ ๊ณ ์ •ํ•˜์—ฌ ํšŒ์›๊ฐ€์ž… ์ˆ˜๋ฝ ํ›„์— UserRole์ด ๋ชจ๋‘ ํ•™์ƒ์œผ๋กœ ๋“ค์–ด๊ฐ€๋Š” ํ˜„์ƒ์ด ์ผ์–ด๋‚˜ ์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค

Resolves: #318

๐Ÿ“ƒ ์ž‘์—…๋‚ด์šฉ

PR์—์„œ ํ•œ ์ž‘์—…์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”!

ํšŒ์›๊ฐ€์ž… ์ˆ˜๋ฝ์‹œ์— Body๋กœ ๋ณด๋‚ธ UserRoleType์„ ์ง‘์–ด๋„ฃ์–ด ์ตœ์ข…์ ์œผ๋กœ ์˜ฌ๋ฐ”๋ฅธ ๊ถŒํ•œ์ด ๋“ค์–ด๊ฐ€๊ฒŒ๋” ํ•˜์˜€์Šต๋‹ˆ๋‹ค

๐Ÿ™‹โ€โ™‚๏ธ ๋ฆฌ๋ทฐ๋…ธํŠธ

๊ตฌํ˜„ ์‹œ์— ๊ณ ๋ฏผ์ด์—ˆ๋˜ ์ ๋“ค ํ˜น์€ ํŠน์ • ๋ถ€๋ถ„์— ๋Œ€ํ•œ ์˜๋„๊ฐ€ ์žˆ์—ˆ๋‹ค๋ฉด PR ๋ฆฌ๋ทฐ์˜ ์ดํ•ด๋ฅผ ๋•๊ธฐ ์œ„ํ•ด ์„œ์ˆ ํ•ด์ฃผ์„ธ์š”!

๋˜ํ•œ ๋ฆฌ๋ทฐ์–ด์—๊ฒŒ ํŠน์ • ๋ถ€๋ถ„์— ๋Œ€ํ•œ ์ง‘์ค‘ ํ˜น์€ ์ฝ”๋ฉ˜ํŠธ ํ˜น์€ ์งˆ๋ฌธ์„ ์š”์ฒญํ•˜๋Š” ๊ฒฝ์šฐ์— ์ž‘์„ฑํ•˜๋ฉด ์ข‹์•„์š”!

e.g. ์ž‘์—…์„ ๋๋‚ด์•ผํ•  ์‹œ๊ฐ„์ด ์–ผ๋งˆ ์—†์–ด ํ™•์žฅ์„ฑ๋ณด๋‹ค๋Š” ๋™์ž‘์„ ์œ„์ฃผ๋กœ ๋งŒ๋“ค์—ˆ์–ด์š”! ๊ฐ์•ˆํ•˜๊ณ  ๋ฆฌ๋ทฐํ•ด์ฃผ์„ธ์š”!

โœ… PR ์ฒดํฌ๋ฆฌ์ŠคํŠธ

ํ…œํ”Œ๋ฆฟ ์ฒดํฌ๋ฆฌ์ŠคํŠธ ๋ง๊ณ ๋„ ์ถ”๊ฐ€์ ์œผ๋กœ ํ•„์š”ํ•œ ์ฒดํฌ๋ฆฌ์ŠคํŠธ๋Š” ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”!

  • ์ด ์ž‘์—…์œผ๋กœ ์ธํ•ด ๋ณ€๊ฒฝ์ด ํ•„์š”ํ•œ ๋ฌธ์„œ๊ฐ€ ๋ณ€๊ฒฝ๋˜์—ˆ๋‚˜์š”? (e.g. .env, ๋…ธ์…˜, README)
  • ์ด ์ž‘์—…์„ ํ•˜๊ณ ๋‚˜์„œ ๊ณต์œ ํ•ด์•ผํ•  ํŒ€์›๋“ค์—๊ฒŒ ๊ณต์œ ๋˜์—ˆ๋‚˜์š”? (e.g. "API ๊ฐœ๋ฐœ ์™„๋ฃŒ๋์–ด์š”", "ํ™˜๊ฒฝ๊ฐ’ ์ถ”๊ฐ€๋˜์—ˆ์–ด์š”")
  • ์ž‘์—…ํ•œ ์ฝ”๋“œ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•˜๋‚˜์š”?
  • Merge ๋Œ€์ƒ ๋ธŒ๋žœ์น˜๊ฐ€ ์˜ฌ๋ฐ”๋ฅธ๊ฐ€์š”?
  • PR๊ณผ ๊ด€๋ จ ์—†๋Š” ์ž‘์—…์ด ์žˆ์ง€๋Š” ์•Š๋‚˜์š”?
  • ์ด ์ž‘์—…์œผ๋กœ ์ธํ•ด ๋ฐœ์ƒํ•œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด Resource ์„œ๋ฒ„์—๋„ ๋ฐ˜์˜๋˜์—ˆ๋‚˜์š”?

๐ŸŽธ ๊ธฐํƒ€

Copy link
Contributor

@KimTaeO KimTaeO left a comment

Choose a reason for hiding this comment

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

ํ˜„์žฌ SignUpํ•˜๋Š” ๋กœ์ง์—์„œ๋„ userRole์„ ์ €์žฅํ•˜๋Š”๋ฐ
์ด ๋ถ€๋ถ„์„ ์‚ญ์ œํ•˜๋Š” ๊ฒƒ์ด ์–ด๋–จ๊นŒ์š”?
SignUpService

Comment on lines 31 to 47
private fun acceptStudent(id: Long, acceptUserReqDto: AcceptUserReqDto) {
val user = acceptUserReqDto.toStudentEntity(getUser(id))
saveUserRole(user, acceptUserReqDto.userRoleType)
userRepository.save(user)
}

private fun acceptTeacher(id: Long, acceptUserReqDto: AcceptUserReqDto) {
val user = acceptUserReqDto.toTeacherEntity(getUser(id))
saveUserRole(user, acceptUserReqDto.userRoleType)
userRepository.save(user)
}

private fun acceptGraduate(id: Long, acceptUserReqDto: AcceptUserReqDto) {
val user = acceptUserReqDto.toGraduateEntity(getUser(id))
saveUserRole(user, acceptUserReqDto.userRoleType)
userRepository.save(user)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

์ค‘๋ณต๋˜๋Š” ๋กœ์ง์€ ๋ฐ–์œผ๋กœ ๋นผ์„œ ์ค‘๋ณต์„ ์—†์•จ ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ์š”

Copy link
Contributor Author

Choose a reason for hiding this comment

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

4418f09
saveUser ์ถ”๊ฐ€ํ•˜์—ฌ ์ค‘๋ณต์„ ์ตœ์†Œํ™”ํ–ˆ์–ด์š”!

@Umjiseung
Copy link
Contributor Author

Umjiseung commented May 1, 2024

15656dd

15656dd

์ €๋„ ๋ถˆํ•„์š”ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ์‚ญ์ œํ•˜์˜€์–ด์š”

Copy link
Contributor

@KimTaeO KimTaeO left a comment

Choose a reason for hiding this comment

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

์ƒ๊ฐํ•ด๋ณด๋‹ˆ ๋”์ด์ƒ roles ํ•„๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์œผ๋‹ˆ toXXXEntity๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„๋„ ๋  ๊ฒƒ ๊ฐ€์•„์š”
toEntity ํ•จ์ˆ˜๋กœ ํ†ต์ผ์‹œ์ผœ๋„ ๋ฌธ์ œ์—†์ง€ ์•Š์„๊นŒ์š”

@Umjiseung
Copy link
Contributor Author

861e72f

861e72f
2bc2f87
toEntity๋กœ ํ†ต์ผํ•œ ํ›„์— ์ˆ˜์ •ํ–ˆ์–ด์š”!

Comment on lines 31 to 44
private fun acceptStudent(id: Long, acceptUserReqDto: AcceptUserReqDto) {
val user = acceptUserReqDto.toEntity(getUser(id))
saveUser(user, acceptUserReqDto)
}

private fun acceptTeacher(id: Long, acceptUserReqDto: AcceptUserReqDto) {
val user = acceptUserReqDto.toEntity(getUser(id))
saveUser(user, acceptUserReqDto)
}

private fun acceptGraduate(id: Long, acceptUserReqDto: AcceptUserReqDto) {
val user = acceptUserReqDto.toEntity(getUser(id))
saveUser(user, acceptUserReqDto)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

when ์กฐ๊ฑด๋ฌธ ์‚ฌ์šฉํ•  ํ•„์š”๋„ ์—†์–ด์ง€๊ณ  private ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•  ์ด์œ ๋„ ์—†์–ด์ง€๋Š” ๊ฒƒ ๊ฐ™์•„์š”

Copy link
Contributor Author

Choose a reason for hiding this comment

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

8cc83a7
๊ทธ๋Ÿฌ๋„ค์š” ์ˆ˜์ •ํ–ˆ์–ด์š”!

@Umjiseung Umjiseung merged commit 69858d6 into main May 3, 2024
1 check passed
@Umjiseung Umjiseung deleted the 318-membership-userroll-authorization-student-revision branch May 3, 2024 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1๏ธโƒฃPriority: High ์šฐ์„ ์ˆœ์œ„ ์ƒ ๐Ÿž BugFix ๋ฒ„๊ทธ ํ•ด๊ฒฐ
Projects
None yet
2 participants