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

Feat/accept student #103

Merged
merged 10 commits into from
Mar 18, 2023
Merged

Feat/accept student #103

merged 10 commits into from
Mar 18, 2023

Conversation

KimTaeO
Copy link
Contributor

@KimTaeO KimTaeO commented Mar 6, 2023

๐Ÿ’ก ๊ฐœ์š”

ํ•™์ƒ ํšŒ์›๊ฐ€์ž… ์ˆ˜๋ฝ api ์ž‘์„ฑ

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

๐Ÿ”€ ๋ณ€๊ฒฝ์‚ฌํ•ญ

๐Ÿ™‹โ€โ™‚๏ธ ์งˆ๋ฌธ์‚ฌํ•ญ

โš—๏ธ ์‚ฌ์šฉ๋ฒ•

๐ŸŽธ ๊ธฐํƒ€

@KimTaeO KimTaeO linked an issue Mar 6, 2023 that may be closed by this pull request
val user = userRepository.findByIdAndStateAndRoles(acceptedStudentReqDto.id, UserState.PENDING, mutableListOf(UserRole.ROLE_STUDENT))
?: throw UserNotFoundException()

user.update(acceptedStudentReqDto.name, acceptedStudentReqDto.grade, acceptedStudentReqDto.classNum, acceptedStudentReqDto.num,acceptedStudentReqDto.gender)
Copy link
Contributor

Choose a reason for hiding this comment

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

saveํ•ด์•ผํ•˜๋Š”๊ฑฐ ์•„๋‹Œ๊ฐ€?

Copy link
Member

Choose a reason for hiding this comment

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

๋”ํ‹ฐ์ฒดํ‚น๋˜๊ธฐ๋Š”ํ•˜๋Š”๋ฐ, ์•„๋ฌด๋ž˜๋„ saveํ•˜๋Š”๊ฒŒ ๋“ ๋“ ํ•˜์ง€ @KimTaeO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

save ํ•˜๊ฒŒ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค
67d33ca

val user = userRepository.findByIdAndStateAndRoles(acceptedStudentReqDto.id, UserState.PENDING, mutableListOf(UserRole.ROLE_STUDENT))
?: throw UserNotFoundException()

userRepository.save(user.update(acceptedStudentReqDto.name, acceptedStudentReqDto.grade, acceptedStudentReqDto.classNum, acceptedStudentReqDto.num,acceptedStudentReqDto.gender))
Copy link
Member

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.

๋„ต ๋ฐ”๊ฟจ์Šต๋‹ˆ๋‹ค
5cca886

Copy link

@siwony siwony 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 7 to 18
@field: NotBlank
val id: Long,
@field: NotBlank
val name: String,
@field: NotBlank
val gender: Gender,
@field: NotBlank
val grade: Int,
@field: NotBlank
val classNum: Int,
@field: NotBlank
val num: Int
Copy link

Choose a reason for hiding this comment

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

@NotBlank๋Š” String type์—์„œ๋งŒ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.

๊ณต์‹๋ฌธ์„œ: https://javaee.github.io/javaee-spec/javadocs/javax/validation/constraints/NotBlank.html

์ถ”๊ฐ€๋กœ non-nullableํƒ€์ž…์—์„œ null์ด request๋กœ ๋ฐ›๋Š”๋‹ค๋ฉด MethodArgumentNotValidException๊ฐ€ ์•„๋‹Œ ๋‹ค๋ฅธ exception์ด ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค (์˜ค๋ž˜๋˜์„œ ๊ธฐ์–ต์ด ์ž˜ ์•ˆ๋‚˜๋„ค์š”)

Copy link

Choose a reason for hiding this comment

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

์ž‘๋…„์— hirecruit๋ผ๋Š” ํ”„๋กœ์ ํŠธ๋ฅผ ํ–ˆ์—ˆ๋Š”๋ฐ ์ €๋„ kotlin์—์„œ ๊พธ์—ญ๊พธ์—ญ bean validator ์ป๋˜ ๊ธฐ์–ต์ด ์žˆ๋„ค์š” ์ฐธ๊ณ ํ•˜์„ธ์š”~

https://github.com/themoment-team/HiRecruit-server/blob/master/src/main/java/site/hirecruit/hr/domain/company/dto/CompanyDto.kt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

์ผ๋‹จ ๊ตฌ๊ฒฝ์˜ค์‹œ๊ณ , ๋ฆฌ๋ทฐ๋„ ๋‹ฌ์•„์ฃผ์…จ๋Š”๋ฐ ์ถ”ํ•œ ๋ชจ์Šต ๋ณด์—ฌ๋“œ๋ฆฌ๊ณ  ๋ฆฌ๋ทฐ ์ฝ”๋ฉ˜ํŠธ๋„ ๋Šฆ๊ฒŒ ๋‹จ ์  ๋ถ€๋„๋Ÿฝ๋„ค์š” ๊ทธ๋ž˜๋„ ์ด๋ฒˆ ๊ธฐํšŒ๋กœ ๊ฒ€์ฆ ์–ด๋…ธํ…Œ์ด์…˜ ์†Œํ™€์ด ์ž‘์„ฑ ํ•  ์ผ ์—†์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค..ใ…‹ใ…‹ ์žฌ๋ฐŒ๋Š” ๊ตฌ๊ฒฝ์ด์—ˆ๊ธธ ๋ฐ”๋ผ๊ฒ ์Šต๋‹ˆ๋‹ท!
e553188

@KimTaeO KimTaeO merged commit 967aaf3 into main Mar 18, 2023
@KimTaeO KimTaeO deleted the feat/accept-student branch March 18, 2023 13:28
@KimTaeO KimTaeO added 0๏ธโƒฃPriority: Critical ์šฐ์„ ์ˆœ์œ„ ๊ธด๊ธ‰ โœจ Feature ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ labels Aug 23, 2023
@KimTaeO KimTaeO self-assigned this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0๏ธโƒฃPriority: Critical ์šฐ์„ ์ˆœ์œ„ ๊ธด๊ธ‰ โœจ Feature ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ํ•™์ƒ ํšŒ์›๊ฐ€์ž… ์ˆ˜๋ฝ api
6 participants