Skip to content

[5주차 과제] 이정민 과제 제출합니다.#13

Open
vvemma wants to merge 2 commits intoCAUSWICT-EDU:vvemmafrom
vvemma:vvemma
Open

[5주차 과제] 이정민 과제 제출합니다.#13
vvemma wants to merge 2 commits intoCAUSWICT-EDU:vvemmafrom
vvemma:vvemma

Conversation

@vvemma
Copy link

@vvemma vvemma commented Nov 20, 2025

과제 세부사항은 노션에 정리해두었습니다.

https://www.notion.so/5-2b13d138d33c805ab4f7fdc27bff2ceb?source=copy_link

@vvemma vvemma changed the title [5주차 과제제출] 이정민 [5주차 과제] 이정민 과제 제출합니다. Nov 20, 2025
Post created = postService.create(title, content, userId);
return ResponseEntity.status(HttpStatus.CREATED).body(created);
} catch (IllegalArgumentException e) {
return ResponseEntity.badRequest().body(Map.of("error", e.getMessage()));

Choose a reason for hiding this comment

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

ResponseEntity를 활용하여 예외 발생 시 보낼 응답에 대해서도 설계하신 점이 좋다고 생각합니다.


return created;
// Search
@GetMapping("/search")

Choose a reason for hiding this comment

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

REST 원칙 상 URI에 동사 사용은 지양해야 하는 것으로 알고 있습니다. @GetMapping으로 수정하여 query string으로 접근할 수 있도록 하는게 좋을 것 같습니다.

@JoinColumn(name = "post_id", nullable = false)
private Post post;

public Comment() {

Choose a reason for hiding this comment

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

다른 엔티티도 마찬가지로 빌더 패턴을 쓰지 않고 생성자를 사용하는 특별한 이유가 있는지 궁금합니다.

Choose a reason for hiding this comment

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

.gitignore에 application.properties 추가해주셔야 할듯합니다.

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