Skip to content

Comments

[박지은] sptint4#72

Open
clover6559 wants to merge 49 commits intocodeit-bootcamp-spring:박지은from
clover6559:박지은-sptint4

Hidden character warning

The head ref may contain hidden characters: "\ubc15\uc9c0\uc740-sptint4"
Open

[박지은] sptint4#72
clover6559 wants to merge 49 commits intocodeit-bootcamp-spring:박지은from
clover6559:박지은-sptint4

Conversation

@clover6559
Copy link
Collaborator

@clover6559 clover6559 commented Feb 13, 2026

요구사항

기본

  • 웹 API를 구현 (@RequestMapping만 사용)
  • 웹 API의 예외를 전역으로 처리
  • Postman을 활용해 컨트롤러 테스트

심화

  • 사용자 목록 조회
  • BinaryContent 파일 조회
  • 사용자 목록 화면 서빙

스크린샷

사용자목록

멘토에게

사용자 등록, 정보 수정, 삭제, 모든 사용자 조회 기능 포함
    채널 생성, 수정, 삭제, 특정 사용자 기준 조회 기능 포함
    메세지 생성, 수정, 삭제, 특정 채널 기준 조회 기능 포함
    수신정보 생성, 수정, 사용자 기준 조회 기능 포함
    하나 또는 여러개 조회 기능 포함
- 유저 생성 및 정보 수정 API 정상 동작 확인
- 유저 상태(Status) 수정 로직 테스트 및 매핑 오류 해결
- Postman Scripts를 활용한 userId 자동 변수 처리 적용
- 채널 생성 및 정보 수정 API 정상 동작 확인
- 유저별 채널 조회 로직 테스트 및 매핑 오류 해결
- Postman Scripts를 활용한 channelId 자동 변수 처리 적용
- 메세지 생성 및 정보 수정 API 정상 동작 확인
- 채널별 메세지 조회 로직 테스트 및 매핑 오류 해결
- Postman Scripts를 활용한 messageId 자동 변수 처리 적용
- 이미지 생성 및 조회 API 정상 동작 확인
- 로그인 로직 테스트 및 매핑 오류 해결
- Postman Scripts를 활용한 binaryContentId 자동 변수 처리 적용
- @RestControllerAdvice를 적용한 GlobalExceptionHandler 추가
- 에러 응답 표준화를 위한 ErrorResponse DTO 생성
- UserController: findAll 경로 추가 및 유저 생성 시 profileId 누락 로직 수정
- BinaryContentController: 이미지 조회 파라미터를 @RequestParam으로 변경
@joonfluence
Copy link

커밋 메세지에 대한 규칙을 컨벤션으로 잘 작성해주셨네요~ 👍
참고 https://www.conventionalcommits.org/ko/v1.0.0/

Comment on lines +10 to +14
@RestController
@RequestMapping("/auth")
@RequiredArgsConstructor
public class AuthController {
private final AuthService authService;

Choose a reason for hiding this comment

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

v1 버저닝을 추가 해주는 것도 좋습니다 (계속 버전이 변화될 수 있기 때문에) 나중에 추가하긴 어렵거든요

Comment on lines +20 to +26
public ResponseEntity<User> login(
@RequestBody LoginDto loginDto

) {
User login = authService.login(loginDto);
return ResponseEntity.ok(login);
}

Choose a reason for hiding this comment

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

지금 Entity 바로 반환하고 있는데 ResponseDto 만들어서 반환하는게 좋긴 해요. 그 이유에 대해선 한번 AI에 물어봐보세요!

Comment on lines +18 to +41
@RequestMapping(
path = "/findAll",
method = RequestMethod.GET
)
public ResponseEntity<List<BinaryContent>> findAll(
@RequestParam ("ids") List<UUID> uuidList
){
if (uuidList == null || uuidList.isEmpty()) {
return ResponseEntity.badRequest().build();
}
List<BinaryContent> binaryContents = binaryContentService.findAllByIdIn(uuidList);
return ResponseEntity.ok(binaryContents);
}

@RequestMapping(
path = "/find",
method = RequestMethod.GET
)
public ResponseEntity<BinaryContent> find(
@RequestParam ("binaryContentId") UUID binaryContentId
)throws RuntimeException{
BinaryContent binaryContent = binaryContentService.find(binaryContentId);
return ResponseEntity.ok(binaryContent);
}

Choose a reason for hiding this comment

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

RESTFul API에서 GET이 이미 자원에 대한 조회의 의미를 내포하기 때문에 /find 굳이 추가할 필요 없습니다!

Comment on lines +25 to +53
@RequestMapping(
path = "/create/public",
method = RequestMethod.POST
)
public ResponseEntity<Channel> createPublic(
@RequestBody CreatePublicRequest request
) {
UserFind user = userService.find(request.userId());
CreatePublic createPublic = new CreatePublic(request.channelName(), request.description(), user);
Channel channel = channelService.create(createPublic);
return ResponseEntity.status(HttpStatus.CREATED)
.body(channel);
}

@RequestMapping(
path = "/create/private",
method = RequestMethod.POST
)
public ResponseEntity<Channel> createPrivate(
@RequestBody CreatePrivateRequest request
) {
UserFind user = userService.find(request.userId());
UUID creatorId = request.creatorId();

CreatePrivate createPrivate = new CreatePrivate(creatorId, user);
Channel channel = channelService.create(createPrivate);
return ResponseEntity.status(HttpStatus.CREATED)
.body(channel);
}

Choose a reason for hiding this comment

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

과제에서 요구사항 대로 하신 것 같아 이해하지만, [POST] "/api/channels/public, private" private, public을 Body 값 안에 넣어서 처리하는 방식이 더 깔끔할 것 같긴 합니다. 정말 분리되어야 하면 모르겠지만 거의 구현 코드가 비슷할거거든요

Copy link

@joonfluence joonfluence left a comment

Choose a reason for hiding this comment

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

LGTM

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