Skip to content

Conversation

@HuInDoL
Copy link
Collaborator

@HuInDoL HuInDoL commented May 17, 2025

기본 요구사항

컨트롤러 레이어 구현

  • DiscodeitApplication의 테스트 로직은 삭제하세요.

  • 지금까지 구현한 서비스 로직을 활용해 웹 API를 구현하세요.
    이때 @RequestMapping만 사용해 구현해보세요.

    웹 API 요구사항

  • 웹 API의 예외를 전역으로 처리하세요.

API 테스트

웹 API 요구사항

사용자 관리

  • 사용자를 등록할 수 있다.
  • 사용자 정보를 수정할 수 있다.
  • 사용자를 삭제할 수 있다.
  • 모든 사용자를 조회할 수 있다.
  • 사용자의 온라인 상태를 업데이트할 수 있다.

권한 관리

  • 사용자는 로그인할 수 있다.

채널 관리

  • 공개 채널을 생성할 수 있다.
  • 비공개 채널을 생성할 수 있다.
  • 공개 채널의 정보를 수정할 수 있다.
  • 채널을 삭제할 수 있다.
  • 특정 사용자가 볼 수 있는 모든 채널 목록을 조회할 수 있다.

메시지 관리

  • 메시지를 보낼 수 있다.
  • 메시지를 수정할 수 있다.
  • 메시지를 삭제할 수 있다.
  • 특정 채널의 메시지 목록을 조회할 수 있다.

메시지 수신 정보 관리

  • 특정 채널의 메시지 수신 정보를 생성할 수 있다.
  • 특정 채널의 메시지 수신 정보를 수정할 수 있다.
  • 특정 사용자의 메시지 수신 정보를 조회할 수 있다.

바이너리 파일 다운로드

  • 바이너리 파일을 1개 또는 여러 개 조회할 수 있다.

심화 요구사항

정적 리소스 서빙

  • 사용자 목록 조회, BinaryContent 파일 조회 API를 다음의 조건을 만족하도록 수정하세요.

    • 사용자 목록 조회

      • url: /api/user/findAll

      • 요청

        • 파라미터, 바디 없음
      • 응답

        • ResponseEntity<List<UserDto>>
        public record UserDto(
                UUID id,
                Instant createdAt,
                Instant updatedAt,
                String username,
                String email,
                UUID profileId,
                Boolean online
        ) {
        }
    • BinaryContent 파일 조회

      • url: /api/binaryContent/find
      • 요청
        • 파라미터: binaryContentId
        • 바디 없음
      • 응답: ResponseEntity<BinaryContent>
  • 다음의 파일을 활용하여 사용자 목록을 보여주는 화면을 서빙해보세요.

    static-resources.zip

생성형 AI 활용

  • 생성형 AI (Claude, ChatGPT 등)를 활용해서 위 이미지와 비슷한 화면을 생성 후 서빙해보세요.

멘토에게

  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.
  • 데스크톱이 고장나서 기존 진행하던 작업물은 쓸 수 없어서 랩탑으로 다시 시작했습니다. 그리고 원본 레포지토리랑 연결이 안돼서, 기존 작업하던 브랜치로 연결 못하고, 새로운 브랜치에 체리피킹해서 푸쉬했습니다. 그래서 또 날아갈까봐 중간중간 커밋이랑 푸쉬를 많이 했습니다. 그래서 파일이 잘 보일진 모르겠습니다. 지피티한테 물어보면서 최대한 했는데, 만약 안보이면 해결방법을 말씀해주시면 정말 감사하겠습니다...ㅠ.ㅠ..
  • 미션 4 베이스 파일로 작업 시작하여 요구사항만 충실히 이행했습니다. 그래서 좀 더 추가해야할 내용이 있으면 알려주시면 감사하겠습니다!
  • 아직 발생할 에러에 대한 대처를 하지 못했습니다. 발생한 예외별 에러페이지를 만들고 싶고, delete를 호출했을 때 나올 안내 메시지가 나오지 않는 오류가 있으며, head에 대한 처리를 아직 못했습니다. 어떻게 해야 할지 갈피만 잡아주시면 감사하겠습니다!
  • 지난 한달동안 멘토링 해주셔서 정말 감사합니다. 개인적으로 정말 많이 여쭤보고 배우고 싶었는데 아직 부족한 점이 너무 많아서 수업 내용만 따라가다 보니 제가 멘토링을 제대로 활용하지 못한 것 같아 정말 아쉽습니다. 다음에 배정될 팀에서 다시 멘토 대 멘티로 만나뵈었으면 좋겠습니다. 감사합니다!
  • (아직 미션 3의 pr을 제대로 확인 못했습니다. 죄송합니다.)

@HuInDoL HuInDoL requested a review from codingjigi May 17, 2025 16:13
@HuInDoL HuInDoL added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label May 17, 2025
@HuInDoL HuInDoL changed the title Sprint mission 4 requirements completed 임정현 sprint4 May 18, 2025
@HuInDoL HuInDoL changed the title 임정현 sprint4 [임정현] sprint4 May 18, 2025
@HuInDoL
Copy link
Collaborator Author

HuInDoL commented May 19, 2025

pr-clean 브랜치 살펴보다가 확인해보니 클래스가 깨졌는지 안보이는 것들이 좀 많네요..
체리피킹할때 강제병합했더니 뭐가 잘못됐나 봅니다..
제가 데스크톱 고장난 후 노트북으로 시작할 때 git clone을 안해서 원본 레포지토리랑 제 로컬의 임정현-sprint4 브랜치가 연결이 안된 것 같은데, 혹시 어떻게 연결할 수 있을까요..? 죄송합니다..

Copy link
Collaborator

@codingjigi codingjigi left a comment

Choose a reason for hiding this comment

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

코드가 엄청 깔끔해지셨는데요..? 다만 깃 충돌이 해결되지 않은 코드를 PR 로 올리셔서..
요고 먼저 해결해서 update 부탁드릴게요

import org.springframework.web.bind.annotation.ControllerAdvice;

@ControllerAdvice
public class GlobalExceptionHandler {
Copy link
Collaborator

Choose a reason for hiding this comment

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

클래스만 선언하신 이유는 뭘까요..?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

당시 예외를 어떻게 처리할지 구상하느라 전역처리만 하고 그대로 둔 것 같습니다

BinaryContent binaryContent = new BinaryContent(fileName, (long) bytes.length, contentType, bytes);
return binaryContentRepository.save(binaryContent).getId();
})
.orElse(null);
Copy link
Collaborator

Choose a reason for hiding this comment

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

오..


import java.util.*;

@RequiredArgsConstructor
Copy link
Collaborator

Choose a reason for hiding this comment

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

코드 충돌 해결이 필요해보입니다..

return ResponseEntity.status(HttpStatus.OK).body(updatedPublic);
}

@RequestMapping("/delete")
Copy link
Collaborator

Choose a reason for hiding this comment

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

삭제는 HTTP 메서드로 표현해주세요. URL에 직접 명시하는것보단 REST API 설계 원칙을 지키는게 좋아보입니다.


@RequestMapping("/delete")
@ResponseBody
public ResponseEntity<String> delete(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Request, Response 를 감싸는 객체를 만들어서 요청/응답을 통일해보세요.

import com.sprint.mission.discodeit.dto.request.ReadStatusCreateRequest;
import com.sprint.mission.discodeit.dto.request.ReadStatusUpdateRequest;
import com.sprint.mission.discodeit.entity.Message;
>>>>>>> 3189145 (5월 15일 강의 결과물)
Copy link
Collaborator

Choose a reason for hiding this comment

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

충돌 해결

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants