Postman 작성 중 응답 처리 방식이 일관되지 않아 혼선이 있었고, 에러 발생 시 throw로 처리할지 DTO 응답으로 처리할지에 대한 기준이 없는 상태였음
DTO 응답
으로 클라이언트에게 메시지 전달.throw
로 예외 발생 및 전역 예외 핸들링 처리.DTO 응답)
예외 처리)
// 동영상 정지 시 currentposition 저장 메서드
@Transactional
public PauseResponse createVideoViewHistory(Long userId, Long videoId, Long currentPosition) {
Long videoLength = videoRepository.findVideoLengthById(videoId);
if (videoLength == null) {
throw new EntityNotFoundException("해당 Video가 존재하지 않습니다.");
}