-
Notifications
You must be signed in to change notification settings - Fork 1
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
๐ :: ํ์๊ฐ์ ์๋ฝ์์ UserRole ์ถ๊ฐ #319
Conversation
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.
ํ์ฌ SignUpํ๋ ๋ก์ง์์๋ userRole์ ์ ์ฅํ๋๋ฐ
์ด ๋ถ๋ถ์ ์ญ์ ํ๋ ๊ฒ์ด ์ด๋จ๊น์?
SignUpService
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) | ||
} |
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.
์ค๋ณต๋๋ ๋ก์ง์ ๋ฐ์ผ๋ก ๋นผ์ ์ค๋ณต์ ์์จ ์ ์์ง ์์๊น์
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.
4418f09
saveUser ์ถ๊ฐํ์ฌ ์ค๋ณต์ ์ต์ํํ์ด์!
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.
์๊ฐํด๋ณด๋ ๋์ด์ roles ํ๋๋ฅผ ์ฌ์ฉํ์ง ์์ผ๋ toXXXEntity๋ฅผ ์ฌ์ฉํ์ง ์์๋ ๋ ๊ฒ ๊ฐ์์
toEntity ํจ์๋ก ํต์ผ์์ผ๋ ๋ฌธ์ ์์ง ์์๊น์
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) | ||
} |
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.
when ์กฐ๊ฑด๋ฌธ ์ฌ์ฉํ ํ์๋ ์์ด์ง๊ณ private ํจ์๋ฅผ ์ฌ์ฉํ ์ด์ ๋ ์์ด์ง๋ ๊ฒ ๊ฐ์์
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.
8cc83a7
๊ทธ๋ฌ๋ค์ ์์ ํ์ด์!
๐ก ๋ฐฐ๊ฒฝ ๋ฐ ๊ฐ์
signUpํ ๋ UserRole์ ํ์์ผ๋ก ๊ณ ์ ํ์ฌ ํ์๊ฐ์ ์๋ฝ ํ์ UserRole์ด ๋ชจ๋ ํ์์ผ๋ก ๋ค์ด๊ฐ๋ ํ์์ด ์ผ์ด๋ ์์ ํ์์ต๋๋ค
Resolves: #318
๐ ์์ ๋ด์ฉ
ํ์๊ฐ์ ์๋ฝ์์ Body๋ก ๋ณด๋ธ UserRoleType์ ์ง์ด๋ฃ์ด ์ต์ข ์ ์ผ๋ก ์ฌ๋ฐ๋ฅธ ๊ถํ์ด ๋ค์ด๊ฐ๊ฒ๋ ํ์์ต๋๋ค
๐โโ๏ธ ๋ฆฌ๋ทฐ๋ ธํธ
โ PR ์ฒดํฌ๋ฆฌ์คํธ
.env
,๋ ธ์
,README
)"API ๊ฐ๋ฐ ์๋ฃ๋์ด์"
,"ํ๊ฒฝ๊ฐ ์ถ๊ฐ๋์์ด์"
)๐ธ ๊ธฐํ