Skip to content

Commit

Permalink
🚚 Rename: Response에 "Response" 붙이기
Browse files Browse the repository at this point in the history
  • Loading branch information
ShimFFF committed Aug 18, 2024
1 parent e8b7d5b commit 5705893
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public static Room toRoom(RecruitRequestDTO.CreateRoomDTO request, User user, St
.build();
}

public static RecruitResponseDTO.CreateRoomDTO toResponseDTO(Room room) {
return RecruitResponseDTO.CreateRoomDTO.builder()
public static RecruitResponseDTO.CreateRoomResponseDTO toResponseDTO(Room room) {
return RecruitResponseDTO.CreateRoomResponseDTO.builder()
.roomId(room.getId())
.build();
}
Expand All @@ -66,8 +66,8 @@ public static StudyMate toStudyMate(User user, Room room) {
.build();
}

public static RecruitResponseDTO.studyDetailDTO toStudyDetailDTO(User user, Room room, CategoryEnum category) {
return RecruitResponseDTO.studyDetailDTO.builder()
public static RecruitResponseDTO.studyDetailResponseDTO toStudyDetailDTO(User user, Room room, CategoryEnum category) {
return RecruitResponseDTO.studyDetailResponseDTO.builder()
.userNickName(user.getNickname())
.userActive(user.getStatus())
.inactiveTime(user.getInactiveTime())
Expand Down Expand Up @@ -102,11 +102,11 @@ private static RecruitResponseDTO.CommentResponseDTO toCommentResponseDTO(StudyC
.build();
}

public static RecruitResponseDTO.CommentListDTO toCommentListDTO(int commentCount, Slice<StudyComment> commentList) {
public static RecruitResponseDTO.CommentListResponseDTO toCommentListDTO(int commentCount, Slice<StudyComment> commentList) {
List<RecruitResponseDTO.CommentResponseDTO> CommentResponseDTO =
commentList.stream().map(RecruitConverter::toCommentResponseDTO).collect(Collectors.toList());

return RecruitResponseDTO.CommentListDTO.builder()
return RecruitResponseDTO.CommentListResponseDTO.builder()
.commentCount(commentCount)
.hasNext(commentList.hasNext())
.commentList(CommentResponseDTO)
Expand All @@ -122,8 +122,8 @@ public static StudyComment toComment(RecruitRequestDTO.WriteCommentDTO request,
.build();
}

public static RecruitResponseDTO.WriteCommentDTO toWriteCommentDTO(StudyComment comment) {
return RecruitResponseDTO.WriteCommentDTO.builder()
public static RecruitResponseDTO.WriteCommentResponseDTO toWriteCommentDTO(StudyComment comment) {
return RecruitResponseDTO.WriteCommentResponseDTO.builder()
.commentId(comment.getId())
.build();
}
Expand All @@ -135,8 +135,8 @@ public static RecruitPostLikes toRecruitPostLikes(User user, Room room) {
.build();
}

public static RecruitResponseDTO.StudyLikesIdDTO toStudyLikesIdDTO(RecruitPostLikes likes) {
return RecruitResponseDTO.StudyLikesIdDTO.builder()
public static RecruitResponseDTO.StudyLikesIdResponseDTO toStudyLikesIdDTO(RecruitPostLikes likes) {
return RecruitResponseDTO.StudyLikesIdResponseDTO.builder()
.studyLikesId(likes.getId())
.build();
}
Expand All @@ -154,8 +154,8 @@ public static RecruitResponseDTO.StudyBookmarkIdDTO toStudyBookmarkIdDTO(Recruit
.build();
}

public static RecruitResponseDTO.PreviewDTO toPreviewDTO(Room room) {
return RecruitResponseDTO.PreviewDTO.builder()
public static RecruitResponseDTO.PreviewResponseDTO toPreviewDTO(Room room) {
return RecruitResponseDTO.PreviewResponseDTO.builder()
.roomId(room.getId())
.imageUrl(room.getThumbnailUrl())
.recruitStatus(room.getRecruitPostTypeEnum())
Expand All @@ -168,7 +168,7 @@ public static RecruitResponseDTO.PreviewDTO toPreviewDTO(Room room) {
.build();
}

public static List<RecruitResponseDTO.PreviewDTO> toPreviewDTOLIST(List<Room> roomList) {
public static List<RecruitResponseDTO.PreviewResponseDTO> toPreviewDTOLIST(List<Room> roomList) {
return roomList.stream().map(RecruitConverter::toPreviewDTO).collect(Collectors.toList());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public interface RecruitCustomRepository {

RecruitResponseDTO.PreviewListDTO findByCategoryOrderBySortType(
RecruitResponseDTO.PreviewListResponseDTO findByCategoryOrderBySortType(
CategoryEnum category, PreviewFilter filter, SortType sortType, String query, Long value, Pageable pageable);

RecruitResponseDTO.DefaultPreviewDTO findByCategory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class RecruitCustomRepositoryImpl implements RecruitCustomRepository{
private final JPAQueryFactory queryFactory;

@Override
public RecruitResponseDTO.PreviewListDTO findByCategoryOrderBySortType(
public RecruitResponseDTO.PreviewListResponseDTO findByCategoryOrderBySortType(
CategoryEnum category, PreviewFilter filter, SortType sortType, String query, Long value, Pageable pageable) {
List<Room> results = queryFactory
.selectFrom(room)
Expand All @@ -38,9 +38,9 @@ public RecruitResponseDTO.PreviewListDTO findByCategoryOrderBySortType(

boolean hasNext = checkLastPage(pageable, results);

List<RecruitResponseDTO.PreviewDTO> previewList = RecruitConverter.toPreviewDTOLIST(results);
List<RecruitResponseDTO.PreviewResponseDTO> previewList = RecruitConverter.toPreviewDTOLIST(results);

return RecruitResponseDTO.PreviewListDTO.builder()
return RecruitResponseDTO.PreviewListResponseDTO.builder()
.previewList(previewList)
.lastValue(getLastValue(results, sortType))
.hasNext(hasNext)
Expand All @@ -60,7 +60,7 @@ public RecruitResponseDTO.DefaultPreviewDTO findByCategory(CategoryEnum category

boolean hasNext = checkLastPage(pageable, results);

List<RecruitResponseDTO.PreviewDTO> previewList = RecruitConverter.toPreviewDTOLIST(results);
List<RecruitResponseDTO.PreviewResponseDTO> previewList = RecruitConverter.toPreviewDTOLIST(results);

return RecruitResponseDTO.DefaultPreviewDTO.builder()
.previewList(previewList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

public interface RecruitCommandService {

RecruitResponseDTO.CreateRoomDTO createRoom(RecruitRequestDTO.CreateRoomDTO request, Long userId);
RecruitResponseDTO.CreateRoomResponseDTO createRoom(RecruitRequestDTO.CreateRoomDTO request, Long userId);

RecruitResponseDTO.StudyLikesIdDTO likeStudy(Long userId, Long roomId);
RecruitResponseDTO.StudyLikesIdResponseDTO likeStudy(Long userId, Long roomId);

void unLikeStudy(Long userId, Long roomId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class RecruitCommandServiceImpl implements RecruitCommandService {

@Override
@Transactional
public RecruitResponseDTO.CreateRoomDTO createRoom(RecruitRequestDTO.CreateRoomDTO request, Long userId) {
public RecruitResponseDTO.CreateRoomResponseDTO createRoom(RecruitRequestDTO.CreateRoomDTO request, Long userId) {
String thumbnailUrl = DEFAULT_THUMBNAIL_URL;
String inviteCode = null;
int peopleMaximum = 0;
Expand Down Expand Up @@ -111,7 +111,7 @@ private String generateInviteCode() {

@Override
@Transactional
public RecruitResponseDTO.StudyLikesIdDTO likeStudy(Long userId, Long roomId) {
public RecruitResponseDTO.StudyLikesIdResponseDTO likeStudy(Long userId, Long roomId) {
User user = userQueryService.findUserById(userId);
Room room = roomQueryService.findRoomById(roomId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import gaji.service.domain.recruit.web.dto.RecruitResponseDTO;

public interface RecruitQueryService {
RecruitResponseDTO.studyDetailDTO getStudyDetail(Long roomId);
RecruitResponseDTO.studyDetailResponseDTO getStudyDetail(Long roomId);

RecruitResponseDTO.PreviewListDTO getPreviewList(
RecruitResponseDTO.PreviewListResponseDTO getPreviewList(
CategoryEnum category, PreviewFilter filter, SortType sort, String query, Long value, int pageSize);

RecruitResponseDTO.DefaultPreviewListDTO getDefaultPreview(boolean isFirst, Integer nextCategoryIndex, int pageSize);
RecruitResponseDTO.DefaultPreviewListResponseDTO getDefaultPreview(boolean isFirst, Integer nextCategoryIndex, int pageSize);
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class RecruitQueryServiceImpl implements RecruitQueryService {

@Override
@Transactional
public RecruitResponseDTO.studyDetailDTO getStudyDetail(Long roomId) {
public RecruitResponseDTO.studyDetailResponseDTO getStudyDetail(Long roomId) {

Room room = roomQueryService.findRoomById(roomId);
User user = userQueryService.findUserById(room.getUser().getId());
Expand All @@ -55,7 +55,7 @@ public RecruitResponseDTO.studyDetailDTO getStudyDetail(Long roomId) {

@Override
@Transactional(readOnly = true)
public RecruitResponseDTO.PreviewListDTO getPreviewList(
public RecruitResponseDTO.PreviewListResponseDTO getPreviewList(
CategoryEnum category, PreviewFilter filter, SortType sort, String query, Long value, int pageSize) {

validateQuery(query);
Expand All @@ -66,7 +66,7 @@ public RecruitResponseDTO.PreviewListDTO getPreviewList(
}

@Override
public RecruitResponseDTO.DefaultPreviewListDTO getDefaultPreview(boolean isFirst, Integer nextCategoryIndex, int pageSize) {
public RecruitResponseDTO.DefaultPreviewListResponseDTO getDefaultPreview(boolean isFirst, Integer nextCategoryIndex, int pageSize) {
Pageable pageable = PageRequest.of(0, pageSize);
List<RecruitResponseDTO.DefaultPreviewDTO> defaultPreviewList = new ArrayList<>();

Expand All @@ -93,7 +93,7 @@ public RecruitResponseDTO.DefaultPreviewListDTO getDefaultPreview(boolean isFirs
defaultPreviewList.add(previewList);
}

return RecruitResponseDTO.DefaultPreviewListDTO.builder()
return RecruitResponseDTO.DefaultPreviewListResponseDTO.builder()
.defaultPreviewList(defaultPreviewList)
.nextIndex(count)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public interface StudyCommentCommandService {

RecruitResponseDTO.WriteCommentDTO writeComment(
RecruitResponseDTO.WriteCommentResponseDTO writeComment(
Long userId, Long roomId, Long parentCommentId, RecruitRequestDTO.WriteCommentDTO request);

void deleteComment(Long userId, Long commentId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class StudyCommentCommandServiceImpl implements StudyCommentCommandServic
private final RoomQueryService roomQueryService;

@Override
public RecruitResponseDTO.WriteCommentDTO writeComment(Long userId, Long roomId, Long parentCommentId, RecruitRequestDTO.WriteCommentDTO request) {
public RecruitResponseDTO.WriteCommentResponseDTO writeComment(Long userId, Long roomId, Long parentCommentId, RecruitRequestDTO.WriteCommentDTO request) {
User user = userQueryService.findUserById(userId);
Room room = roomQueryService.findRoomById(roomId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public interface StudyCommentQueryService {

RecruitResponseDTO.CommentListDTO getCommentList
RecruitResponseDTO.CommentListResponseDTO getCommentList
(Long roomId, Integer lastCommentOrder, Integer lastDepth, Long lastCommentId, int size);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class StudyCommentQueryServiceImpl implements StudyCommentQueryService{
private final RoomQueryService roomQueryService;

@Override
public RecruitResponseDTO.CommentListDTO getCommentList(
public RecruitResponseDTO.CommentListResponseDTO getCommentList(
Long roomId, Integer lastCommentOrder, Integer lastDepth, Long lastCommentId, int size) {
Room room = roomQueryService.findRoomById(roomId);
PageRequest pageRequest = PageRequest.of(0, size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class RecruitController {

@PostMapping("")
@Operation(summary = "스터디 모집 게시글 생성 성성 API", description = "스터디 모집 게시글을 생성하는 API입니다.")
public BaseResponse<RecruitResponseDTO.CreateRoomDTO> createRoom(
public BaseResponse<RecruitResponseDTO.CreateRoomResponseDTO> createRoom(
@RequestBody @Valid RecruitRequestDTO.CreateRoomDTO request,
@RequestHeader("Authorization") String authorizationHeader) {
Long userId = tokenProviderService.getUserIdFromToken(authorizationHeader);
Expand All @@ -42,33 +42,33 @@ public BaseResponse<RecruitResponseDTO.CreateRoomDTO> createRoom(

@GetMapping("/{roomId}")
@Operation(summary = "스터디 정보 상세 조회 API", description = "스터디 상세 정보를 조회하는 API입니다.")
public BaseResponse<RecruitResponseDTO.studyDetailDTO> getStudyDetail(@PathVariable Long roomId) {
RecruitResponseDTO.studyDetailDTO responseDTO = recruitQueryService.getStudyDetail(roomId);
public BaseResponse<RecruitResponseDTO.studyDetailResponseDTO> getStudyDetail(@PathVariable Long roomId) {
RecruitResponseDTO.studyDetailResponseDTO responseDTO = recruitQueryService.getStudyDetail(roomId);
return BaseResponse.onSuccess(responseDTO);
}

@GetMapping("/{roomId}/comments")
@Operation(summary = "스터디 댓글 조회 API", description = "스터디 댓글을 조회하는 API입니다.")
public BaseResponse<RecruitResponseDTO.CommentListDTO> getCommentList(
public BaseResponse<RecruitResponseDTO.CommentListResponseDTO> getCommentList(
@PathVariable @Min(value = 1, message = "roomId는 1 이상 이어야 합니다.") Long roomId,
@RequestParam(required = false) @Min(value = 0, message = "commentOrder는 0 이상 이어야 합니다.") Integer commentOrder,
@RequestParam(required = false) @Min(value = 0, message = "depth는 0 이상 이어야 합니다.") Integer depth,
@RequestParam(required = false) @Min(value = 1, message = "commentId는 1 이상 이어야 합니다.") Long commentId,
@RequestParam(defaultValue = "10") @Min(value = 1, message = "size는 1 이상 이어야 합니다.") int size) {
RecruitResponseDTO.CommentListDTO responseDTO =
RecruitResponseDTO.CommentListResponseDTO responseDTO =
studyCommentQueryService.getCommentList(roomId, commentOrder, depth, commentId, size);
return BaseResponse.onSuccess(responseDTO);
}

@PostMapping("/{roomId}/comments")
@Operation(summary = "스터디 댓글 작성 API", description = "스터디 댓글을 작성하는 API입니다. 대댓글은 parentCommentId를 받아 작성합니다.")
public BaseResponse<RecruitResponseDTO.WriteCommentDTO> writeComment(
public BaseResponse<RecruitResponseDTO.WriteCommentResponseDTO> writeComment(
@RequestHeader("Authorization") String authorizationHeader,
@PathVariable @Min(value = 1, message = "roomId는 1 이상 이어야 합니다.") Long roomId,
@RequestParam(required = false) @Min(value = 1, message = "parentCommentId는 1 이상 이어야 합니다.") Long parentCommentId,
@RequestBody @Valid RecruitRequestDTO.WriteCommentDTO request) {
Long userId = tokenProviderService.getUserIdFromToken(authorizationHeader);
RecruitResponseDTO.WriteCommentDTO responseDTO =
RecruitResponseDTO.WriteCommentResponseDTO responseDTO =
studyCommentCommandService.writeComment(userId, roomId, parentCommentId, request);
return BaseResponse.onSuccess(responseDTO);
}
Expand All @@ -85,11 +85,11 @@ public BaseResponse deleteComment(

@PostMapping("/{roomId}/likes")
@Operation(summary = "스터디 모집 게시글 좋아요 API", description = "스터디 모집 게시글 좋아요 누르는 API입니다.")
public BaseResponse<RecruitResponseDTO.StudyLikesIdDTO> likeStudy(
public BaseResponse<RecruitResponseDTO.StudyLikesIdResponseDTO> likeStudy(
@RequestHeader("Authorization") String authorizationHeader,
@PathVariable @Min(value = 1, message = "roomId는 1 이상 이어야 합니다.") Long roomId) {
Long userId = tokenProviderService.getUserIdFromToken(authorizationHeader);
RecruitResponseDTO.StudyLikesIdDTO responseDTO = recruitCommandService.likeStudy(userId, roomId);
RecruitResponseDTO.StudyLikesIdResponseDTO responseDTO = recruitCommandService.likeStudy(userId, roomId);
return BaseResponse.onSuccess(responseDTO);
}

Expand Down Expand Up @@ -125,26 +125,26 @@ public BaseResponse unBookmarkStudy(

@GetMapping("/preview")
@Operation(summary = "스터디 모집 게시글 미리보기 목록 조회 API", description = "모집 게시글 목록을 조회하는 API 입니다.")
public BaseResponse<RecruitResponseDTO.PreviewListDTO> getPreviewList(
public BaseResponse<RecruitResponseDTO.PreviewListResponseDTO> getPreviewList(
@RequestParam(required = false) CategoryEnum category,
@RequestParam(required = false) PreviewFilter filter,
@RequestParam(defaultValue = "recent") SortType sort,
@RequestParam(required = false) String query,
@RequestParam(required = false) @Min(value = 0, message = "lastValue는 0 이상 입니다.") Long lastValue,
@RequestParam(value = "page", defaultValue = "20") @Min(value = 1, message = "pageSize는 0보다 커야 합니다.") int pageSize){

RecruitResponseDTO.PreviewListDTO responseDTO = recruitQueryService.getPreviewList(category, filter, sort, query, lastValue, pageSize);
RecruitResponseDTO.PreviewListResponseDTO responseDTO = recruitQueryService.getPreviewList(category, filter, sort, query, lastValue, pageSize);
return BaseResponse.onSuccess(responseDTO);
}

@GetMapping("/preview-default")
@Operation(summary = "스터디 미리보기 목록 조회 기본 페이지 API", description = "스터디 목록 조회 기본 페이지입니다.")
public BaseResponse<RecruitResponseDTO.DefaultPreviewListDTO> getDefaultPreviewList(
public BaseResponse<RecruitResponseDTO.DefaultPreviewListResponseDTO> getDefaultPreviewList(
@RequestParam(defaultValue = "0") @Min(value = 0, message = "index는 0 이상 이어야 합니다.") Integer nextCategoryIndex,
@RequestParam(defaultValue = "true") boolean isFirst,
@RequestParam(value = "page", defaultValue = "5") @Min(value = 1, message = "pageSize는 0보다 커야 합니다.") int pageSize) {

RecruitResponseDTO.DefaultPreviewListDTO responseDTO = recruitQueryService.getDefaultPreview(isFirst, nextCategoryIndex, pageSize);
RecruitResponseDTO.DefaultPreviewListResponseDTO responseDTO = recruitQueryService.getDefaultPreview(isFirst, nextCategoryIndex, pageSize);
return BaseResponse.onSuccess(responseDTO);
}
}
Expand Down
Loading

0 comments on commit 5705893

Please sign in to comment.