Skip to content

Comments

[김동규] sprint5#222

Open
redmatoda wants to merge 6 commits intocodeit-bootcamp-spring:김동규from
redmatoda:김동규-sprint3

Hidden character warning

The head ref may contain hidden characters: "\uae40\ub3d9\uaddc-sprint3"
Open

[김동규] sprint5#222
redmatoda wants to merge 6 commits intocodeit-bootcamp-spring:김동규from
redmatoda:김동규-sprint3

Conversation

@redmatoda
Copy link
Collaborator

요구사항

기본

  • 스프린트 미션#4에서 구현한 API를 RESTful API로 다시 설계해보세요.
  • Postman을 활용해 컨트롤러를 테스트 하세요.
  • springdoc-openapi를 활용하여 Swagger 기반의 API 문서를 생성하세요.
  • Swagger-UI를 활용해 API를 테스트해보세요

심화

  • 심화 항목 1

멘토에게

  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

@redmatoda redmatoda requested a review from kwj2435 August 25, 2025 00:06
@ApiResponse(responseCode = "404", description = "사용자를 찾을 수 없음",
content = @Content(examples = @ExampleObject(value = "User with username {username} not found"))),
})
@RequestMapping(value = "/login", method = {RequestMethod.POST})
Copy link
Collaborator

Choose a reason for hiding this comment

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

RequestMapping 대신 GetMapping ,PostMapping 사용도 한번 고려해보시면 좋을것 같아요 :)

content = @Content(examples = @ExampleObject(value = ("Channel with id {channelId} not found")))),
})
@RequestMapping(path = "/{channelId}",
method = RequestMethod.PATCH)
Copy link
Collaborator

Choose a reason for hiding this comment

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

google java 코딩 컨벤션을 기준으로 한줄에 100글자가 넘지 않을 경우 특별히 개행 하지 않으시는게 가독성 측면에서 더 좋습니다 :) 현재는 너무 잦은 개행으로 한눈에 코드 보기가 쉽지 않은것 같아요!

}

@RequestMapping(
path = "/{userId}/userStatus",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rest API 설계 권장 사항에 따르면 url에는 카멜케이스 사용이 필요할 경우 - (하이픈)으로 단어를 나누도록 권장하고 있어요!

userStatus 대신 user-status 가 좀더 알맞은 규격이에요!

import java.time.LocalDateTime;
import java.util.UUID;

public class BaseEntity implements Serializable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lombok 으로 대신 처리가 가능할것 같아요!
더불어 최근 추세는 Setter 사용을 자제하는 추세에요! 참고하시면 좋을것 같아요!

Setter 사용을 지양해야 하는 이유는 아래 블로그글을 참고해보세요

https://octoping.tistory.com/33

public ResponseEntity<String> handleException(Exception e) {
return ResponseEntity.status(500).body(e.getMessage());
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

ExceptionHandler에서 의도치 않은 예외를 처리해야할경우 (ex. exception)
에러 내용을 콘솔창에 로깅될 수 있도록 해주면 좋아요
일반적을 Slf4j를 사용하지만 여의치 않다면 e.printstacktrace()를 System.out.println()으로 로깅되도록 해두시는게 좋아요!

@kwj2435
Copy link
Collaborator

kwj2435 commented Aug 27, 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.

2 participants