-
Notifications
You must be signed in to change notification settings - Fork 24
[임정현] sprint4 #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 임정현
Are you sure you want to change the base?
[임정현] sprint4 #118
Conversation
|
pr-clean 브랜치 살펴보다가 확인해보니 클래스가 깨졌는지 안보이는 것들이 좀 많네요.. |
codingjigi
left a comment
There was a problem hiding this 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
클래스만 선언하신 이유는 뭘까요..?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오..
|
|
||
| import java.util.*; | ||
|
|
||
| @RequiredArgsConstructor |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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일 강의 결과물) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
충돌 해결
기본 요구사항
컨트롤러 레이어 구현
DiscodeitApplication의 테스트 로직은 삭제하세요.지금까지 구현한 서비스 로직을 활용해 웹 API를 구현하세요.
이때
@RequestMapping만 사용해 구현해보세요.웹 API의 예외를 전역으로 처리하세요.
API 테스트
Sprint4 API TEST.postman_collection.json
웹 API 요구사항
사용자 관리
권한 관리
채널 관리
메시지 관리
메시지 수신 정보 관리
바이너리 파일 다운로드
심화 요구사항
정적 리소스 서빙
사용자 목록 조회, BinaryContent 파일 조회 API를 다음의 조건을 만족하도록 수정하세요.
사용자 목록 조회
url:
/api/user/findAll요청
응답
ResponseEntity<List<UserDto>>BinaryContent 파일 조회
/api/binaryContent/findbinaryContentIdResponseEntity<BinaryContent>다음의 파일을 활용하여 사용자 목록을 보여주는 화면을 서빙해보세요.
생성형 AI 활용
멘토에게