diff --git a/src/main/java/trothly/trothcam/controller/web/ProductController.java b/src/main/java/trothly/trothcam/controller/web/ProductController.java index b1218bd..63f6ee8 100644 --- a/src/main/java/trothly/trothcam/controller/web/ProductController.java +++ b/src/main/java/trothly/trothcam/controller/web/ProductController.java @@ -31,12 +31,12 @@ public class ProductController { /* 인증서 조회 */ @GetMapping("/products") public BaseResponse> findPublicProducts( - @RequestParam(value = "web-id") String webId, @RequestParam(value = "public") String isPublic) { + @RequestParam(value = "webToken") String webToken, @RequestParam(value = "public") String isPublic) { List result; if (isPublic.equals("Y")) { - result = productService.findPublicProducts(webId); + result = productService.findPublicProducts(webToken); } else if (isPublic.equals("N")) { - result = productService.findPrivateProducts(webId); + result = productService.findPrivateProducts(webToken); } else throw new BaseException(ErrorCode._BAD_REQUEST); if (result.isEmpty()) { diff --git a/src/main/java/trothly/trothcam/domain/product/ProductRepository.java b/src/main/java/trothly/trothcam/domain/product/ProductRepository.java index 552b450..c9fddc0 100644 --- a/src/main/java/trothly/trothcam/domain/product/ProductRepository.java +++ b/src/main/java/trothly/trothcam/domain/product/ProductRepository.java @@ -16,7 +16,7 @@ @Repository public interface ProductRepository extends JpaRepository { - List findAllByMember_WebIdAndPublicYn(String webId, PublicYn publicYn); // 인증서 조회 + List findAllByMember_WebTokenAndPublicYn(String webToken, PublicYn publicYn); // 인증서 조회 List findAllByMember_IdAndPublicYn(Long id, PublicYn publicYn); // 인증서 조회 @Query(value = "select ap.history_id as historyId, ap.product_id as productId, ap.seller_id as sellerId, ap.buyer_id as buyerId, ap.price as price, ap.sold_at as soldAt, p.image_id as imageId, p.title as title, p.tags as tags\n" + diff --git a/src/main/java/trothly/trothcam/dto/auth/web/LoginWebResDto.java b/src/main/java/trothly/trothcam/dto/auth/web/LoginWebResDto.java index 45820df..e169672 100644 --- a/src/main/java/trothly/trothcam/dto/auth/web/LoginWebResDto.java +++ b/src/main/java/trothly/trothcam/dto/auth/web/LoginWebResDto.java @@ -11,4 +11,5 @@ public class LoginWebResDto { private String accessToken; private String refreshToken; + private String webToken; } diff --git a/src/main/java/trothly/trothcam/service/auth/OAuthService.java b/src/main/java/trothly/trothcam/service/auth/OAuthService.java index 675e3fa..c739af5 100644 --- a/src/main/java/trothly/trothcam/service/auth/OAuthService.java +++ b/src/main/java/trothly/trothcam/service/auth/OAuthService.java @@ -90,7 +90,7 @@ public LoginWebResDto webLogin(LoginWebReqDto req) throws BaseException { member.updateStatus("active"); // inactive -> active로 변환 memberRepository.save(member); - return new LoginWebResDto(newAccessToken, newRefreshToken); + return new LoginWebResDto(newAccessToken, newRefreshToken, member.getWebToken()); } // 애플 로그인 diff --git a/src/main/java/trothly/trothcam/service/web/ProductService.java b/src/main/java/trothly/trothcam/service/web/ProductService.java index 7693e62..6af80ec 100644 --- a/src/main/java/trothly/trothcam/service/web/ProductService.java +++ b/src/main/java/trothly/trothcam/service/web/ProductService.java @@ -48,8 +48,8 @@ public class ProductService { /* 공개 인증서 조회 */ @Transactional(readOnly = true) - public List findPublicProducts(String webId) throws BaseException { - List findProducts = productRepository.findAllByMember_WebIdAndPublicYn(webId, PublicYn.Y); + public List findPublicProducts(String webToken) throws BaseException { + List findProducts = productRepository.findAllByMember_WebTokenAndPublicYn(webToken, PublicYn.Y); if (findProducts == null || findProducts.isEmpty()) throw new BaseException(ErrorCode.PRODUCT_NOT_FOUND); @@ -74,8 +74,8 @@ public List findPublicProducts(String webId) throws BaseExceptio /* 비공개 인증서 조회 */ @Transactional(readOnly = true) - public List findPrivateProducts(String webId) throws BaseException { - List findProducts = productRepository.findAllByMember_WebIdAndPublicYn(webId, PublicYn.N); + public List findPrivateProducts(String webToken) throws BaseException { + List findProducts = productRepository.findAllByMember_WebTokenAndPublicYn(webToken, PublicYn.N); if (findProducts == null || findProducts.isEmpty()) throw new BaseException(ErrorCode.PRODUCT_NOT_FOUND);