From 3804665c598a1b5ce99b60d40420107237feef38 Mon Sep 17 00:00:00 2001 From: yeseul106 <20191037@sungshin.ac.kr> Date: Tue, 1 Aug 2023 22:14:13 +0900 Subject: [PATCH] =?UTF-8?q?[REFACTOR]=20Dto=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/auth/controller/AuthController.java | 12 +++--- .../dto/{ => request}/AuthRequestDto.java | 2 +- .../AuthLoginResponseDto.java} | 4 +- .../AuthTokenGetResponseDto.java} | 4 +- .../api/auth/service/AuthService.java | 10 ++--- .../auth/service/Impl/AuthServiceImpl.java | 14 +++---- .../api/card/controller/CardController.java | 6 +-- .../{ => request}/CardCreateRequestDto.java | 2 +- .../{ => request}/CardDeleteRequestDto.java | 2 +- .../{ => response}/CardGetResponseDto.java | 12 +++--- .../CardListGetResponseDto.java} | 12 +++--- .../FileGetResponseDto.java} | 5 +-- .../api/card/service/CardService.java | 10 ++--- .../card/service/Impl/CardServiceImpl.java | 38 ++++++++++--------- .../controller/CategoryController.java | 4 +- ...seDto.java => CategoryGetResponseDto.java} | 6 +-- .../api/category/service/CategoryService.java | 4 +- .../service/Impl/CategoryServiceImpl.java | 6 +-- .../folder/controller/FolderController.java | 12 +++--- ...onseDto.java => FolderGetResponseDto.java} | 6 +-- .../api/folder/service/FolderService.java | 6 +-- .../service/Impl/FolderServiceImpl.java | 10 ++--- .../keyword/controller/KeywordController.java | 6 +-- .../api/keyword/dto/KeywordResponseDto.java | 17 --------- .../KeywordCreateRequestDto.java | 2 +- .../dto/response/KeywordGetResponseDto.java | 16 ++++++++ .../api/keyword/service/KeywordService.java | 6 +-- .../service/impl/KeywordServiceImpl.java | 9 ++--- .../member/controller/MemberController.java | 6 +-- ....java => MemberProfileGetResponseDto.java} | 2 +- .../service/Impl/MemberServiceImpl.java | 6 +-- .../api/member/service/MemberService.java | 4 +- .../controller/ScreenshotController.java | 4 +- ...Dto.java => ScreenshotGetResponseDto.java} | 2 +- ....java => ScreenshotUploadResponseDto.java} | 4 +- .../screenshot/service/ScreenshotService.java | 4 +- .../service/impl/ScreenshotServiceImpl.java | 6 +-- .../api/task/controller/TaskController.java | 6 +-- .../{ => request}/TaskCreateRequestDto.java | 2 +- .../TaskGetResponseDto.java} | 8 ++-- .../task/service/Impl/TaskServiceImpl.java | 8 ++-- .../api/task/service/TaskService.java | 6 +-- 42 files changed, 155 insertions(+), 156 deletions(-) rename src/main/java/site/katchup/katchupserver/api/auth/dto/{ => request}/AuthRequestDto.java (75%) rename src/main/java/site/katchup/katchupserver/api/auth/dto/{AuthResponseDto.java => response/AuthLoginResponseDto.java} (70%) rename src/main/java/site/katchup/katchupserver/api/auth/dto/{AuthTokenResponseDto.java => response/AuthTokenGetResponseDto.java} (54%) rename src/main/java/site/katchup/katchupserver/api/card/dto/{ => request}/CardCreateRequestDto.java (92%) rename src/main/java/site/katchup/katchupserver/api/card/dto/{ => request}/CardDeleteRequestDto.java (87%) rename src/main/java/site/katchup/katchupserver/api/card/dto/{ => response}/CardGetResponseDto.java (50%) rename src/main/java/site/katchup/katchupserver/api/card/dto/{CardResponseDto.java => response/CardListGetResponseDto.java} (68%) rename src/main/java/site/katchup/katchupserver/api/card/dto/{FileResponseDto.java => response/FileGetResponseDto.java} (66%) rename src/main/java/site/katchup/katchupserver/api/category/dto/response/{CategoryResponseDto.java => CategoryGetResponseDto.java} (63%) rename src/main/java/site/katchup/katchupserver/api/folder/dto/response/{FolderResponseDto.java => FolderGetResponseDto.java} (66%) delete mode 100644 src/main/java/site/katchup/katchupserver/api/keyword/dto/KeywordResponseDto.java rename src/main/java/site/katchup/katchupserver/api/keyword/dto/{ => request}/KeywordCreateRequestDto.java (81%) create mode 100644 src/main/java/site/katchup/katchupserver/api/keyword/dto/response/KeywordGetResponseDto.java rename src/main/java/site/katchup/katchupserver/api/member/dto/{MemberResponseDto.java => MemberProfileGetResponseDto.java} (79%) rename src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/{ScreenshotResponseDto.java => ScreenshotGetResponseDto.java} (87%) rename src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/{UploadScreenshotResponseDto.java => ScreenshotUploadResponseDto.java} (71%) rename src/main/java/site/katchup/katchupserver/api/task/dto/{ => request}/TaskCreateRequestDto.java (83%) rename src/main/java/site/katchup/katchupserver/api/task/dto/{TaskResponseDto.java => response/TaskGetResponseDto.java} (52%) diff --git a/src/main/java/site/katchup/katchupserver/api/auth/controller/AuthController.java b/src/main/java/site/katchup/katchupserver/api/auth/controller/AuthController.java index b8f8722..8a1b196 100644 --- a/src/main/java/site/katchup/katchupserver/api/auth/controller/AuthController.java +++ b/src/main/java/site/katchup/katchupserver/api/auth/controller/AuthController.java @@ -4,9 +4,9 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import site.katchup.katchupserver.api.auth.dto.AuthRequestDto; -import site.katchup.katchupserver.api.auth.dto.AuthResponseDto; -import site.katchup.katchupserver.api.auth.dto.AuthTokenResponseDto; +import site.katchup.katchupserver.api.auth.dto.request.AuthRequestDto; +import site.katchup.katchupserver.api.auth.dto.response.AuthLoginResponseDto; +import site.katchup.katchupserver.api.auth.dto.response.AuthTokenGetResponseDto; import site.katchup.katchupserver.api.auth.service.AuthService; import site.katchup.katchupserver.common.dto.ApiResponseDto; import site.katchup.katchupserver.common.response.SuccessStatus; @@ -20,9 +20,9 @@ public class AuthController { private final JwtTokenProvider jwtTokenProvider; @PostMapping() - public ApiResponseDto socialLogin(@RequestBody AuthRequestDto authRequestDto) { + public ApiResponseDto socialLogin(@RequestBody AuthRequestDto authRequestDto) { - AuthResponseDto responseDto = authService.socialLogin(authRequestDto); + AuthLoginResponseDto responseDto = authService.socialLogin(authRequestDto); // 로그인 if (!responseDto.isNewUser()) { @@ -35,7 +35,7 @@ public ApiResponseDto socialLogin(@RequestBody AuthRequestDto a @GetMapping("/token") @ResponseStatus(HttpStatus.OK) - public ApiResponseDto getNewToken(HttpServletRequest request) { + public ApiResponseDto getNewToken(HttpServletRequest request) { String accessToken = (String) request.getAttribute("newAccessToken"); String refreshToken = jwtTokenProvider.resolveRefreshToken(request); diff --git a/src/main/java/site/katchup/katchupserver/api/auth/dto/AuthRequestDto.java b/src/main/java/site/katchup/katchupserver/api/auth/dto/request/AuthRequestDto.java similarity index 75% rename from src/main/java/site/katchup/katchupserver/api/auth/dto/AuthRequestDto.java rename to src/main/java/site/katchup/katchupserver/api/auth/dto/request/AuthRequestDto.java index 38ce985..bef52c7 100644 --- a/src/main/java/site/katchup/katchupserver/api/auth/dto/AuthRequestDto.java +++ b/src/main/java/site/katchup/katchupserver/api/auth/dto/request/AuthRequestDto.java @@ -1,4 +1,4 @@ -package site.katchup.katchupserver.api.auth.dto; +package site.katchup.katchupserver.api.auth.dto.request; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/src/main/java/site/katchup/katchupserver/api/auth/dto/AuthResponseDto.java b/src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthLoginResponseDto.java similarity index 70% rename from src/main/java/site/katchup/katchupserver/api/auth/dto/AuthResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthLoginResponseDto.java index 9507bb8..1349155 100644 --- a/src/main/java/site/katchup/katchupserver/api/auth/dto/AuthResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthLoginResponseDto.java @@ -1,4 +1,4 @@ -package site.katchup.katchupserver.api.auth.dto; +package site.katchup.katchupserver.api.auth.dto.response; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Builder; @@ -6,7 +6,7 @@ @Data @Builder -public class AuthResponseDto { +public class AuthLoginResponseDto { private String nickname; diff --git a/src/main/java/site/katchup/katchupserver/api/auth/dto/AuthTokenResponseDto.java b/src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthTokenGetResponseDto.java similarity index 54% rename from src/main/java/site/katchup/katchupserver/api/auth/dto/AuthTokenResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthTokenGetResponseDto.java index d509401..c20bfeb 100644 --- a/src/main/java/site/katchup/katchupserver/api/auth/dto/AuthTokenResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthTokenGetResponseDto.java @@ -1,11 +1,11 @@ -package site.katchup.katchupserver.api.auth.dto; +package site.katchup.katchupserver.api.auth.dto.response; import lombok.Builder; import lombok.Data; @Data @Builder -public class AuthTokenResponseDto { +public class AuthTokenGetResponseDto { private String accessToken; private String refreshToken; diff --git a/src/main/java/site/katchup/katchupserver/api/auth/service/AuthService.java b/src/main/java/site/katchup/katchupserver/api/auth/service/AuthService.java index 84b3093..5509a3f 100644 --- a/src/main/java/site/katchup/katchupserver/api/auth/service/AuthService.java +++ b/src/main/java/site/katchup/katchupserver/api/auth/service/AuthService.java @@ -1,10 +1,10 @@ package site.katchup.katchupserver.api.auth.service; -import site.katchup.katchupserver.api.auth.dto.AuthRequestDto; -import site.katchup.katchupserver.api.auth.dto.AuthResponseDto; -import site.katchup.katchupserver.api.auth.dto.AuthTokenResponseDto; +import site.katchup.katchupserver.api.auth.dto.request.AuthRequestDto; +import site.katchup.katchupserver.api.auth.dto.response.AuthLoginResponseDto; +import site.katchup.katchupserver.api.auth.dto.response.AuthTokenGetResponseDto; public interface AuthService { - AuthResponseDto socialLogin(AuthRequestDto authRequestDto); - AuthTokenResponseDto getNewToken(String accessToken, String refreshToken); + AuthLoginResponseDto socialLogin(AuthRequestDto authRequestDto); + AuthTokenGetResponseDto getNewToken(String accessToken, String refreshToken); } diff --git a/src/main/java/site/katchup/katchupserver/api/auth/service/Impl/AuthServiceImpl.java b/src/main/java/site/katchup/katchupserver/api/auth/service/Impl/AuthServiceImpl.java index 3003982..6e7a0cb 100644 --- a/src/main/java/site/katchup/katchupserver/api/auth/service/Impl/AuthServiceImpl.java +++ b/src/main/java/site/katchup/katchupserver/api/auth/service/Impl/AuthServiceImpl.java @@ -4,9 +4,9 @@ import lombok.RequiredArgsConstructor; import org.springframework.security.core.Authentication; import org.springframework.stereotype.Service; -import site.katchup.katchupserver.api.auth.dto.AuthRequestDto; -import site.katchup.katchupserver.api.auth.dto.AuthResponseDto; -import site.katchup.katchupserver.api.auth.dto.AuthTokenResponseDto; +import site.katchup.katchupserver.api.auth.dto.request.AuthRequestDto; +import site.katchup.katchupserver.api.auth.dto.response.AuthLoginResponseDto; +import site.katchup.katchupserver.api.auth.dto.response.AuthTokenGetResponseDto; import site.katchup.katchupserver.api.auth.dto.GoogleInfoDto; import site.katchup.katchupserver.api.auth.service.AuthService; import site.katchup.katchupserver.api.auth.service.GoogleAuthService; @@ -26,7 +26,7 @@ public class AuthServiceImpl implements AuthService { private final MemberRepository memberRepository; @Override - public AuthResponseDto socialLogin(AuthRequestDto authRequestDto) { + public AuthLoginResponseDto socialLogin(AuthRequestDto authRequestDto) { GoogleInfoDto googleInfoDto = login(authRequestDto.getAccessToken()); @@ -59,7 +59,7 @@ public AuthResponseDto socialLogin(AuthRequestDto authRequestDto) { String nickname = signedMember.getNickname(); - return AuthResponseDto.builder() + return AuthLoginResponseDto.builder() .nickname(nickname) .accessToken(accessToken) .refreshToken(refreshToken) @@ -68,8 +68,8 @@ public AuthResponseDto socialLogin(AuthRequestDto authRequestDto) { } @Override - public AuthTokenResponseDto getNewToken(String accessToken, String refreshToken) { - return AuthTokenResponseDto.builder() + public AuthTokenGetResponseDto getNewToken(String accessToken, String refreshToken) { + return AuthTokenGetResponseDto.builder() .accessToken(accessToken) .refreshToken(refreshToken) .build(); diff --git a/src/main/java/site/katchup/katchupserver/api/card/controller/CardController.java b/src/main/java/site/katchup/katchupserver/api/card/controller/CardController.java index 782c440..f8d3ae5 100644 --- a/src/main/java/site/katchup/katchupserver/api/card/controller/CardController.java +++ b/src/main/java/site/katchup/katchupserver/api/card/controller/CardController.java @@ -4,9 +4,9 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import site.katchup.katchupserver.api.card.dto.CardCreateRequestDto; -import site.katchup.katchupserver.api.card.dto.CardDeleteRequestDto; -import site.katchup.katchupserver.api.card.dto.CardGetResponseDto; +import site.katchup.katchupserver.api.card.dto.request.CardCreateRequestDto; +import site.katchup.katchupserver.api.card.dto.request.CardDeleteRequestDto; +import site.katchup.katchupserver.api.card.dto.response.CardGetResponseDto; import site.katchup.katchupserver.api.card.service.CardService; import site.katchup.katchupserver.common.dto.ApiResponseDto; import site.katchup.katchupserver.common.response.SuccessStatus; diff --git a/src/main/java/site/katchup/katchupserver/api/card/dto/CardCreateRequestDto.java b/src/main/java/site/katchup/katchupserver/api/card/dto/request/CardCreateRequestDto.java similarity index 92% rename from src/main/java/site/katchup/katchupserver/api/card/dto/CardCreateRequestDto.java rename to src/main/java/site/katchup/katchupserver/api/card/dto/request/CardCreateRequestDto.java index 929fb0f..cdf9911 100644 --- a/src/main/java/site/katchup/katchupserver/api/card/dto/CardCreateRequestDto.java +++ b/src/main/java/site/katchup/katchupserver/api/card/dto/request/CardCreateRequestDto.java @@ -1,4 +1,4 @@ -package site.katchup.katchupserver.api.card.dto; +package site.katchup.katchupserver.api.card.dto.request; import jakarta.validation.constraints.NotBlank; import lombok.AllArgsConstructor; diff --git a/src/main/java/site/katchup/katchupserver/api/card/dto/CardDeleteRequestDto.java b/src/main/java/site/katchup/katchupserver/api/card/dto/request/CardDeleteRequestDto.java similarity index 87% rename from src/main/java/site/katchup/katchupserver/api/card/dto/CardDeleteRequestDto.java rename to src/main/java/site/katchup/katchupserver/api/card/dto/request/CardDeleteRequestDto.java index 565aa11..7ff30c6 100644 --- a/src/main/java/site/katchup/katchupserver/api/card/dto/CardDeleteRequestDto.java +++ b/src/main/java/site/katchup/katchupserver/api/card/dto/request/CardDeleteRequestDto.java @@ -1,4 +1,4 @@ -package site.katchup.katchupserver.api.card.dto; +package site.katchup.katchupserver.api.card.dto.request; import jakarta.validation.constraints.NotBlank; import lombok.AllArgsConstructor; diff --git a/src/main/java/site/katchup/katchupserver/api/card/dto/CardGetResponseDto.java b/src/main/java/site/katchup/katchupserver/api/card/dto/response/CardGetResponseDto.java similarity index 50% rename from src/main/java/site/katchup/katchupserver/api/card/dto/CardGetResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/card/dto/response/CardGetResponseDto.java index 7933b6a..b238443 100644 --- a/src/main/java/site/katchup/katchupserver/api/card/dto/CardGetResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/card/dto/response/CardGetResponseDto.java @@ -1,10 +1,10 @@ -package site.katchup.katchupserver.api.card.dto; +package site.katchup.katchupserver.api.card.dto.response; import lombok.AllArgsConstructor; import lombok.Getter; -import site.katchup.katchupserver.api.keyword.dto.KeywordResponseDto; -import site.katchup.katchupserver.api.screenshot.dto.response.ScreenshotResponseDto; +import site.katchup.katchupserver.api.keyword.dto.response.KeywordGetResponseDto; +import site.katchup.katchupserver.api.screenshot.dto.response.ScreenshotGetResponseDto; import java.util.List; @@ -15,7 +15,7 @@ public class CardGetResponseDto { private String category; private String folder; private String task; - private List keywordList; - private List screenshotList; - private List fileList; + private List keywordList; + private List screenshotList; + private List fileList; } diff --git a/src/main/java/site/katchup/katchupserver/api/card/dto/CardResponseDto.java b/src/main/java/site/katchup/katchupserver/api/card/dto/response/CardListGetResponseDto.java similarity index 68% rename from src/main/java/site/katchup/katchupserver/api/card/dto/CardResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/card/dto/response/CardListGetResponseDto.java index 726620d..099f423 100644 --- a/src/main/java/site/katchup/katchupserver/api/card/dto/CardResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/card/dto/response/CardListGetResponseDto.java @@ -1,8 +1,8 @@ -package site.katchup.katchupserver.api.card.dto; +package site.katchup.katchupserver.api.card.dto.response; import lombok.*; import site.katchup.katchupserver.api.card.domain.Card; -import site.katchup.katchupserver.api.keyword.dto.KeywordResponseDto; +import site.katchup.katchupserver.api.keyword.dto.response.KeywordGetResponseDto; import site.katchup.katchupserver.api.task.domain.Task; import java.util.ArrayList; @@ -14,18 +14,18 @@ @NoArgsConstructor(access = PRIVATE) @AllArgsConstructor @Builder -public class CardResponseDto { +public class CardListGetResponseDto { private Long taskId; private Long cardId; private Long placementOrder; private String cardName; - private List keywordList = new ArrayList<>(); + private List keywordList = new ArrayList<>(); private String content; private Boolean existFile; - public static CardResponseDto of (Card card, Task task, List keywordList) { + public static CardListGetResponseDto of (Card card, Task task, List keywordList) { Boolean existFile = card.getFiles().isEmpty() ? false : true; - return CardResponseDto.builder() + return CardListGetResponseDto.builder() .cardId(card.getId()) .taskId(task.getId()) .placementOrder(card.getPlacementOrder()) diff --git a/src/main/java/site/katchup/katchupserver/api/card/dto/FileResponseDto.java b/src/main/java/site/katchup/katchupserver/api/card/dto/response/FileGetResponseDto.java similarity index 66% rename from src/main/java/site/katchup/katchupserver/api/card/dto/FileResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/card/dto/response/FileGetResponseDto.java index f02bb12..3b5173a 100644 --- a/src/main/java/site/katchup/katchupserver/api/card/dto/FileResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/card/dto/response/FileGetResponseDto.java @@ -1,12 +1,11 @@ -package site.katchup.katchupserver.api.card.dto; +package site.katchup.katchupserver.api.card.dto.response; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Getter; @Getter @AllArgsConstructor(staticName = "of") -public class FileResponseDto { +public class FileGetResponseDto { private Long id; private String name; private String url; diff --git a/src/main/java/site/katchup/katchupserver/api/card/service/CardService.java b/src/main/java/site/katchup/katchupserver/api/card/service/CardService.java index 6ba6852..bcd4265 100644 --- a/src/main/java/site/katchup/katchupserver/api/card/service/CardService.java +++ b/src/main/java/site/katchup/katchupserver/api/card/service/CardService.java @@ -2,17 +2,17 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import site.katchup.katchupserver.api.card.dto.CardCreateRequestDto; -import site.katchup.katchupserver.api.card.dto.CardDeleteRequestDto; -import site.katchup.katchupserver.api.card.dto.CardGetResponseDto; -import site.katchup.katchupserver.api.card.dto.CardResponseDto; +import site.katchup.katchupserver.api.card.dto.request.CardCreateRequestDto; +import site.katchup.katchupserver.api.card.dto.request.CardDeleteRequestDto; +import site.katchup.katchupserver.api.card.dto.response.CardGetResponseDto; +import site.katchup.katchupserver.api.card.dto.response.CardListGetResponseDto; import java.util.List; @Transactional public interface CardService { - List getCardList(Long folderId); + List getCardList(Long folderId); CardGetResponseDto getCard(Long cardId); void deleteCardList(CardDeleteRequestDto cardDeleteRequestDto); diff --git a/src/main/java/site/katchup/katchupserver/api/card/service/Impl/CardServiceImpl.java b/src/main/java/site/katchup/katchupserver/api/card/service/Impl/CardServiceImpl.java index 6277ddf..6b3925e 100644 --- a/src/main/java/site/katchup/katchupserver/api/card/service/Impl/CardServiceImpl.java +++ b/src/main/java/site/katchup/katchupserver/api/card/service/Impl/CardServiceImpl.java @@ -7,7 +7,11 @@ import org.springframework.web.multipart.MultipartFile; import site.katchup.katchupserver.api.card.domain.Card; import site.katchup.katchupserver.api.card.domain.File; -import site.katchup.katchupserver.api.card.dto.*; +import site.katchup.katchupserver.api.card.dto.request.CardCreateRequestDto; +import site.katchup.katchupserver.api.card.dto.request.CardDeleteRequestDto; +import site.katchup.katchupserver.api.card.dto.response.CardGetResponseDto; +import site.katchup.katchupserver.api.card.dto.response.CardListGetResponseDto; +import site.katchup.katchupserver.api.card.dto.response.FileGetResponseDto; import site.katchup.katchupserver.api.card.repository.CardRepository; import site.katchup.katchupserver.api.card.repository.FileRepository; import site.katchup.katchupserver.api.card.service.CardService; @@ -16,9 +20,9 @@ import site.katchup.katchupserver.api.common.CardProvider; import site.katchup.katchupserver.api.folder.domain.Folder; import site.katchup.katchupserver.api.folder.repository.FolderRepository; -import site.katchup.katchupserver.api.keyword.dto.KeywordResponseDto; +import site.katchup.katchupserver.api.keyword.dto.response.KeywordGetResponseDto; import site.katchup.katchupserver.api.keyword.repository.CardKeywordRepository; -import site.katchup.katchupserver.api.screenshot.dto.response.ScreenshotResponseDto; +import site.katchup.katchupserver.api.screenshot.dto.response.ScreenshotGetResponseDto; import site.katchup.katchupserver.api.screenshot.repository.ScreenshotRepository; import site.katchup.katchupserver.api.task.domain.Task; import site.katchup.katchupserver.api.task.repository.TaskRepository; @@ -58,7 +62,7 @@ public class CardServiceImpl implements CardService { @Override @Transactional - public List getCardList(Long folderId) { + public List getCardList(Long folderId) { return taskRepository.findByFolderId(folderId).stream() .flatMap(task -> task.getCards().stream()) .collect(Collectors.groupingBy(Card::getTask)) // taskId로 그룹화 @@ -66,11 +70,11 @@ public List getCardList(Long folderId) { .flatMap(cards -> cards.stream().sorted(Comparator.comparing(Card::getPlacementOrder))) // 그룹 내에서 placementOrder 값으로 정렬 .filter(card -> !card.isDeleted()) // isDeleted가 false인 card 필터링 .map(card -> { - List keywords = cardKeywordRepository.findByCardId(card.getId()).stream() - .map(cardKeyword -> KeywordResponseDto.of(cardKeyword.getKeyword())) + List keywords = cardKeywordRepository.findByCardId(card.getId()).stream() + .map(cardKeyword -> KeywordGetResponseDto.of(cardKeyword.getKeyword())) .collect(Collectors.toList()); Task relatedTask = card.getTask(); // Card와 연관된 Task 가져오기 - return CardResponseDto.of(card, relatedTask, keywords); + return CardListGetResponseDto.of(card, relatedTask, keywords); }) .collect(Collectors.toList()); } @@ -128,11 +132,11 @@ public CardGetResponseDto getCard(Long cardId) { Folder folder = getFolderById(card.getTask().getFolder().getId()); Category category = getCategoryById(folder.getCategory().getId()); - List keywordResponseDtoList = getKeywordDtoList(cardId); - List fileResponseDTOList = getFileDtoList(cardId); - List screenshotResponseDtoList = getScreenshotDtoList(cardId); + List keywordResponseDtoList = getKeywordDtoList(cardId); + List fileGetResponseDTOList = getFileDtoList(cardId); + List screenshotResponseDtoList = getScreenshotDtoList(cardId); - return CardGetResponseDto.of(card.getId(), category.getName(), folder.getName(), card.getTask().getName(), keywordResponseDtoList, screenshotResponseDtoList, fileResponseDTOList); + return CardGetResponseDto.of(card.getId(), category.getName(), folder.getName(), card.getTask().getName(), keywordResponseDtoList, screenshotResponseDtoList, fileGetResponseDTOList); } private Long getPlacementOrder(Task task) { @@ -174,22 +178,22 @@ private void validateFileSize(MultipartFile file) { } } - private List getKeywordDtoList(Long cardId) { + private List getKeywordDtoList(Long cardId) { return cardKeywordRepository.findByCardId(cardId) .stream() - .map(cardKeyword -> KeywordResponseDto.of(cardKeyword.getKeyword().getId(), cardKeyword.getKeyword().getName())) + .map(cardKeyword -> KeywordGetResponseDto.of(cardKeyword.getKeyword().getId(), cardKeyword.getKeyword().getName())) .collect(Collectors.toList()); } - private List getScreenshotDtoList(Long cardId) { + private List getScreenshotDtoList(Long cardId) { return screenshotRepository.findAllByCardId(cardId).stream() - .map(screenshot -> ScreenshotResponseDto + .map(screenshot -> ScreenshotGetResponseDto .of(screenshot.getId(), screenshot.getStickerOrder(), screenshot.getUrl()) ).collect(Collectors.toList()); } - private List getFileDtoList(Long cardId) { + private List getFileDtoList(Long cardId) { return fileRepository.findAllByCardId(cardId).stream() - .map(file -> FileResponseDto.of(file.getId(), file.getName(), file.getUrl(), file.getSize())).collect(Collectors.toList()); + .map(file -> FileGetResponseDto.of(file.getId(), file.getName(), file.getUrl(), file.getSize())).collect(Collectors.toList()); } private Card getCardById(Long cardId) { diff --git a/src/main/java/site/katchup/katchupserver/api/category/controller/CategoryController.java b/src/main/java/site/katchup/katchupserver/api/category/controller/CategoryController.java index ef44579..c143ea6 100644 --- a/src/main/java/site/katchup/katchupserver/api/category/controller/CategoryController.java +++ b/src/main/java/site/katchup/katchupserver/api/category/controller/CategoryController.java @@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.*; import site.katchup.katchupserver.api.category.dto.request.CategoryCreateRequestDto; import site.katchup.katchupserver.api.category.dto.request.CategoryUpdateRequestDto; -import site.katchup.katchupserver.api.category.dto.response.CategoryResponseDto; +import site.katchup.katchupserver.api.category.dto.response.CategoryGetResponseDto; import site.katchup.katchupserver.api.category.service.CategoryService; import site.katchup.katchupserver.common.dto.ApiResponseDto; import site.katchup.katchupserver.common.response.SuccessStatus; @@ -34,7 +34,7 @@ public ApiResponseDto createCategoryName(Principal principal, @GetMapping() @ResponseStatus(HttpStatus.OK) - public ApiResponseDto> getAllCategory(Principal principal) { + public ApiResponseDto> getAllCategory(Principal principal) { Long memberId = MemberUtil.getMemberId(principal); return ApiResponseDto.success(SuccessStatus.READ_ALL_CATEGORY_SUCCESS, categoryService.getAllCategory(memberId)); } diff --git a/src/main/java/site/katchup/katchupserver/api/category/dto/response/CategoryResponseDto.java b/src/main/java/site/katchup/katchupserver/api/category/dto/response/CategoryGetResponseDto.java similarity index 63% rename from src/main/java/site/katchup/katchupserver/api/category/dto/response/CategoryResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/category/dto/response/CategoryGetResponseDto.java index 2cd29e4..ad938be 100644 --- a/src/main/java/site/katchup/katchupserver/api/category/dto/response/CategoryResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/category/dto/response/CategoryGetResponseDto.java @@ -9,13 +9,13 @@ @Getter @NoArgsConstructor(access = PRIVATE) @AllArgsConstructor -public class CategoryResponseDto { +public class CategoryGetResponseDto { private Long categoryId; private String name; private Boolean isShared; - public static CategoryResponseDto of(Long categoryId, String name, boolean isShared) { - return new CategoryResponseDto(categoryId, name, isShared); + public static CategoryGetResponseDto of(Long categoryId, String name, boolean isShared) { + return new CategoryGetResponseDto(categoryId, name, isShared); } } diff --git a/src/main/java/site/katchup/katchupserver/api/category/service/CategoryService.java b/src/main/java/site/katchup/katchupserver/api/category/service/CategoryService.java index 93562f8..57ca7ae 100644 --- a/src/main/java/site/katchup/katchupserver/api/category/service/CategoryService.java +++ b/src/main/java/site/katchup/katchupserver/api/category/service/CategoryService.java @@ -2,7 +2,7 @@ import site.katchup.katchupserver.api.category.dto.request.CategoryCreateRequestDto; import site.katchup.katchupserver.api.category.dto.request.CategoryUpdateRequestDto; -import site.katchup.katchupserver.api.category.dto.response.CategoryResponseDto; +import site.katchup.katchupserver.api.category.dto.response.CategoryGetResponseDto; import java.util.List; @@ -11,7 +11,7 @@ public interface CategoryService { void createCategoryName(Long memberId, CategoryCreateRequestDto categoryCreateRequestDto); //* 대분류 카테고리 전체 목록 조회 - List getAllCategory(Long memberId); + List getAllCategory(Long memberId); //* 대분류명 수정 void updateCategoryName(Long memberId, Long categoryId, CategoryUpdateRequestDto categoryUpdateRequestDto); diff --git a/src/main/java/site/katchup/katchupserver/api/category/service/Impl/CategoryServiceImpl.java b/src/main/java/site/katchup/katchupserver/api/category/service/Impl/CategoryServiceImpl.java index f28b435..e3bb12a 100644 --- a/src/main/java/site/katchup/katchupserver/api/category/service/Impl/CategoryServiceImpl.java +++ b/src/main/java/site/katchup/katchupserver/api/category/service/Impl/CategoryServiceImpl.java @@ -7,7 +7,7 @@ import site.katchup.katchupserver.api.category.domain.Category; import site.katchup.katchupserver.api.category.dto.request.CategoryCreateRequestDto; import site.katchup.katchupserver.api.category.dto.request.CategoryUpdateRequestDto; -import site.katchup.katchupserver.api.category.dto.response.CategoryResponseDto; +import site.katchup.katchupserver.api.category.dto.response.CategoryGetResponseDto; import site.katchup.katchupserver.api.category.repository.CategoryRepository; import site.katchup.katchupserver.api.category.service.CategoryService; @@ -48,9 +48,9 @@ public void createCategoryName(Long memberId, CategoryCreateRequestDto requestDt @Override @Transactional - public List getAllCategory(Long memberId) { + public List getAllCategory(Long memberId) { return categoryRepository.findByMemberId(memberId).stream() - .map(category -> CategoryResponseDto.of(category.getId(), category.getName(), category.isShared())) + .map(category -> CategoryGetResponseDto.of(category.getId(), category.getName(), category.isShared())) .collect(Collectors.toList()); } diff --git a/src/main/java/site/katchup/katchupserver/api/folder/controller/FolderController.java b/src/main/java/site/katchup/katchupserver/api/folder/controller/FolderController.java index a6fc23a..fcfc2ba 100644 --- a/src/main/java/site/katchup/katchupserver/api/folder/controller/FolderController.java +++ b/src/main/java/site/katchup/katchupserver/api/folder/controller/FolderController.java @@ -1,17 +1,15 @@ package site.katchup.katchupserver.api.folder.controller; import jakarta.validation.Valid; -import lombok.Getter; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import site.katchup.katchupserver.api.card.dto.CardResponseDto; +import site.katchup.katchupserver.api.card.dto.response.CardListGetResponseDto; import site.katchup.katchupserver.api.card.service.CardService; import site.katchup.katchupserver.api.folder.dto.request.FolderCreateRequestDto; import site.katchup.katchupserver.api.folder.dto.request.FolderUpdateRequestDto; -import site.katchup.katchupserver.api.folder.dto.response.FolderResponseDto; +import site.katchup.katchupserver.api.folder.dto.response.FolderGetResponseDto; import site.katchup.katchupserver.api.folder.service.FolderService; -import site.katchup.katchupserver.api.member.domain.Member; import site.katchup.katchupserver.common.dto.ApiResponseDto; import site.katchup.katchupserver.common.response.SuccessStatus; import site.katchup.katchupserver.common.util.MemberUtil; @@ -31,14 +29,14 @@ public class FolderController { @GetMapping() @ResponseStatus(HttpStatus.OK) - public ApiResponseDto> getAllFolder(Principal principal) { + public ApiResponseDto> getAllFolder(Principal principal) { Long memberId = MemberUtil.getMemberId(principal); return ApiResponseDto.success(SuccessStatus.READ_ALL_FOLDER_SUCCESS, folderService.getAllFolder(memberId)); } @GetMapping("/categories/{categoryId}") @ResponseStatus(HttpStatus.OK) - public ApiResponseDto> getByCategoryId(@PathVariable final Long categoryId) { + public ApiResponseDto> getByCategoryId(@PathVariable final Long categoryId) { return ApiResponseDto.success(SuccessStatus.READ_BY_CATEGORY_SUCCESS, folderService.getByCategoryId(categoryId)); } @@ -58,7 +56,7 @@ public ApiResponseDto createFolderName(@RequestBody @Valid final FolderCreateReq @GetMapping("/{folderId}/cards") @ResponseStatus(HttpStatus.OK) - public ApiResponseDto> getCardList(@PathVariable final Long folderId) { + public ApiResponseDto> getCardList(@PathVariable final Long folderId) { return ApiResponseDto.success(SuccessStatus.GET_ALL_CARD_SUCCESS, cardService.getCardList(folderId)); } @DeleteMapping("/{folderId}") diff --git a/src/main/java/site/katchup/katchupserver/api/folder/dto/response/FolderResponseDto.java b/src/main/java/site/katchup/katchupserver/api/folder/dto/response/FolderGetResponseDto.java similarity index 66% rename from src/main/java/site/katchup/katchupserver/api/folder/dto/response/FolderResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/folder/dto/response/FolderGetResponseDto.java index dbe41c1..fe923b4 100644 --- a/src/main/java/site/katchup/katchupserver/api/folder/dto/response/FolderResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/folder/dto/response/FolderGetResponseDto.java @@ -9,12 +9,12 @@ @Getter @NoArgsConstructor(access = PRIVATE) @AllArgsConstructor -public class FolderResponseDto { +public class FolderGetResponseDto { private Long folderId; private String name; - public static FolderResponseDto of(Long folderId, String name) { - return new FolderResponseDto(folderId, name); + public static FolderGetResponseDto of(Long folderId, String name) { + return new FolderGetResponseDto(folderId, name); } } diff --git a/src/main/java/site/katchup/katchupserver/api/folder/service/FolderService.java b/src/main/java/site/katchup/katchupserver/api/folder/service/FolderService.java index 8ea76b1..9e76691 100644 --- a/src/main/java/site/katchup/katchupserver/api/folder/service/FolderService.java +++ b/src/main/java/site/katchup/katchupserver/api/folder/service/FolderService.java @@ -2,17 +2,17 @@ import site.katchup.katchupserver.api.folder.dto.request.FolderCreateRequestDto; import site.katchup.katchupserver.api.folder.dto.request.FolderUpdateRequestDto; -import site.katchup.katchupserver.api.folder.dto.response.FolderResponseDto; +import site.katchup.katchupserver.api.folder.dto.response.FolderGetResponseDto; import java.util.List; public interface FolderService { //* 중분류 폴더 전체 목록 조회 - List getAllFolder(Long memberId); + List getAllFolder(Long memberId); //* 특정 카테고리 내 중분류 폴더 목록 조회 - List getByCategoryId(Long categoryId); + List getByCategoryId(Long categoryId); //* 중분류명 수정 void updateFolderName(Long folderId, FolderUpdateRequestDto folderUpdateRequestDto); diff --git a/src/main/java/site/katchup/katchupserver/api/folder/service/Impl/FolderServiceImpl.java b/src/main/java/site/katchup/katchupserver/api/folder/service/Impl/FolderServiceImpl.java index e030d62..2703baa 100644 --- a/src/main/java/site/katchup/katchupserver/api/folder/service/Impl/FolderServiceImpl.java +++ b/src/main/java/site/katchup/katchupserver/api/folder/service/Impl/FolderServiceImpl.java @@ -9,7 +9,7 @@ import site.katchup.katchupserver.api.folder.domain.Folder; import site.katchup.katchupserver.api.folder.dto.request.FolderCreateRequestDto; import site.katchup.katchupserver.api.folder.dto.request.FolderUpdateRequestDto; -import site.katchup.katchupserver.api.folder.dto.response.FolderResponseDto; +import site.katchup.katchupserver.api.folder.dto.response.FolderGetResponseDto; import site.katchup.katchupserver.api.folder.repository.FolderRepository; import site.katchup.katchupserver.api.folder.service.FolderService; import site.katchup.katchupserver.api.task.domain.Task; @@ -32,18 +32,18 @@ public class FolderServiceImpl implements FolderService { @Override @Transactional - public List getAllFolder(Long memberId) { + public List getAllFolder(Long memberId) { return categoryRepository.findByMemberId(memberId).stream() .flatMap(category -> folderRepository.findByCategoryId(category.getId()).stream()) - .map(folder -> FolderResponseDto.of(folder.getId(), folder.getName())) + .map(folder -> FolderGetResponseDto.of(folder.getId(), folder.getName())) .collect(Collectors.toList()); } @Override @Transactional - public List getByCategoryId(Long categoryId) { + public List getByCategoryId(Long categoryId) { return folderRepository.findByCategoryId(categoryId).stream() - .map(folder -> FolderResponseDto.of(folder.getId(), folder.getName())) + .map(folder -> FolderGetResponseDto.of(folder.getId(), folder.getName())) .collect(Collectors.toList()); } diff --git a/src/main/java/site/katchup/katchupserver/api/keyword/controller/KeywordController.java b/src/main/java/site/katchup/katchupserver/api/keyword/controller/KeywordController.java index 1861980..f1d1500 100644 --- a/src/main/java/site/katchup/katchupserver/api/keyword/controller/KeywordController.java +++ b/src/main/java/site/katchup/katchupserver/api/keyword/controller/KeywordController.java @@ -4,8 +4,8 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import site.katchup.katchupserver.api.keyword.dto.KeywordCreateRequestDto; -import site.katchup.katchupserver.api.keyword.dto.KeywordResponseDto; +import site.katchup.katchupserver.api.keyword.dto.request.KeywordCreateRequestDto; +import site.katchup.katchupserver.api.keyword.dto.response.KeywordGetResponseDto; import site.katchup.katchupserver.api.keyword.service.KeywordService; import site.katchup.katchupserver.common.dto.ApiResponseDto; import site.katchup.katchupserver.common.response.SuccessStatus; @@ -19,7 +19,7 @@ public class KeywordController { @GetMapping("/{cardId}/keywords") @ResponseStatus(HttpStatus.OK) - public ApiResponseDto> getAllKeyword(@PathVariable Long cardId) { + public ApiResponseDto> getAllKeyword(@PathVariable Long cardId) { return ApiResponseDto.success(SuccessStatus.GET_ALL_KEYWORD_SUCCESS, keywordService.getAllKeyword(cardId)); } diff --git a/src/main/java/site/katchup/katchupserver/api/keyword/dto/KeywordResponseDto.java b/src/main/java/site/katchup/katchupserver/api/keyword/dto/KeywordResponseDto.java deleted file mode 100644 index 2edef4f..0000000 --- a/src/main/java/site/katchup/katchupserver/api/keyword/dto/KeywordResponseDto.java +++ /dev/null @@ -1,17 +0,0 @@ -package site.katchup.katchupserver.api.keyword.dto; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import site.katchup.katchupserver.api.keyword.domain.Keyword; - -@Getter -@AllArgsConstructor(staticName = "of") -public class KeywordResponseDto { - private Long keywordId; - - private String name; - - public static KeywordResponseDto of(Keyword keyword) { - return new KeywordResponseDto(keyword.getId(), keyword.getName()); - } -} diff --git a/src/main/java/site/katchup/katchupserver/api/keyword/dto/KeywordCreateRequestDto.java b/src/main/java/site/katchup/katchupserver/api/keyword/dto/request/KeywordCreateRequestDto.java similarity index 81% rename from src/main/java/site/katchup/katchupserver/api/keyword/dto/KeywordCreateRequestDto.java rename to src/main/java/site/katchup/katchupserver/api/keyword/dto/request/KeywordCreateRequestDto.java index 25e5844..a0dd599 100644 --- a/src/main/java/site/katchup/katchupserver/api/keyword/dto/KeywordCreateRequestDto.java +++ b/src/main/java/site/katchup/katchupserver/api/keyword/dto/request/KeywordCreateRequestDto.java @@ -1,4 +1,4 @@ -package site.katchup.katchupserver.api.keyword.dto; +package site.katchup.katchupserver.api.keyword.dto.request; import jakarta.validation.constraints.NotBlank; import lombok.AllArgsConstructor; diff --git a/src/main/java/site/katchup/katchupserver/api/keyword/dto/response/KeywordGetResponseDto.java b/src/main/java/site/katchup/katchupserver/api/keyword/dto/response/KeywordGetResponseDto.java new file mode 100644 index 0000000..67a8e89 --- /dev/null +++ b/src/main/java/site/katchup/katchupserver/api/keyword/dto/response/KeywordGetResponseDto.java @@ -0,0 +1,16 @@ +package site.katchup.katchupserver.api.keyword.dto.response; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import site.katchup.katchupserver.api.keyword.domain.Keyword; + +@Getter +@AllArgsConstructor(staticName = "of") +public class KeywordGetResponseDto { + private Long keywordId; + private String name; + + public static KeywordGetResponseDto of(Keyword keyword) { + return new KeywordGetResponseDto(keyword.getId(), keyword.getName()); + } +} diff --git a/src/main/java/site/katchup/katchupserver/api/keyword/service/KeywordService.java b/src/main/java/site/katchup/katchupserver/api/keyword/service/KeywordService.java index 9a4418d..a06f5bf 100644 --- a/src/main/java/site/katchup/katchupserver/api/keyword/service/KeywordService.java +++ b/src/main/java/site/katchup/katchupserver/api/keyword/service/KeywordService.java @@ -1,12 +1,12 @@ package site.katchup.katchupserver.api.keyword.service; -import site.katchup.katchupserver.api.keyword.dto.KeywordCreateRequestDto; -import site.katchup.katchupserver.api.keyword.dto.KeywordResponseDto; +import site.katchup.katchupserver.api.keyword.dto.request.KeywordCreateRequestDto; +import site.katchup.katchupserver.api.keyword.dto.response.KeywordGetResponseDto; import java.util.List; public interface KeywordService { - List getAllKeyword(Long cardId); + List getAllKeyword(Long cardId); void createKeyword(Long cardId, KeywordCreateRequestDto requestDto); } diff --git a/src/main/java/site/katchup/katchupserver/api/keyword/service/impl/KeywordServiceImpl.java b/src/main/java/site/katchup/katchupserver/api/keyword/service/impl/KeywordServiceImpl.java index 731c40a..8d1f3fc 100644 --- a/src/main/java/site/katchup/katchupserver/api/keyword/service/impl/KeywordServiceImpl.java +++ b/src/main/java/site/katchup/katchupserver/api/keyword/service/impl/KeywordServiceImpl.java @@ -2,12 +2,11 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; -import site.katchup.katchupserver.api.card.service.CardService; import site.katchup.katchupserver.api.common.CardProvider; import site.katchup.katchupserver.api.keyword.domain.Keyword; import site.katchup.katchupserver.api.keyword.domain.CardKeyword; -import site.katchup.katchupserver.api.keyword.dto.KeywordCreateRequestDto; -import site.katchup.katchupserver.api.keyword.dto.KeywordResponseDto; +import site.katchup.katchupserver.api.keyword.dto.request.KeywordCreateRequestDto; +import site.katchup.katchupserver.api.keyword.dto.response.KeywordGetResponseDto; import site.katchup.katchupserver.api.keyword.repository.KeywordRepository; import site.katchup.katchupserver.api.keyword.repository.CardKeywordRepository; import site.katchup.katchupserver.api.keyword.service.KeywordService; @@ -23,11 +22,11 @@ public class KeywordServiceImpl implements KeywordService { private final CardProvider cardProvider; @Override - public List getAllKeyword(Long cardId) { + public List getAllKeyword(Long cardId) { return taskKeywordRepository.findByCardId(cardId).stream() .flatMap(taskKeyword -> keywordRepository.findById(taskKeyword.getKeyword().getId()).stream()) - .map(keyword -> KeywordResponseDto.of(keyword)) + .map(keyword -> KeywordGetResponseDto.of(keyword)) .collect(Collectors.toList()); } diff --git a/src/main/java/site/katchup/katchupserver/api/member/controller/MemberController.java b/src/main/java/site/katchup/katchupserver/api/member/controller/MemberController.java index 88c134b..b71f3f8 100644 --- a/src/main/java/site/katchup/katchupserver/api/member/controller/MemberController.java +++ b/src/main/java/site/katchup/katchupserver/api/member/controller/MemberController.java @@ -2,7 +2,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; -import site.katchup.katchupserver.api.member.dto.MemberResponseDto; +import site.katchup.katchupserver.api.member.dto.MemberProfileGetResponseDto; import site.katchup.katchupserver.api.member.service.MemberService; import site.katchup.katchupserver.common.dto.ApiResponseDto; import site.katchup.katchupserver.common.response.SuccessStatus; @@ -17,10 +17,10 @@ public class MemberController { private final MemberService memberService; @GetMapping("/profile") - public ApiResponseDto getMemberProfile(Principal principal) { + public ApiResponseDto getMemberProfile(Principal principal) { Long memberId = MemberUtil.getMemberId(principal); - MemberResponseDto responseDto = memberService.getMemberProfile(memberId); + MemberProfileGetResponseDto responseDto = memberService.getMemberProfile(memberId); return ApiResponseDto.success(SuccessStatus.GET_MEMBER_SUCCESS, responseDto); } diff --git a/src/main/java/site/katchup/katchupserver/api/member/dto/MemberResponseDto.java b/src/main/java/site/katchup/katchupserver/api/member/dto/MemberProfileGetResponseDto.java similarity index 79% rename from src/main/java/site/katchup/katchupserver/api/member/dto/MemberResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/member/dto/MemberProfileGetResponseDto.java index 36fabcb..7ac9810 100644 --- a/src/main/java/site/katchup/katchupserver/api/member/dto/MemberResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/member/dto/MemberProfileGetResponseDto.java @@ -5,7 +5,7 @@ @Data @AllArgsConstructor -public class MemberResponseDto { +public class MemberProfileGetResponseDto { private String imageUrl; private String nickname; diff --git a/src/main/java/site/katchup/katchupserver/api/member/service/Impl/MemberServiceImpl.java b/src/main/java/site/katchup/katchupserver/api/member/service/Impl/MemberServiceImpl.java index 8c6e6d0..ada36c8 100644 --- a/src/main/java/site/katchup/katchupserver/api/member/service/Impl/MemberServiceImpl.java +++ b/src/main/java/site/katchup/katchupserver/api/member/service/Impl/MemberServiceImpl.java @@ -4,7 +4,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import site.katchup.katchupserver.api.member.domain.Member; -import site.katchup.katchupserver.api.member.dto.MemberResponseDto; +import site.katchup.katchupserver.api.member.dto.MemberProfileGetResponseDto; import site.katchup.katchupserver.api.member.repository.MemberRepository; import site.katchup.katchupserver.api.member.service.MemberService; import site.katchup.katchupserver.common.exception.CustomException; @@ -17,10 +17,10 @@ public class MemberServiceImpl implements MemberService { private final MemberRepository memberRepository; @Override - public MemberResponseDto getMemberProfile(Long memberId) { + public MemberProfileGetResponseDto getMemberProfile(Long memberId) { Member member = findMember(memberId); - return new MemberResponseDto(member.getImageUrl(), member.getNickname(), member.getEmail()); + return new MemberProfileGetResponseDto(member.getImageUrl(), member.getNickname(), member.getEmail()); } private Member findMember(Long memberId) { diff --git a/src/main/java/site/katchup/katchupserver/api/member/service/MemberService.java b/src/main/java/site/katchup/katchupserver/api/member/service/MemberService.java index 68f46ba..bb0459f 100644 --- a/src/main/java/site/katchup/katchupserver/api/member/service/MemberService.java +++ b/src/main/java/site/katchup/katchupserver/api/member/service/MemberService.java @@ -1,7 +1,7 @@ package site.katchup.katchupserver.api.member.service; -import site.katchup.katchupserver.api.member.dto.MemberResponseDto; +import site.katchup.katchupserver.api.member.dto.MemberProfileGetResponseDto; public interface MemberService { - MemberResponseDto getMemberProfile(Long memberId); + MemberProfileGetResponseDto getMemberProfile(Long memberId); } diff --git a/src/main/java/site/katchup/katchupserver/api/screenshot/controller/ScreenshotController.java b/src/main/java/site/katchup/katchupserver/api/screenshot/controller/ScreenshotController.java index c4ea96d..a437ef0 100644 --- a/src/main/java/site/katchup/katchupserver/api/screenshot/controller/ScreenshotController.java +++ b/src/main/java/site/katchup/katchupserver/api/screenshot/controller/ScreenshotController.java @@ -4,7 +4,7 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import site.katchup.katchupserver.api.screenshot.dto.response.UploadScreenshotResponseDto; +import site.katchup.katchupserver.api.screenshot.dto.response.ScreenshotUploadResponseDto; import site.katchup.katchupserver.api.screenshot.service.ScreenshotService; import site.katchup.katchupserver.common.dto.ApiResponseDto; import site.katchup.katchupserver.common.response.SuccessStatus; @@ -22,7 +22,7 @@ public class ScreenshotController { @PostMapping("/cards/{cardId}/screenshot") @ResponseStatus(HttpStatus.CREATED) - public ApiResponseDto uploadScreenshot( + public ApiResponseDto uploadScreenshot( Principal principal, @PathVariable Long cardId, @RequestPart MultipartFile file diff --git a/src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/ScreenshotResponseDto.java b/src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/ScreenshotGetResponseDto.java similarity index 87% rename from src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/ScreenshotResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/ScreenshotGetResponseDto.java index a6d2018..fbb2ba8 100644 --- a/src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/ScreenshotResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/ScreenshotGetResponseDto.java @@ -7,7 +7,7 @@ @Getter @AllArgsConstructor(staticName = "of") -public class ScreenshotResponseDto { +public class ScreenshotGetResponseDto { private UUID id; private int stickerOrder; private String url; diff --git a/src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/UploadScreenshotResponseDto.java b/src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/ScreenshotUploadResponseDto.java similarity index 71% rename from src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/UploadScreenshotResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/ScreenshotUploadResponseDto.java index 67f917a..f61f364 100644 --- a/src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/UploadScreenshotResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/screenshot/dto/response/ScreenshotUploadResponseDto.java @@ -4,13 +4,13 @@ import lombok.Data; @Data -public class UploadScreenshotResponseDto { +public class ScreenshotUploadResponseDto { private String id; private String screenshotUrl; @Builder - public UploadScreenshotResponseDto(String id, String screenshotUrl) { + public ScreenshotUploadResponseDto(String id, String screenshotUrl) { this.id = id; this.screenshotUrl = screenshotUrl; } diff --git a/src/main/java/site/katchup/katchupserver/api/screenshot/service/ScreenshotService.java b/src/main/java/site/katchup/katchupserver/api/screenshot/service/ScreenshotService.java index e464fd1..62d9aa9 100644 --- a/src/main/java/site/katchup/katchupserver/api/screenshot/service/ScreenshotService.java +++ b/src/main/java/site/katchup/katchupserver/api/screenshot/service/ScreenshotService.java @@ -1,11 +1,11 @@ package site.katchup.katchupserver.api.screenshot.service; import org.springframework.web.multipart.MultipartFile; -import site.katchup.katchupserver.api.screenshot.dto.response.UploadScreenshotResponseDto; +import site.katchup.katchupserver.api.screenshot.dto.response.ScreenshotUploadResponseDto; public interface ScreenshotService { - UploadScreenshotResponseDto uploadScreenshot(MultipartFile file, Long cardId); + ScreenshotUploadResponseDto uploadScreenshot(MultipartFile file, Long cardId); public void delete(Long cardId, String screenshotId); diff --git a/src/main/java/site/katchup/katchupserver/api/screenshot/service/impl/ScreenshotServiceImpl.java b/src/main/java/site/katchup/katchupserver/api/screenshot/service/impl/ScreenshotServiceImpl.java index f916b78..50ab73e 100644 --- a/src/main/java/site/katchup/katchupserver/api/screenshot/service/impl/ScreenshotServiceImpl.java +++ b/src/main/java/site/katchup/katchupserver/api/screenshot/service/impl/ScreenshotServiceImpl.java @@ -8,7 +8,7 @@ import site.katchup.katchupserver.api.card.domain.Card; import site.katchup.katchupserver.api.common.CardProvider; import site.katchup.katchupserver.api.screenshot.domain.Screenshot; -import site.katchup.katchupserver.api.screenshot.dto.response.UploadScreenshotResponseDto; +import site.katchup.katchupserver.api.screenshot.dto.response.ScreenshotUploadResponseDto; import site.katchup.katchupserver.api.screenshot.repository.ScreenshotRepository; import site.katchup.katchupserver.api.screenshot.service.ScreenshotService; import site.katchup.katchupserver.api.screenshot.service.ScreenshotValidator; @@ -40,7 +40,7 @@ public class ScreenshotServiceImpl implements ScreenshotService { @Override @Transactional - public UploadScreenshotResponseDto uploadScreenshot(MultipartFile file, Long cardId) { + public ScreenshotUploadResponseDto uploadScreenshot(MultipartFile file, Long cardId) { screenshotValidator.validate(file); final String imageId = getUUIDFileName(); String uploadFilePath = SCREENSHOT_FOLDER_NAME + "/" + getFoldername(); @@ -57,7 +57,7 @@ public UploadScreenshotResponseDto uploadScreenshot(MultipartFile file, Long car screenshotRepository.save(screenshot); - return UploadScreenshotResponseDto.builder() + return ScreenshotUploadResponseDto.builder() .id(screenshot.getId().toString()) .screenshotUrl(screenshot.getUrl()) .build(); diff --git a/src/main/java/site/katchup/katchupserver/api/task/controller/TaskController.java b/src/main/java/site/katchup/katchupserver/api/task/controller/TaskController.java index 3720889..ead53bf 100644 --- a/src/main/java/site/katchup/katchupserver/api/task/controller/TaskController.java +++ b/src/main/java/site/katchup/katchupserver/api/task/controller/TaskController.java @@ -4,8 +4,8 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import site.katchup.katchupserver.api.task.dto.TaskCreateRequestDto; -import site.katchup.katchupserver.api.task.dto.TaskResponseDto; +import site.katchup.katchupserver.api.task.dto.request.TaskCreateRequestDto; +import site.katchup.katchupserver.api.task.dto.response.TaskGetResponseDto; import site.katchup.katchupserver.api.task.service.TaskService; import site.katchup.katchupserver.common.dto.ApiResponseDto; import site.katchup.katchupserver.common.response.SuccessStatus; @@ -22,7 +22,7 @@ public class TaskController { @GetMapping() @ResponseStatus(HttpStatus.OK) - public ApiResponseDto> getAllTask(Principal principal) { + public ApiResponseDto> getAllTask(Principal principal) { Long memberId = MemberUtil.getMemberId(principal); return ApiResponseDto.success(SuccessStatus.GET_ALL_TASK_SUCCESS, taskService.getAllTask(memberId)); } diff --git a/src/main/java/site/katchup/katchupserver/api/task/dto/TaskCreateRequestDto.java b/src/main/java/site/katchup/katchupserver/api/task/dto/request/TaskCreateRequestDto.java similarity index 83% rename from src/main/java/site/katchup/katchupserver/api/task/dto/TaskCreateRequestDto.java rename to src/main/java/site/katchup/katchupserver/api/task/dto/request/TaskCreateRequestDto.java index 792fdbd..31e76ec 100644 --- a/src/main/java/site/katchup/katchupserver/api/task/dto/TaskCreateRequestDto.java +++ b/src/main/java/site/katchup/katchupserver/api/task/dto/request/TaskCreateRequestDto.java @@ -1,4 +1,4 @@ -package site.katchup.katchupserver.api.task.dto; +package site.katchup.katchupserver.api.task.dto.request; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/site/katchup/katchupserver/api/task/dto/TaskResponseDto.java b/src/main/java/site/katchup/katchupserver/api/task/dto/response/TaskGetResponseDto.java similarity index 52% rename from src/main/java/site/katchup/katchupserver/api/task/dto/TaskResponseDto.java rename to src/main/java/site/katchup/katchupserver/api/task/dto/response/TaskGetResponseDto.java index d34fea3..efbcc1a 100644 --- a/src/main/java/site/katchup/katchupserver/api/task/dto/TaskResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/task/dto/response/TaskGetResponseDto.java @@ -1,4 +1,4 @@ -package site.katchup.katchupserver.api.task.dto; +package site.katchup.katchupserver.api.task.dto.response; import lombok.AllArgsConstructor; import lombok.Getter; @@ -9,12 +9,12 @@ @Getter @NoArgsConstructor(access = PRIVATE) @AllArgsConstructor -public class TaskResponseDto { +public class TaskGetResponseDto { private Long taskId; private String name; - public static TaskResponseDto of(Long taskId, String name) { - return new TaskResponseDto(taskId, name); + public static TaskGetResponseDto of(Long taskId, String name) { + return new TaskGetResponseDto(taskId, name); } } \ No newline at end of file diff --git a/src/main/java/site/katchup/katchupserver/api/task/service/Impl/TaskServiceImpl.java b/src/main/java/site/katchup/katchupserver/api/task/service/Impl/TaskServiceImpl.java index bf37751..93cf96b 100644 --- a/src/main/java/site/katchup/katchupserver/api/task/service/Impl/TaskServiceImpl.java +++ b/src/main/java/site/katchup/katchupserver/api/task/service/Impl/TaskServiceImpl.java @@ -6,8 +6,8 @@ import site.katchup.katchupserver.api.folder.domain.Folder; import site.katchup.katchupserver.api.folder.repository.FolderRepository; import site.katchup.katchupserver.api.task.domain.Task; -import site.katchup.katchupserver.api.task.dto.TaskCreateRequestDto; -import site.katchup.katchupserver.api.task.dto.TaskResponseDto; +import site.katchup.katchupserver.api.task.dto.request.TaskCreateRequestDto; +import site.katchup.katchupserver.api.task.dto.response.TaskGetResponseDto; import site.katchup.katchupserver.api.task.repository.TaskRepository; import site.katchup.katchupserver.api.task.service.TaskService; import site.katchup.katchupserver.common.exception.CustomException; @@ -25,12 +25,12 @@ public class TaskServiceImpl implements TaskService { private final TaskRepository taskRepository; @Override - public List getAllTask(Long memberId) { + public List getAllTask(Long memberId) { return categoryRepository.findByMemberId(memberId).stream() .flatMap(category -> folderRepository.findByCategoryId(category.getId()).stream()) .flatMap(folder -> taskRepository.findByFolderId(folder.getId()).stream()) - .map(task -> TaskResponseDto.of(task.getId(), task.getName())) + .map(task -> TaskGetResponseDto.of(task.getId(), task.getName())) .collect(Collectors.toList()); } diff --git a/src/main/java/site/katchup/katchupserver/api/task/service/TaskService.java b/src/main/java/site/katchup/katchupserver/api/task/service/TaskService.java index bbd5fc8..9e2cb44 100644 --- a/src/main/java/site/katchup/katchupserver/api/task/service/TaskService.java +++ b/src/main/java/site/katchup/katchupserver/api/task/service/TaskService.java @@ -1,11 +1,11 @@ package site.katchup.katchupserver.api.task.service; -import site.katchup.katchupserver.api.task.dto.TaskCreateRequestDto; -import site.katchup.katchupserver.api.task.dto.TaskResponseDto; +import site.katchup.katchupserver.api.task.dto.request.TaskCreateRequestDto; +import site.katchup.katchupserver.api.task.dto.response.TaskGetResponseDto; import java.util.List; public interface TaskService { - List getAllTask(Long memberId); + List getAllTask(Long memberId); void createTask(TaskCreateRequestDto requestDto); }