Skip to content

๐Ÿš€ 3๋‹จ๊ณ„ - ์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ฆฌ#970

Closed
janeljs wants to merge 19 commits intonext-step:janeljsfrom
janeljs:step3
Closed

๐Ÿš€ 3๋‹จ๊ณ„ - ์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ฆฌ#970
janeljs wants to merge 19 commits intonext-step:janeljsfrom
janeljs:step3

Conversation

@janeljs
Copy link
Copy Markdown

@janeljs janeljs commented Jul 29, 2023

์†ก์šฉ์ฃผ ๋ฆฌ๋ทฐ์–ด๋‹˜ ์•ˆ๋…•ํ•˜์„ธ์š”~
๋ฆฌ๋ทฐ์ด ์ž„์ง€์„ ์ž…๋‹ˆ๋‹ค.

3๋‹จ๊ณ„ - ์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ฆฌ ๋ฆฌ๋ทฐ ์š”์ฒญ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

ํ•œ ๋™์•ˆ ๋ฐ”๋น ์„œ ์•„์˜ˆ ๋ฏธ์…˜์„ ๋ชปํ•˜๋‹ค๊ฐ€ ๋Šฆ๊ฒŒ๋‚˜๋งˆ ์กฐ๊ธˆ์”ฉ ํ•ด๋ณด๋ ค๊ณ  PR ๋ณด๋ƒ…๋‹ˆ๋‹ค ๐Ÿ˜ญ
์ €๋ฒˆ์— ๋‹ต๋ณ€์ฃผ์‹  ์ฝ”๋ฉ˜ํŠธ๋“ค ๋„์›€์ด ๋งŽ์ด ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
์ด๋ฒˆ ๋‹จ๊ณ„๋„ ๋ฆฌ๋ทฐ ์ž˜ ๋ถ€ํƒ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค~! ๐Ÿ˜„

Copy link
Copy Markdown
Member

@testrace testrace left a comment

Choose a reason for hiding this comment

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

์•ˆ๋…•ํ•˜์„ธ์š” ๐Ÿ˜ƒ
3๋‹จ๊ณ„ ๊น”๋”ํ•˜๊ฒŒ ์ž˜ ๊ตฌํ˜„ํ•ด ์ฃผ์…จ๋„ค์š” ๐Ÿ‘
๋ช‡ ๊ฐ€์ง€ ์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒผ๋Š”๋ฐ ํ™•์ธํ•ด ์ฃผ์‹œ๊ณ  ๋‹ค์‹œ ๋ฆฌ๋ทฐ ์š”์ฒญํ•ด ์ฃผ์„ธ์š”

Comment thread build.gradle Outdated
testImplementation 'io.rest-assured:rest-assured:4.5.1'
testImplementation 'com.navercorp.fixturemonkey:fixture-monkey-starter:0.5.8'
testImplementation 'com.google.guava:guava:16+'
testImplementation 'org.mockito:mockito-core'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์˜์กด์„ฑ์ด ์ถ”๊ฐ€๋˜์—ˆ๋„ค์š” ๐Ÿ‘€

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

์‚ญ์ œํ•˜์˜€์Šต๋‹ˆ๋‹ค~! 348513e

import java.util.List;
import java.util.stream.Stream;

public class Sections {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

์ผ๊ธ‰ ์ปฌ๋ ‰์…˜ ํ™œ์šฉ ๐Ÿ‘

Comment on lines +23 to +32
public void validateUpStationId(Line line) {
if (!Objects.equals(upStationId, line.getTerminalStationId())) {
throw new InvalidSectionRequestException("ํ•ด๋‹น ๋…ธ์„ ์˜ ํ•˜ํ–‰์ข…์ ์—ญ์ด ์•„๋‹Œ ์—ญ์ด ์ƒํ–‰์—ญ์œผ๋กœ ์„ค์ •๋˜์—ˆ์Šต๋‹ˆ๋‹ค.",
Map.of(
"lineId", line.getId().toString(),
"upStationId", upStationId.toString(),
"downStationId", downStationId.toString()
));
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๋„๋ฉ”์ธ ๋กœ์ง์ด DTO์— ํฌํ•จ๋œ ๊ฒƒ ๊ฐ™์•„์š”
CreateSectionRequest๋ฅผ ํ™œ์šฉํ•˜์ง€ ์•Š๊ณ  ๊ตฌ๊ฐ„์„ ์ถ”๊ฐ€ํ•œ๋‹ค๋ฉด ๊ตฌ๊ฐ„ ์ถ”๊ฐ€ ์ œ์•ฝ์„ ๋ฌด์‹œํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜๋Š”๋ฐ์š”
๊ตฌ๊ฐ„์„ ์ถ”๊ฐ€ํ•  ๋•Œ Sectios ๋‚ด๋ถ€์—์„œ ๊ฒ€์ฆ์ด ์ด๋ค„์ ธ์•ผํ•˜์ง€ ์•Š์„๊นŒ์š”?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ํ—› ๋งž๋„ค์š”ใ… ใ…  ๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ–ˆ์Šต๋‹ˆ๋‹ค~! ๋•๋ถ„์— ์ฝ”๋“œ๊ฐ€ ํ›จ์”ฌ ๊น”๋”ํ•ด์กŒ๋„ค์š” ๐Ÿ˜„ 63c094a

Comment on lines +67 to +69
if (!line.getTerminalStationId().equals(stationId)) {
throw new InvalidSectionRequestException("๋งˆ์ง€๋ง‰ ๊ตฌ๊ฐ„๋งŒ ์‚ญ์ œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.");
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

getter๋ฅผ ํ™œ์šฉํ•ด ๋น„๊ตํ•˜๊ธฐ ๋ณด๋‹ค line์—๊ฒŒ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ด๋ฉด ์–ด๋–จ๊นŒ์š”?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ–ˆ์Šต๋‹ˆ๋‹คใ…Žใ…Ž 63c094a

public class StationResponse {
private final Long id;
private final String name;
public record StationResponse(Long id, String name) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๋‹ค๋ฅธ DTO์™€ ๋‹ค๋ฅด๊ฒŒ record๋ฅผ ์‚ฌ์šฉํ•˜์‹  ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค ๐Ÿค”

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

์ด๊ฑฐ ์ธํ…”๋ฆฌ์ œ์ด๊ฐ€ ์ถ”์ฒœํ•ด์ฃผ๊ธธ๋ž˜ ํ˜ธ๊ธฐ์‹ฌ์— ํ•œ ๋ฒˆ ์จ๋ดค์Šต๋‹ˆ๋‹ค ๐Ÿ˜†

Comment on lines +10 to +12
List<Section> findAllByLine_Id(Long lineId);

Optional<Section> findByLine_IdAndDownStation_Id(Long lineId, Long downStationId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๋ฉ”์„œ๋“œ๋ช… ์ปจ๋ฒค์…˜์ด ๋งž์ง€ ์•Š์€ ๊ฒƒ ๊ฐ™์•„์š” ๐Ÿ˜ข

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

camelCase๊ฐ€ ์•„๋‹ˆ๊ธฐ๋Š” ํ•œ๋ฐ ์ž๋™์™„์„ฑ ์ถ”์ฒœ ์ด๋ฆ„์— _๊ฐ€ ์žˆ๊ณ , ๊ฐ€๋…์„ฑ์ด ์กฐ๊ธˆ ์ข‹์•„์ง€๋Š” ์ธก๋ฉด๋„ ์žˆ๋Š” ๊ฒƒ ๊ฐ™์•„์„œ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.
์ œ๊ฐ€ ์‹ค๋ฌด์—์„œ๋Š” ์ฃผ๋กœ ๋งˆ์ด๋ฐ”ํ‹ฐ์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ž˜ ๋ชจ๋ฅด๋Š”๋ฐ ๋ณดํ†ต์€ camelCase๋ฅผ ์‚ฌ์šฉํ•˜๋‚˜์š”?
(querydsl ๋ฉ”์„œ๋“œ๋‚˜ ๋‹ค๋ฅธ ๋ฉ”์„œ๋“œ์™€ ํ†ต์ผ์„ฑ์„ ์ƒ๊ฐํ•˜๋ฉด ๊ทธ๊ฒŒ ๋งž๋Š” ๊ฑฐ ๊ฐ™๊ธฐ๋„ ํ•˜๋„ค์š”ใ…Žใ…Ž)

image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Optional<Section> findByLineIdAndDownStationId(Long lineId, Long downStationId);์ฒ˜๋Ÿผ ๊ณ ์น˜๋‹ˆ๊นŒ Unable to locate Attribute with the the given name [downStationId] on this ManagedType [subway.common.BaseEntity] ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ๋ฌธ์ œ๋„ ์žˆ๋„ค์š”. _๊ฐ€ ์—†์œผ๋ฉด Station downStation ๋‚ด๋ถ€์˜ id๋กœ ์ธ์‹์„ ๋ชปํ•˜๋Š” ๊ฒƒ ๊ฐ™์•„์š”. ๐Ÿ˜ข

Comment on lines +48 to +55
Section section = Section.builder()
.line(line)
.upStation(upStation)
.downStation(downStation)
.distance(createSectionRequest.getDistance())
.build();

Section savedSection = sectionRepository.save(section);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Line#addSection ๋ฅผ ํ™œ์šฉํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ–ˆ์Šต๋‹ˆ๋‹ค~ 63c094a

Comment on lines +55 to +56
assertThat(getResponse.jsonPath().getList("upStationId", Long.class)).containsAnyOf(์‹ ๋ถ„๋‹น์„ _ํ•˜ํ–‰์ข…์ ์—ญ_ID);
assertThat(getResponse.jsonPath().getList("downStationId", Long.class)).containsAnyOf(์‹ ๋ถ„๋‹น์„ _์‹ ๊ทœ์—ญ_ID);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

์‹ ๊ทœ ํ•˜ํ–‰ ์ข…์ ์—ญ์„ ์ถ”๊ฐ€ํ•œ ๊ฒฝ์šฐ ์‹ ๊ทœ์—ญ์ด ๊ตฌ๊ฐ„์— ํฌํ•จ๋˜์–ด ์žˆ๋‹ค๋Š” ๊ฒƒ๋ณด๋‹ค ํ•˜ํ–‰ ์ข…์ ์—ญ์ž„์„ ๊ฒ€์ฆํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”?
containsExactly ๋ฅผ ํ™œ์šฉํ•ด์„œ ์—ญ ๋ชฉ๋ก ์ˆœ์„œ๋ฅผ ๊ฒ€์ฆํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์€๋ฐ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”?

Copy link
Copy Markdown
Author

@janeljs janeljs Jul 30, 2023

Choose a reason for hiding this comment

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

assertThat(getResponse.jsonPath().getList("upStationId", Long.class)).containsExactly(์‹ ๋ถ„๋‹น์„ _์ƒํ–‰์ข…์ ์—ญ_ID, ์‹ ๋ถ„๋‹น์„ _ํ•˜ํ–‰์ข…์ ์—ญ_ID);
assertThat(getResponse.jsonPath().getList("downStationId", Long.class)).containsExactly(์‹ ๋ถ„๋‹น์„ _ํ•˜ํ–‰์ข…์ ์—ญ_ID, ์‹ ๋ถ„๋‹น์„ _์‹ ๊ทœ์—ญ_ID);
assertThat(getResponse.jsonPath().getList("distance")).containsExactly(10, 5);

๋ง์”€ํ•˜์‹ ๋Œ€๋กœ ์œ„์ฒ˜๋Ÿผ ์ž‘์„ฑํ•ด๋ณด์•˜๋Š”๋ฐ ์ดํ•ดํ•˜๋ ค๋ฉด 3์ดˆ ์ •๋„ ๋ฒ„ํผ๋ง์ด ๊ฑธ๋ฆฌ๋Š” ๊ฒƒ ๊ฐ™๊ธฐ๋„ ํ•ด์„œ ์•„์˜ˆ ์ƒˆ๋กœ ์ƒ์„ฑ๋œ ๊ตฌ๊ฐ„๋งŒ isEqualTo()๋กœ ๊ฒ€์ฆํ•˜๋„๋ก ์ˆ˜์ •ํ•ด๋ณด์•˜์Šต๋‹ˆ๋‹ค! eb8b58c

assertThat(sectionResponse.getUpStationId()).isEqualTo(์‹ ๋ถ„๋‹น์„ _ํ•˜ํ–‰์ข…์ ์—ญ_ID);
assertThat(sectionResponse.getDownStationId()).isEqualTo(์‹ ๋ถ„๋‹น์„ _์‹ ๊ทœ์—ญ_ID);
assertThat(sectionResponse.getDistance()).isEqualTo(5);

Comment on lines +60 to +62
@Nested
@DisplayName("์ƒˆ๋กœ์šด ๊ตฌ๊ฐ„ ๋“ฑ๋ก ์‹คํŒจ")
class CreateSectionWithInvalidRequest {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

์˜ˆ์™ธ ํ…Œ์ŠคํŠธ ๐Ÿ‘

@janeljs janeljs requested a review from testrace July 30, 2023 08:00
- null ์ฒดํฌ ์ถ”๊ฐ€
- color ์—…๋ฐ์ดํŠธ ์ถ”๊ฐ€
Copy link
Copy Markdown
Member

@testrace testrace 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 +35 to +42
public void add(Section section) {
if (!sections.isEmpty()) {
validateUpStationId(section);
validateDownStationId(section);
validateDistance(section);
}

sections.add(section);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๊ตฌ๊ฐ„ ๋“ฑ๋ก ๊ธฐ๋Šฅ์ฒ˜๋Ÿผ ๊ตฌ๊ฐ„ ์ œ๊ฑฐ ๋ฉ”์„œ๋“œ๋„ ์ถ”๊ฐ€ํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ–ˆ์Šต๋‹ˆ๋‹ค!ใ…Žใ…Ž eb1ecaf

}

public List<SectionResponse> findSections(Long lineId) {
List<Section> sections = sectionRepository.findAllByLine_Id(lineId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๋…ธ์„ ์— ํฌํ•จ๋œ ๊ตฌ๊ฐ„๋“ค์„ line ๊ฐ์ฒด๋ฅผ ํ™œ์šฉํ•ด์„œ ๊ฐ€์ ธ์˜ฌ ์ˆ˜๊ฐ€ ์žˆ๋Š”๋ฐ์š”
sectionRepository ๋Œ€์‹  line ๊ฐ์ฒด๋ฅผ ํ™œ์šฉํ•ด์„œ ๊ตฌ๊ฐ„ ๋ชฉ๋ก์„ ์กฐํšŒํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”?

Suggested change
List<Section> sections = sectionRepository.findAllByLine_Id(lineId);
Line line = findLineById(lineId);
List<Section> sections = line.getSections();

Comment on lines +101 to +120
public void deleteSection(Long lineId, Long stationId) {
Line line = findLineById(lineId);

if (line.hasLessThanTwoSections()) {
throw new InvalidSectionRequestException("๊ตฌ๊ฐ„์ด 2๊ฐœ ์ด์ƒ์ผ ๋•Œ๋งŒ ์‚ญ์ œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.");
}

if (!line.isTerminalStationId(stationId)) {
throw new InvalidSectionRequestException("๋งˆ์ง€๋ง‰ ๊ตฌ๊ฐ„๋งŒ ์‚ญ์ œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.");
}

Section section = sectionRepository.findByLine_IdAndDownStation_Id(lineId, stationId)
.orElseThrow(() -> new NotFoundException(
Map.of(
"lineId", lineId.toString(),
"stationId", stationId.toString()
)));

sectionRepository.delete(section);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

addSection ๋ฉ”์„œ๋“œ์ฒ˜๋Ÿผ line ์„ ์กฐํšŒํ•œ ํ›„์— ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ด์„œ ๊ตฌ๊ฐ„์„ ์‚ญ์ œํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”?
์‚ญ์ œ ๊ธฐ๋Šฅ์ด๋‹ˆ @Transactional๋„ ์ถ”๊ฐ€๋˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”
line.deleteSection(stationId);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ–ˆ์Šต๋‹ˆ๋‹ค!ใ…Žใ…Ž eb1ecaf

Comment on lines +57 to +59
assertThat(sectionResponse.getUpStationId()).isEqualTo(์‹ ๋ถ„๋‹น์„ _ํ•˜ํ–‰์ข…์ ์—ญ_ID);
assertThat(sectionResponse.getDownStationId()).isEqualTo(์‹ ๋ถ„๋‹น์„ _์‹ ๊ทœ์—ญ_ID);
assertThat(sectionResponse.getDistance()).isEqualTo(5);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

์‚ฌ์‹ค ๋ณ€๊ฒฝ ์ „๊ณผ ๋‹ค๋ฅด์ง€ ์•Š๋‹ค๊ณ  ์ƒ๊ฐ๋“ค์–ด์š” ๐Ÿ˜…
์ธ์ˆ˜ ํ…Œ์ŠคํŠธ๋Š” ๋ธ”๋ž™๋ฐ•์Šค ํ…Œ์ŠคํŠธ์ด๋‹ˆ ํ•˜๋‚˜ ํ•˜๋‚˜์˜ ๊ตฌ๊ฐ„์ด ์–ด๋–ป๊ฒŒ ๊ตฌ์„ฑ๋˜์—ˆ๋Š”์ง€ ๊ด€์‹ฌ ์žˆ๊ธฐ ๋ณด๋‹ค
๊ตฌ๊ฐ„์ด ์ถ”๊ฐ€๋˜์—ˆ์„ ๋•Œ ๋…ธ์„ ์ด ๊ฐ€์ง€๋Š” ์ „์ฒด ์—ญ ๋ชฉ๋ก์ด ์›ํ•˜๋Š”๋Œ€๋กœ(์ˆœ์„œ๋Œ€๋กœ) ๊ตฌ์„ฑ๋˜์—ˆ๋Š”์ง€๊ฐ€ ๋” ๊ด€์‹ฌ์ด ํฌ๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ํ”ผ๋“œ๋ฐฑ ๋“œ๋ ธ์—ˆ๋Š”๋ฐ์š”
๋…ธ์„ ์— A-B-C ์—ญ์ด ์žˆ์„ ๋•Œ ํ•˜ํ–‰์—ญ(C-D ๊ตฌ๊ฐ„)์„ ์ถ”๊ฐ€ํ•˜๋ฉด ๋…ธ์„ ์˜ ์ „์ฒด ์—ญ ๋ชฉ๋ก์„ A-B-C-D๊ฐ€ ๋˜์—ˆ์Œ์„ ๊ฒ€์ฆํ•˜๋ฉด
์ธ์ˆ˜ ํ…Œ์ŠคํŠธ๋ฅผ ์ฝ๋Š” ์ž…์žฅ์—์„œ ๊ตฌ๊ฐ„ ์ถ”๊ฐ€ ๊ธฐ๋Šฅ์„ ๋น ๋ฅด๊ฒŒ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š”

@Column(length = 20, nullable = false)
private String name;

@Setter
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

setter๋ฅผ ์ œ๊ณตํ•˜๊ธฐ ๋ณด๋‹ค update or modify ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•˜๊ณ 
๋ฉ”์„œ๋“œ ๋‚ด๋ถ€์—์„œ ๊ฐ’์„ ์ˆ˜์ •ํ•˜๋„๋ก ํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”?

Comment on lines +64 to +65
setIfNotNull(modifyLineRequest.getName(), line::setName);
setIfNotNull(modifyLineRequest.getColor(), line::setColor);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

setIfNotNull ๋ฉ”์„œ๋“œ๋ฅผ ๊ฑฐ์น˜์ง€ ์•Š๊ณ  line ์˜ ๊ฐ’์„ ๋ณ€๊ฒฝํ•˜๋ฉด ๋„๋ฉ”์ธ์˜ ์ œ์•ฝ์‚ฌํ•ญ์ด ์ง€์ผœ์ง€์ง€ ์•Š์„ ๊ฒƒ ๊ฐ™์•„์š”
null ์ฒดํฌ๋ฅผ line ๋‚ด๋ถ€์—์„œ ๊ฒ€์ฆํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”?

@janeljs janeljs closed this Mar 2, 2026
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.

2 participants