From 519a1c0884c73bf9fcd92bc7eb8cbc73c2e93983 Mon Sep 17 00:00:00 2001 From: JSoi Date: Wed, 13 Jul 2022 19:46:09 +0900 Subject: [PATCH] =?UTF-8?q?#18=20[Refactor]=20=ED=8C=A8=ED=82=A4=EC=A7=80?= =?UTF-8?q?=20=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20Dto=20?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BookmarkController.java | 6 +-- .../bookmark/controller/FolderController.java | 10 ++-- .../baechelin/bookmark/domain/Folder.java | 2 +- .../baechelin/bookmark/dto/BookmarkDTO.java | 2 +- ...arkReqDTO.java => BookmarkRequestDto.java} | 2 +- ...olderReqDTO.java => FolderRequestDto.java} | 2 +- ...lderResDTO.java => FolderResponseDto.java} | 10 ++-- .../bookmark/repository/FolderRepository.java | 2 +- .../bookmark/service/BookmarkService.java | 10 ++-- .../bookmark/service/FolderService.java | 18 +++---- .../oauth/controller/AuthController.java | 12 ----- .../baechelin/oauth/entity/UserPrincipal.java | 2 +- .../OAuth2AuthenticationSuccessHandler.java | 4 +- .../baechelin/oauth/service/AuthService.java | 4 +- .../service/CustomOAuth2UserService.java | 2 +- .../service/CustomUserDetailsService.java | 2 +- ...ResDto.java => ReviewMainResponseDto.java} | 4 +- .../baechelin/review/dto/ReviewReqDTO.java | 49 ------------------- .../review/dto/ReviewRequestDto.java | 20 ++++++++ ...viewResDTO.java => ReviewResponseDTO.java} | 2 +- .../store/domain/UserRegisterStore.java | 2 +- .../baechelin/store/dto/StoreResponseDto.java | 6 +-- .../service/UserRegisterStoreService.java | 2 +- .../user/controller/UserInfoController.java | 2 - .../user/controller/UserRestController.java | 2 +- .../user/{entity/user => domain}/User.java | 6 +-- .../user => domain}/UserRefreshToken.java | 2 +- .../UserRefreshTokenRepository.java | 2 +- .../user/repository/UserRepository.java | 2 +- .../user/service/UserInfoService.java | 2 +- .../baechelin/user/service/UserService.java | 2 +- 31 files changed, 71 insertions(+), 124 deletions(-) rename src/main/java/com/mpnp/baechelin/bookmark/dto/{BookmarkReqDTO.java => BookmarkRequestDto.java} (88%) rename src/main/java/com/mpnp/baechelin/bookmark/dto/{FolderReqDTO.java => FolderRequestDto.java} (89%) rename src/main/java/com/mpnp/baechelin/bookmark/dto/{FolderResDTO.java => FolderResponseDto.java} (84%) rename src/main/java/com/mpnp/baechelin/review/dto/{ReviewMainResDto.java => ReviewMainResponseDto.java} (86%) delete mode 100644 src/main/java/com/mpnp/baechelin/review/dto/ReviewReqDTO.java create mode 100644 src/main/java/com/mpnp/baechelin/review/dto/ReviewRequestDto.java rename src/main/java/com/mpnp/baechelin/review/dto/{ReviewResDTO.java => ReviewResponseDTO.java} (76%) rename src/main/java/com/mpnp/baechelin/user/{entity/user => domain}/User.java (91%) rename src/main/java/com/mpnp/baechelin/user/{entity/user => domain}/UserRefreshToken.java (93%) diff --git a/src/main/java/com/mpnp/baechelin/bookmark/controller/BookmarkController.java b/src/main/java/com/mpnp/baechelin/bookmark/controller/BookmarkController.java index 5ebad9e..d876e72 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/controller/BookmarkController.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/controller/BookmarkController.java @@ -1,6 +1,6 @@ package com.mpnp.baechelin.bookmark.controller; -import com.mpnp.baechelin.bookmark.dto.BookmarkReqDTO; +import com.mpnp.baechelin.bookmark.dto.BookmarkRequestDto; import com.mpnp.baechelin.bookmark.service.BookmarkService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; @@ -14,8 +14,8 @@ public class BookmarkController { /** 북마크 생성 폴더 담기 */ @PostMapping("/bookmark") - public void bookmark(@RequestBody BookmarkReqDTO bookmarkReqDTO){ + public void bookmark(@RequestBody BookmarkRequestDto bookmarkRequestDto){ - bookmarkService.bookmark(bookmarkReqDTO); + bookmarkService.bookmark(bookmarkRequestDto); } } diff --git a/src/main/java/com/mpnp/baechelin/bookmark/controller/FolderController.java b/src/main/java/com/mpnp/baechelin/bookmark/controller/FolderController.java index f74774b..5406c4b 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/controller/FolderController.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/controller/FolderController.java @@ -1,8 +1,8 @@ package com.mpnp.baechelin.bookmark.controller; -import com.mpnp.baechelin.bookmark.dto.FolderReqDTO; -import com.mpnp.baechelin.bookmark.dto.FolderResDTO; +import com.mpnp.baechelin.bookmark.dto.FolderRequestDto; +import com.mpnp.baechelin.bookmark.dto.FolderResponseDto; import com.mpnp.baechelin.bookmark.service.FolderService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -18,9 +18,9 @@ public class FolderController { /** 폴더 신규 생성 */ @PostMapping("/folder") - public void folder (@RequestBody FolderReqDTO folderReqDTO){ + public void folder (@RequestBody FolderRequestDto folderRequestDto){ - folderService.folder(folderReqDTO); + folderService.folder(folderRequestDto); } /* 폴더 삭제 -> 삭제 시 안에 담긴 모든 북마크가 삭제됨 */ @@ -41,7 +41,7 @@ public void folderUpdate (@PathVariable int folderId, @RequestParam String newFo } @PutMapping("/folderList/{userId}") - public List folderList (@PathVariable int userId){ + public List folderList (@PathVariable int userId){ return folderService.folderList(userId); } diff --git a/src/main/java/com/mpnp/baechelin/bookmark/domain/Folder.java b/src/main/java/com/mpnp/baechelin/bookmark/domain/Folder.java index 19f2852..432e588 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/domain/Folder.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/domain/Folder.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import com.mpnp.baechelin.util.TimeStamped; import lombok.*; diff --git a/src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkDTO.java b/src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkDTO.java index f0aa5ef..eb4d9e7 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkDTO.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkDTO.java @@ -12,7 +12,7 @@ @AllArgsConstructor @NoArgsConstructor @Builder -public class BookmarkDTO { +public class BookmarkDto { private List storeList = new ArrayList<>(); diff --git a/src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkReqDTO.java b/src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkRequestDto.java similarity index 88% rename from src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkReqDTO.java rename to src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkRequestDto.java index dc90f1b..3162989 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkReqDTO.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/dto/BookmarkRequestDto.java @@ -9,7 +9,7 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class BookmarkReqDTO { +public class BookmarkRequestDto { private int storeId; private int folderId; } diff --git a/src/main/java/com/mpnp/baechelin/bookmark/dto/FolderReqDTO.java b/src/main/java/com/mpnp/baechelin/bookmark/dto/FolderRequestDto.java similarity index 89% rename from src/main/java/com/mpnp/baechelin/bookmark/dto/FolderReqDTO.java rename to src/main/java/com/mpnp/baechelin/bookmark/dto/FolderRequestDto.java index 3ee4d35..74f6fea 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/dto/FolderReqDTO.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/dto/FolderRequestDto.java @@ -10,7 +10,7 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class FolderReqDTO { +public class FolderRequestDto { private String folderName = "미분류"; } diff --git a/src/main/java/com/mpnp/baechelin/bookmark/dto/FolderResDTO.java b/src/main/java/com/mpnp/baechelin/bookmark/dto/FolderResponseDto.java similarity index 84% rename from src/main/java/com/mpnp/baechelin/bookmark/dto/FolderResDTO.java rename to src/main/java/com/mpnp/baechelin/bookmark/dto/FolderResponseDto.java index 29be5c5..8376fbd 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/dto/FolderResDTO.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/dto/FolderResponseDto.java @@ -13,17 +13,17 @@ @NoArgsConstructor @AllArgsConstructor @Builder -public class FolderResDTO { +public class FolderResponseDto { private int id; private String folderName; private List> bookmarkList; - public FolderResDTO(Folder folder) { + public FolderResponseDto(Folder folder) { this.id = folder.getId(); this.folderName = folder.getFolderName(); } - public static FolderResDTO FolderDtoRes(Folder folder) { + public static FolderResponseDto FolderDtoRes(Folder folder) { /** 북마크의 정보를 담는 작업 */ List> bookmarks = new ArrayList<>(); if(folder.getBookmarkList() != null) { @@ -33,13 +33,13 @@ public static FolderResDTO FolderDtoRes(Folder folder) { bookmarks.add(tempBookmarkList); } } else if(folder.getBookmarkList() == null) { - return FolderResDTO.builder() + return FolderResponseDto.builder() .folderName(folder.getFolderName()) .id(folder.getId()) .build(); } - return FolderResDTO.builder() + return FolderResponseDto.builder() .folderName(folder.getFolderName()) .id(folder.getId()) .bookmarkList(bookmarks) diff --git a/src/main/java/com/mpnp/baechelin/bookmark/repository/FolderRepository.java b/src/main/java/com/mpnp/baechelin/bookmark/repository/FolderRepository.java index 713254b..201df21 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/repository/FolderRepository.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/repository/FolderRepository.java @@ -1,7 +1,7 @@ package com.mpnp.baechelin.bookmark.repository; import com.mpnp.baechelin.bookmark.domain.Folder; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; diff --git a/src/main/java/com/mpnp/baechelin/bookmark/service/BookmarkService.java b/src/main/java/com/mpnp/baechelin/bookmark/service/BookmarkService.java index c5b9135..1fc8264 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/service/BookmarkService.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/service/BookmarkService.java @@ -2,7 +2,7 @@ import com.mpnp.baechelin.bookmark.domain.Bookmark; import com.mpnp.baechelin.bookmark.domain.Folder; -import com.mpnp.baechelin.bookmark.dto.BookmarkReqDTO; +import com.mpnp.baechelin.bookmark.dto.BookmarkRequestDto; import com.mpnp.baechelin.bookmark.repository.BookmarkRepository; import com.mpnp.baechelin.bookmark.repository.FolderRepository; import com.mpnp.baechelin.store.domain.Store; @@ -10,8 +10,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; -import java.util.Optional; - @Service @RequiredArgsConstructor public class BookmarkService { @@ -20,11 +18,11 @@ public class BookmarkService { private final FolderRepository folderRepository; private final StoreRepository storeRepository; - public void bookmark(BookmarkReqDTO bookmarkReqDTO) { + public void bookmark(BookmarkRequestDto bookmarkRequestDto) { - Folder folder = folderRepository.findById(bookmarkReqDTO.getFolderId()) + Folder folder = folderRepository.findById(bookmarkRequestDto.getFolderId()) .orElseThrow(()-> new IllegalArgumentException("폴더가 존재하지 않습니다")); - Store store = storeRepository.findById(bookmarkReqDTO.getStoreId()) + Store store = storeRepository.findById(bookmarkRequestDto.getStoreId()) .orElseThrow(()-> new IllegalArgumentException("가게가 존재하지 않습니다")); Bookmark bookmark = Bookmark diff --git a/src/main/java/com/mpnp/baechelin/bookmark/service/FolderService.java b/src/main/java/com/mpnp/baechelin/bookmark/service/FolderService.java index 8a97eb3..b8b9e47 100644 --- a/src/main/java/com/mpnp/baechelin/bookmark/service/FolderService.java +++ b/src/main/java/com/mpnp/baechelin/bookmark/service/FolderService.java @@ -1,11 +1,11 @@ package com.mpnp.baechelin.bookmark.service; import com.mpnp.baechelin.bookmark.domain.Folder; -import com.mpnp.baechelin.bookmark.dto.FolderReqDTO; -import com.mpnp.baechelin.bookmark.dto.FolderResDTO; +import com.mpnp.baechelin.bookmark.dto.FolderRequestDto; +import com.mpnp.baechelin.bookmark.dto.FolderResponseDto; import com.mpnp.baechelin.bookmark.repository.FolderRepository; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import com.mpnp.baechelin.user.repository.UserRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -23,12 +23,12 @@ public class FolderService { private final UserRepository userRepository; @Transactional - public void folder(FolderReqDTO folderReqDTO) { + public void folder(FolderRequestDto folderRequestDto) { Optional user = userRepository.findById(1); Folder folder = Folder.builder() - .folderName(folderReqDTO.getFolderName()) + .folderName(folderRequestDto.getFolderName()) .userId(user.get()) .build(); folderRepository.save(folder); @@ -49,15 +49,15 @@ public void folderUpdate(int folderId, String newFolderName) { } @Transactional(readOnly = true) - public List folderList(int userId) { + public List folderList(int userId) { Optional user = userRepository.findById(userId); - List folderResDTOList = new ArrayList<>(); + List folderResponseDtoList = new ArrayList<>(); for(Folder obj : user.get().getFolderList()){ - folderResDTOList.add(FolderResDTO.FolderDtoRes(obj)); + folderResponseDtoList.add(FolderResponseDto.FolderDtoRes(obj)); } - return folderResDTOList; + return folderResponseDtoList; } } diff --git a/src/main/java/com/mpnp/baechelin/oauth/controller/AuthController.java b/src/main/java/com/mpnp/baechelin/oauth/controller/AuthController.java index 5141555..70dc524 100644 --- a/src/main/java/com/mpnp/baechelin/oauth/controller/AuthController.java +++ b/src/main/java/com/mpnp/baechelin/oauth/controller/AuthController.java @@ -1,27 +1,15 @@ package com.mpnp.baechelin.oauth.controller; -import com.mpnp.baechelin.config.properties.AppProperties; import com.mpnp.baechelin.oauth.common.AuthResponse; -import com.mpnp.baechelin.oauth.entity.RoleType; import com.mpnp.baechelin.oauth.service.AuthService; -import com.mpnp.baechelin.oauth.token.AuthToken; -import com.mpnp.baechelin.oauth.token.AuthTokenProvider; -import com.mpnp.baechelin.user.entity.user.UserRefreshToken; -import com.mpnp.baechelin.user.repository.UserRefreshTokenRepository; -import com.mpnp.baechelin.util.CookieUtil; -import com.mpnp.baechelin.util.HeaderUtil; -import io.jsonwebtoken.Claims; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.transaction.Transactional; -import java.util.Date; @RestController @RequestMapping("/auth") diff --git a/src/main/java/com/mpnp/baechelin/oauth/entity/UserPrincipal.java b/src/main/java/com/mpnp/baechelin/oauth/entity/UserPrincipal.java index 72582a0..9a1deef 100644 --- a/src/main/java/com/mpnp/baechelin/oauth/entity/UserPrincipal.java +++ b/src/main/java/com/mpnp/baechelin/oauth/entity/UserPrincipal.java @@ -1,6 +1,6 @@ package com.mpnp.baechelin.oauth.entity; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import lombok.*; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; diff --git a/src/main/java/com/mpnp/baechelin/oauth/handler/OAuth2AuthenticationSuccessHandler.java b/src/main/java/com/mpnp/baechelin/oauth/handler/OAuth2AuthenticationSuccessHandler.java index 6933d09..18a182d 100644 --- a/src/main/java/com/mpnp/baechelin/oauth/handler/OAuth2AuthenticationSuccessHandler.java +++ b/src/main/java/com/mpnp/baechelin/oauth/handler/OAuth2AuthenticationSuccessHandler.java @@ -8,7 +8,7 @@ import com.mpnp.baechelin.oauth.repository.OAuth2AuthorizationRequestBasedOnCookieRepository; import com.mpnp.baechelin.oauth.token.AuthToken; import com.mpnp.baechelin.oauth.token.AuthTokenProvider; -import com.mpnp.baechelin.user.entity.user.UserRefreshToken; +import com.mpnp.baechelin.user.domain.UserRefreshToken; import com.mpnp.baechelin.user.repository.UserRefreshTokenRepository; import com.mpnp.baechelin.util.CookieUtil; import lombok.RequiredArgsConstructor; @@ -23,9 +23,7 @@ import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.transaction.Transactional; import java.io.IOException; -import java.lang.annotation.Documented; import java.net.URI; import java.util.Collection; import java.util.Date; diff --git a/src/main/java/com/mpnp/baechelin/oauth/service/AuthService.java b/src/main/java/com/mpnp/baechelin/oauth/service/AuthService.java index c784e5d..890eb9d 100644 --- a/src/main/java/com/mpnp/baechelin/oauth/service/AuthService.java +++ b/src/main/java/com/mpnp/baechelin/oauth/service/AuthService.java @@ -5,13 +5,11 @@ import com.mpnp.baechelin.oauth.entity.RoleType; import com.mpnp.baechelin.oauth.token.AuthToken; import com.mpnp.baechelin.oauth.token.AuthTokenProvider; -import com.mpnp.baechelin.user.entity.user.UserRefreshToken; +import com.mpnp.baechelin.user.domain.UserRefreshToken; import com.mpnp.baechelin.user.repository.UserRefreshTokenRepository; import com.mpnp.baechelin.util.CookieUtil; import com.mpnp.baechelin.util.HeaderUtil; import io.jsonwebtoken.Claims; -import io.jsonwebtoken.ExpiredJwtException; -import io.jsonwebtoken.MalformedJwtException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/mpnp/baechelin/oauth/service/CustomOAuth2UserService.java b/src/main/java/com/mpnp/baechelin/oauth/service/CustomOAuth2UserService.java index 14c8f15..0c04164 100644 --- a/src/main/java/com/mpnp/baechelin/oauth/service/CustomOAuth2UserService.java +++ b/src/main/java/com/mpnp/baechelin/oauth/service/CustomOAuth2UserService.java @@ -7,7 +7,7 @@ import com.mpnp.baechelin.oauth.exception.OAuthProviderMissMatchException; import com.mpnp.baechelin.oauth.info.OAuth2UserInfo; import com.mpnp.baechelin.oauth.info.OAuth2UserInfoFactory; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import com.mpnp.baechelin.user.repository.UserRepository; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/com/mpnp/baechelin/oauth/service/CustomUserDetailsService.java b/src/main/java/com/mpnp/baechelin/oauth/service/CustomUserDetailsService.java index e10b0db..39b27a4 100644 --- a/src/main/java/com/mpnp/baechelin/oauth/service/CustomUserDetailsService.java +++ b/src/main/java/com/mpnp/baechelin/oauth/service/CustomUserDetailsService.java @@ -1,7 +1,7 @@ package com.mpnp.baechelin.oauth.service; import com.mpnp.baechelin.oauth.entity.UserPrincipal; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import com.mpnp.baechelin.user.repository.UserRepository; import lombok.RequiredArgsConstructor; import org.springframework.security.core.userdetails.UserDetails; diff --git a/src/main/java/com/mpnp/baechelin/review/dto/ReviewMainResDto.java b/src/main/java/com/mpnp/baechelin/review/dto/ReviewMainResponseDto.java similarity index 86% rename from src/main/java/com/mpnp/baechelin/review/dto/ReviewMainResDto.java rename to src/main/java/com/mpnp/baechelin/review/dto/ReviewMainResponseDto.java index a003fcc..dcfdc5e 100644 --- a/src/main/java/com/mpnp/baechelin/review/dto/ReviewMainResDto.java +++ b/src/main/java/com/mpnp/baechelin/review/dto/ReviewMainResponseDto.java @@ -10,13 +10,13 @@ @AllArgsConstructor @NoArgsConstructor @Builder -public class ReviewMainResDto { +public class ReviewMainResponseDto { // review 테이블 컬럼 private String comment; //리뷰 코멘트 private double point; //별점 private String imageFileUrl; //리뷰 이미지 사진 - public ReviewMainResDto(Review review) { + public ReviewMainResponseDto(Review review) { this.comment = review.getReview(); this.point = review.getPoint(); this.imageFileUrl = review.getReviewImageUrl(); diff --git a/src/main/java/com/mpnp/baechelin/review/dto/ReviewReqDTO.java b/src/main/java/com/mpnp/baechelin/review/dto/ReviewReqDTO.java deleted file mode 100644 index 7968a5b..0000000 --- a/src/main/java/com/mpnp/baechelin/review/dto/ReviewReqDTO.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.mpnp.baechelin.review.dto; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.springframework.web.multipart.MultipartFile; - - -@Getter -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class ReviewReqDTO { - - //review 테이블 컬럼 - private int userId; //유저 아이디 - private int storeId; //업장 아이디 - private String comment; //리뷰 코멘트 - private double point; //별점 - private MultipartFile imageFile; //리뷰 이미지 사진 - - // tag 테이블 컬럼 - @Builder.Default - private char bKiosk = 'N'; //키오스크 유무 - @Builder.Default - private char bTable = 'N'; //입식 테이블 - @Builder.Default - private char bMenu = 'N'; //점자 매뉴판 - @Builder.Default - private char bWheelchair = 'N'; //휠체어가 들어갈 수 있는 - @Builder.Default - private char bHelp = 'N'; //직원에 도움 요청 - @Builder.Default - private char bAutoDoor = 'N'; //자동문 - @Builder.Default - private char fDelicious = 'N'; //음식이 맛있는 - @Builder.Default - private char fClean = 'N'; //매장이 깔끔한 - @Builder.Default - private char fVibe = 'N'; //분위기 좋은 - @Builder.Default - private char fQuantity = 'N'; //양이 많은 - @Builder.Default - private char fGoodToEat = 'N'; //먹기 편한 - @Builder.Default - private char fPrice = 'N'; //가격이 착한 - -} \ No newline at end of file diff --git a/src/main/java/com/mpnp/baechelin/review/dto/ReviewRequestDto.java b/src/main/java/com/mpnp/baechelin/review/dto/ReviewRequestDto.java new file mode 100644 index 0000000..f5738f0 --- /dev/null +++ b/src/main/java/com/mpnp/baechelin/review/dto/ReviewRequestDto.java @@ -0,0 +1,20 @@ +package com.mpnp.baechelin.review.dto; + +import lombok.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + + +@Getter @Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class ReviewRequestDto { + //review 테이블 컬럼 + private int storeId; //업장 아이디 + private String comment; //리뷰 코멘트 + private double point; //별점 + private MultipartFile imageFile; //리뷰 이미지 사진 + private List tagList; +} \ No newline at end of file diff --git a/src/main/java/com/mpnp/baechelin/review/dto/ReviewResDTO.java b/src/main/java/com/mpnp/baechelin/review/dto/ReviewResponseDTO.java similarity index 76% rename from src/main/java/com/mpnp/baechelin/review/dto/ReviewResDTO.java rename to src/main/java/com/mpnp/baechelin/review/dto/ReviewResponseDTO.java index efffe17..9b3c968 100644 --- a/src/main/java/com/mpnp/baechelin/review/dto/ReviewResDTO.java +++ b/src/main/java/com/mpnp/baechelin/review/dto/ReviewResponseDTO.java @@ -1,6 +1,6 @@ package com.mpnp.baechelin.review.dto; -public class ReviewResDTO { +public class ReviewResponseDTO { private int statusCode; private String responseMessage; } \ No newline at end of file diff --git a/src/main/java/com/mpnp/baechelin/store/domain/UserRegisterStore.java b/src/main/java/com/mpnp/baechelin/store/domain/UserRegisterStore.java index 669e894..eff7313 100644 --- a/src/main/java/com/mpnp/baechelin/store/domain/UserRegisterStore.java +++ b/src/main/java/com/mpnp/baechelin/store/domain/UserRegisterStore.java @@ -1,6 +1,6 @@ package com.mpnp.baechelin.store.domain; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import com.mpnp.baechelin.util.TimeStamped; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/com/mpnp/baechelin/store/dto/StoreResponseDto.java b/src/main/java/com/mpnp/baechelin/store/dto/StoreResponseDto.java index bb3353e..82442ab 100644 --- a/src/main/java/com/mpnp/baechelin/store/dto/StoreResponseDto.java +++ b/src/main/java/com/mpnp/baechelin/store/dto/StoreResponseDto.java @@ -1,6 +1,6 @@ package com.mpnp.baechelin.store.dto; -import com.mpnp.baechelin.review.dto.ReviewResDTO; +import com.mpnp.baechelin.review.dto.ReviewResponseDTO; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @@ -26,7 +26,7 @@ public class StoreResponseDto { private List storeImgList; private double pointAvg; private String bookmark; - private List reviewList; + private List reviewList; @Builder public StoreResponseDto( @@ -45,7 +45,7 @@ public StoreResponseDto( List storeImgList, double pointAvg, String bookmark, - List reviewList) { + List reviewList) { this.storeId = storeId; this.category = category; diff --git a/src/main/java/com/mpnp/baechelin/store/service/UserRegisterStoreService.java b/src/main/java/com/mpnp/baechelin/store/service/UserRegisterStoreService.java index 6cab27a..821b5ef 100644 --- a/src/main/java/com/mpnp/baechelin/store/service/UserRegisterStoreService.java +++ b/src/main/java/com/mpnp/baechelin/store/service/UserRegisterStoreService.java @@ -5,7 +5,7 @@ import com.mpnp.baechelin.store.dto.userRegisterStore.UserRegisterStoreRequestDto; import com.mpnp.baechelin.store.repository.UserRegisterStoreImgRepository; import com.mpnp.baechelin.store.repository.UserRegisterStoreRepository; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import com.mpnp.baechelin.user.repository.UserRepository; import com.mpnp.baechelin.util.AwsS3Manager; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/mpnp/baechelin/user/controller/UserInfoController.java b/src/main/java/com/mpnp/baechelin/user/controller/UserInfoController.java index fbc99b7..5e95bb9 100644 --- a/src/main/java/com/mpnp/baechelin/user/controller/UserInfoController.java +++ b/src/main/java/com/mpnp/baechelin/user/controller/UserInfoController.java @@ -1,13 +1,11 @@ package com.mpnp.baechelin.user.controller; import com.mpnp.baechelin.user.dto.UserInfoResponseDto; -import com.mpnp.baechelin.user.entity.user.User; import com.mpnp.baechelin.user.service.UserInfoService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.*; @RestController diff --git a/src/main/java/com/mpnp/baechelin/user/controller/UserRestController.java b/src/main/java/com/mpnp/baechelin/user/controller/UserRestController.java index 59ce925..6f08716 100644 --- a/src/main/java/com/mpnp/baechelin/user/controller/UserRestController.java +++ b/src/main/java/com/mpnp/baechelin/user/controller/UserRestController.java @@ -1,7 +1,7 @@ package com.mpnp.baechelin.user.controller; import com.mpnp.baechelin.oauth.common.AuthResponse; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import com.mpnp.baechelin.user.service.UserService; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/mpnp/baechelin/user/entity/user/User.java b/src/main/java/com/mpnp/baechelin/user/domain/User.java similarity index 91% rename from src/main/java/com/mpnp/baechelin/user/entity/user/User.java rename to src/main/java/com/mpnp/baechelin/user/domain/User.java index 01573bd..9f395b0 100644 --- a/src/main/java/com/mpnp/baechelin/user/entity/user/User.java +++ b/src/main/java/com/mpnp/baechelin/user/domain/User.java @@ -1,4 +1,4 @@ -package com.mpnp.baechelin.user.entity.user; +package com.mpnp.baechelin.user.domain; import com.fasterxml.jackson.annotation.JsonIgnore; import com.mpnp.baechelin.bookmark.domain.Folder; @@ -6,16 +6,12 @@ import com.mpnp.baechelin.oauth.entity.RoleType; import com.mpnp.baechelin.review.domain.Review; import com.mpnp.baechelin.util.TimeStamped; -import io.micrometer.core.annotation.Counted; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.*; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.ArrayList; import java.util.List; @Entity diff --git a/src/main/java/com/mpnp/baechelin/user/entity/user/UserRefreshToken.java b/src/main/java/com/mpnp/baechelin/user/domain/UserRefreshToken.java similarity index 93% rename from src/main/java/com/mpnp/baechelin/user/entity/user/UserRefreshToken.java rename to src/main/java/com/mpnp/baechelin/user/domain/UserRefreshToken.java index f43c342..59e5033 100644 --- a/src/main/java/com/mpnp/baechelin/user/entity/user/UserRefreshToken.java +++ b/src/main/java/com/mpnp/baechelin/user/domain/UserRefreshToken.java @@ -1,4 +1,4 @@ -package com.mpnp.baechelin.user.entity.user; +package com.mpnp.baechelin.user.domain; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Builder; diff --git a/src/main/java/com/mpnp/baechelin/user/repository/UserRefreshTokenRepository.java b/src/main/java/com/mpnp/baechelin/user/repository/UserRefreshTokenRepository.java index 5b0dc07..3ddf8d7 100644 --- a/src/main/java/com/mpnp/baechelin/user/repository/UserRefreshTokenRepository.java +++ b/src/main/java/com/mpnp/baechelin/user/repository/UserRefreshTokenRepository.java @@ -1,6 +1,6 @@ package com.mpnp.baechelin.user.repository; -import com.mpnp.baechelin.user.entity.user.UserRefreshToken; +import com.mpnp.baechelin.user.domain.UserRefreshToken; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/mpnp/baechelin/user/repository/UserRepository.java b/src/main/java/com/mpnp/baechelin/user/repository/UserRepository.java index ccd6724..60a9514 100644 --- a/src/main/java/com/mpnp/baechelin/user/repository/UserRepository.java +++ b/src/main/java/com/mpnp/baechelin/user/repository/UserRepository.java @@ -1,6 +1,6 @@ package com.mpnp.baechelin.user.repository; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/mpnp/baechelin/user/service/UserInfoService.java b/src/main/java/com/mpnp/baechelin/user/service/UserInfoService.java index b9ce5d2..2642444 100644 --- a/src/main/java/com/mpnp/baechelin/user/service/UserInfoService.java +++ b/src/main/java/com/mpnp/baechelin/user/service/UserInfoService.java @@ -1,7 +1,7 @@ package com.mpnp.baechelin.user.service; import com.mpnp.baechelin.user.dto.UserInfoResponseDto; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import com.mpnp.baechelin.user.repository.UserRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/mpnp/baechelin/user/service/UserService.java b/src/main/java/com/mpnp/baechelin/user/service/UserService.java index da30c6b..a1de726 100644 --- a/src/main/java/com/mpnp/baechelin/user/service/UserService.java +++ b/src/main/java/com/mpnp/baechelin/user/service/UserService.java @@ -1,6 +1,6 @@ package com.mpnp.baechelin.user.service; -import com.mpnp.baechelin.user.entity.user.User; +import com.mpnp.baechelin.user.domain.User; import com.mpnp.baechelin.user.repository.UserRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service;