Skip to content

Conversation

@nno0obb
Copy link

@nno0obb nno0obb commented Apr 8, 2025

  • ์ œ๊ฐ€ ์ž˜ ์ดํ•ดํ•˜์ง€ ๋ชปํ•œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค...
  • ์š”๊ตฌ์‚ฌํ•ญ์— ๋งž์ถฐ์„œ ํ…Œ์ŠคํŠธ๊ฐ€ ๋ชจ๋‘ ์—†๋Š” ๊ฒƒ์ด ๋งž์„๊นŒ์š”?
  • ํ•„์š”ํ•˜๋ฉด Repository ์ฝ”๋“œ๋„ ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ์ด ๋งž๋Š” ๊ฑธ๊นŒ์š”?
  • ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์„ ์ œ ๋‚˜๋ฆ„๋Œ€๋กœ ํด๋ž˜์Šค์— ๋„ฃ์–ด๋ณด์•˜๋Š”๋ฐ... ๊ดœ์ฐฎ์€ ๊ฑด์ง€ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค.

CourseCoverImage ๋Š” ์ž์ฒด์ ์œผ๋กœ ์ด๋ฏธ์ง€๋ฅผ ๋„ฃ์–ด์„œ ํ…Œ์ŠคํŠธ ํ•˜๋Š” ๊ฒƒ์ด ๋งž์„๊นŒ์š”?
"Image" ๊ด€๋ จ ์ž๋ฐ” ํด๋ž˜์Šค๊นŒ์ง€ ๊ณต๋ถ€ํ•˜๋Š” ๊ฒƒ์„ ์˜๋„ํ•˜์‹  ๊ฒƒ์ธ์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.

NsUser ์— "func::registerCourse" ๋ฅผ ๋„ฃ์—ˆ๋Š”๋ฐ ์ด ๋ถ€๋ถ„์€ ์–ด๋–ป๊ฒŒ ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด์•ผํ•˜๋Š” ๊ฒƒ์ธ๊ฐ€์š”?
์ง์ ‘ ๊ฐ•์˜, ์œ ์ €, ๋ชจ๋‘ ๋งŒ๋“ค๋ฉด ๋˜๋Š” ๊ฒƒ์ผ๊นŒ์š”?
์ด๋ฅผ ์œ„ํ•ด AttendeeList ๊ฐ€ ๊ผญ ํ•„์š”ํ•ด์ง„๊ฒƒ ๊ฐ™์€๋ฐ ์š”๊ตฌ์‚ฌํ•ญ์—๋Š” ๋ช…์‹œ๋˜์–ด ์žˆ์ง€ ์•Š์ง€๋งŒ ๋‚˜๋ฆ„๋Œ€๋กœ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ๊นŒ์ง€๊ฐ€ ์ด๋ฒˆ ์Šคํ…์˜ ์˜๋„์ผ๊นŒ์š”?

Copy link

@jinyoungchoi95 jinyoungchoi95 left a comment

Choose a reason for hiding this comment

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

์•ˆ๋…•ํ•˜์„ธ์š” ํ™๊ท ๋‹˜ ๐Ÿ˜„

๋ช‡๊ฐ€์ง€ ์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒจ๋‘์—ˆ์œผ๋‹ˆ ํ™•์ธ๋ถ€ํƒ๋“œ๋ ค์š” :)

๊ถ๊ธˆํ•˜๊ฑฐ๋‚˜ ๊ณ ๋ฏผ์ด ๋˜๋Š” ๋ถ€๋ถ„์ด ์žˆ์œผ์‹œ๋‹ค๋ฉด ์–ธ์ œ๋“  pr ์ฝ”๋ฉ˜ํŠธ ๋˜๋Š” dm์œผ๋กœ ์š”์ฒญ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค ๐Ÿ™‡โ€โ™‚๏ธ

Choose a reason for hiding this comment

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

ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€๋‚˜ ์ˆ˜์ •์€ ์ž์œ ๋กญ๊ฒŒ ์ง„ํ–‰ํ•ด์ฃผ์…”๋„ ๋ฉ๋‹ˆ๋‹ค ๐Ÿ˜„

org.gradle.console=plain
org.gradle.java.home=/opt/homebrew/Cellar/openjdk@11/11.0.26/libexec/openjdk.jdk/Contents/Home
org.gradle.java.home=/opt/homebrew/Cellar/openjdk@11/11.0.26/libexec/openjdk.jdk/Contents/Home
# ๋„ต, ์œ„ ์„ค์ •์€ IDE ์—์„œ Java ์‹คํ–‰ ํ™˜๊ฒฝ์„ ์œ„ํ•ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

Choose a reason for hiding this comment

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

์ด๊ฑธ ์„ค์ •ํ•˜๊ฒŒ๋˜๋ฉด gradle์„ ์‹คํ–‰ํ•˜๋Š” ๊ณผ์ •์—์„œ ํ•ด๋‹น path๊ฐ€ ๋น„์–ด์žˆ๋Š” ๋‹ค๋ฅธ ์‚ฌ๋žŒ์˜ ๊ฒฝ์šฐ์—๋Š” ์‹คํ–‰์ด ๋ถˆ๊ฐ€๋Šฅํ•  ๊ฒƒ ๊ฐ™์•„์š”. ์‹ค์ œ ์„œ๋ฒ„์—์„œ๋„ ๋ˆ„๋ฝ๋˜๋ฉด ์‹คํ–‰์ด ๋˜์ง€ ์•Š์„ ๊ฒƒ์ด๊ตฌ์š”.

์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ์‹คํ–‰๊ณผ ๊ด€๋ จ๋œ gradle์„ ์„ค์ •ํ• ๋•Œ๋Š” ๊ฐ€๋Šฅํ•˜๋ฉด ํŠน์ • path์— ์˜์กดํ•˜์ง€ ์•Š๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค :)


import javax.imageio.ImageIO;

public class CourseCoverImage {

Choose a reason for hiding this comment

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

CourseCoverImage ๋Š” ์ž์ฒด์ ์œผ๋กœ ์ด๋ฏธ์ง€๋ฅผ ๋„ฃ์–ด์„œ ํ…Œ์ŠคํŠธ ํ•˜๋Š” ๊ฒƒ์ด ๋งž์„๊นŒ์š”?
"Image" ๊ด€๋ จ ์ž๋ฐ” ํด๋ž˜์Šค๊นŒ์ง€ ๊ณต๋ถ€ํ•˜๋Š” ๊ฒƒ์„ ์˜๋„ํ•˜์‹  ๊ฒƒ์ธ์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.

์ž๋ฐ”ํด๋ž˜์Šค๋ฅผ ํ•™์Šตํ•  ์ •๋„๊นŒ์ง€๋Š” ํ•„์š”์—†๊ณ , ์š”๊ตฌ๋œ ๋‚ด์šฉ์˜ ์ด๋ฏธ์ง€ ๊ด€๋ จ๋œ ๋„๋ฉ”์ธ๋กœ์ง์„ ์ฒ˜๋ฆฌํ•˜๋Š” ์ •๋„๋ฉด ์ถฉ๋ถ„ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค ๐Ÿ˜„

}
}

public void registerCourse(Course course) {

Choose a reason for hiding this comment

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

NsUser ์— "func::registerCourse" ๋ฅผ ๋„ฃ์—ˆ๋Š”๋ฐ ์ด ๋ถ€๋ถ„์€ ์–ด๋–ป๊ฒŒ ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด์•ผํ•˜๋Š” ๊ฒƒ์ธ๊ฐ€์š”?

๋ง์”€ํ•ด์ฃผ์‹  ๋‚ด์šฉ์„ ์ดํ•ด๋ชปํ–ˆ์–ด์š”. NsUser.registerCourse๋ฅผ ํ…Œ์ŠคํŠธํ•˜๋Š” ๊ฒƒ์€ NsUserTest์—์„œ ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋ฅผ ๋งŒ๋“ค์–ด๋ณด๋ฉด ๋˜๋Š” ๊ฒƒ ์•„๋‹๊นŒ์š”?

์กฐ๊ธˆ ๋” ์ž์„ธํ•˜๊ฒŒ ๋ง์”€ํ•ด์ฃผ์‹œ๋ฉด ํ™•์ธํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿ˜„


import nextstep.users.domain.NsUser;

public class AttendeeList {

Choose a reason for hiding this comment

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

์ด๋ฅผ ์œ„ํ•ด AttendeeList ๊ฐ€ ๊ผญ ํ•„์š”ํ•ด์ง„๊ฒƒ ๊ฐ™์€๋ฐ ์š”๊ตฌ์‚ฌํ•ญ์—๋Š” ๋ช…์‹œ๋˜์–ด ์žˆ์ง€ ์•Š์ง€๋งŒ ๋‚˜๋ฆ„๋Œ€๋กœ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ๊นŒ์ง€๊ฐ€ ์ด๋ฒˆ ์Šคํ…์˜ ์˜๋„์ผ๊นŒ์š”?

์š”๊ตฌ์‚ฌํ•ญ์—๋Š” ์–ด๋–ค ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ค์–ด๋ผ๋ผ๋Š” ๊ตฌํ˜„๋‚ด์šฉ์€ ๋ช…์‹œํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ํ™๊ท ๋‹˜์ด ์ƒ๊ฐํ•ด์ฃผ์‹œ๋Š” ๋ฐฉํ–ฅ๋Œ€๋กœ ๊ตฌํ˜„์„ ํ•ด์ฃผ์‹œ๋ฉด ๋˜์–ด์š” :)

Comment on lines +135 to +137
if (course.getAttendees().size() >= course.getMaxAttendees()) {
throw new IllegalArgumentException("๊ฐ•์˜ ์ˆ˜๊ฐ• ์ธ์›์ด ์ดˆ๊ณผ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
}

Choose a reason for hiding this comment

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

์œ ๋ฃŒ ๊ฐ•์˜๋Š” ๊ฐ•์˜ ์ตœ๋Œ€ ์ˆ˜๊ฐ• ์ธ์›์„ ์ดˆ๊ณผํ•  ์ˆ˜ ์—†๋‹ค.

๋ˆ„๊ฐ€ ์ˆ˜๊ฐ•๋“ฑ๋ก์— ๋Œ€ํ•œ ๊ฒƒ์„ ๊ฐ€์ ธ๊ฐ€๋А๋ƒ์— ๋Œ€ํ•œ ๊ฒƒ์„ ๊ณ ๋ฏผํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š” ๐Ÿ˜„

"์ˆ˜๊ฐ•"์ด๋ผ๋Š” ๊ฒƒ์€ ๊ฐ•์˜์— ํšŒ์›์ด ๋“ค์–ด๊ฐ€๋Š” ๊ฒƒ์ด๋ฏ€๋กœ Course์—์„œ ์ˆ˜๊ฐ•ํ•˜๊ณ  ์žˆ๋Š” ์ธ์›์„ ๋“ค๊ณ  ์žˆ๋Š” ๊ฒƒ์ด ๋” ์ž์—ฐ์Šค๋Ÿฝ์ง€ ์•Š์„๊นŒ์š”? ๊ทธ๋Ÿผ Course.๋“ฑ๋ก()์—์„œ๋Š” ์œ ๋ฃŒ๊ฐ•์˜์ธ ๊ฒฝ์šฐ ์ด๋ฏธ ์ˆ˜๊ฐ•์ตœ๋Œ€์ธ์›์ด ๊ฐ€๋“์ฐฌ ์ผ€์ด์Šค์—์„œ ์˜ˆ์™ธ๋ฅผ ํ„ฐํŠธ๋ฆฌ๋„๋ก ํ•ด์ค„ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™๊ตฌ์š” :)

Comment on lines +132 to +134
if (course.getCourseStatus() == CourseStatus.PREPARING) {
throw new IllegalArgumentException("๊ฐ•์˜๊ฐ€ ์ค€๋น„์ค‘์ž…๋‹ˆ๋‹ค.");
}

Choose a reason for hiding this comment

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

์ด๋Ÿฐ ๋กœ์ง๋„ Course์— ๋“ค์–ด๊ฐ€๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!

๊ฐ•์˜์— ๋Œ€ํ•œ ๊ฒ€์ฆ ์ฑ…์ž„ ์ž์ฒด๋ฅผ Course์— ๋„ฃ์–ด์ฃผ๋Š” ๊ฑธ ๊ณ ๋ คํ•ด๋ณด์‹œ๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿ˜„

Comment on lines +18 to +21
private String imageFilePath;
private File imageFile;

private BufferedImage courseCoverImageData;

Choose a reason for hiding this comment

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

Suggested change
private String imageFilePath;
private File imageFile;
private BufferedImage courseCoverImageData;
private final String imageFilePath;
private final File imageFile;
private final BufferedImage courseCoverImageData;

๋ถˆ๋ณ€ํ•  ์ˆ˜ ์žˆ๊ฒ ๋„ค์š”!

}

if (courseCoverImageData.getWidth() < MIN_WIDTH || courseCoverImageData.getHeight() < MIN_HEIGHT) {
throw new IllegalArgumentException("๊ฐ•์˜ ์ปค๋ฒ„ ์ด๋ฏธ์ง€๋Š” ์ตœ์†Œ 300x200 ํ”ฝ์…€ ์ด์ƒ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.");

Choose a reason for hiding this comment

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

์ด๋ฏธ์ง€ ํฌ๊ธฐ๋Š” 1MB ์ดํ•˜์—ฌ์•ผ ํ•œ๋‹ค.

๋„ ์ถ”๊ฐ€๋˜๋ฉด ์ข‹๊ฒ ๋„ค์š” ๐Ÿ˜„

imageFilePath = DEFAULT_IMAGE_FILE_PATH;
}

if (Arrays.stream(SUPPORTED_IMAGE_EXTENSIONS).noneMatch(imageFilePath::endsWith)) {

Choose a reason for hiding this comment

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

๐Ÿ‘

@nno0obb nno0obb closed this by deleting the head repository May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants