Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public enum IdeaMarketErrorCode implements ErrorCode {
UNAUTHORIZED_ACCESS(HttpStatus.UNAUTHORIZED, "IDEAMARKET401", "로그인이 필요합니다."),

// 403 Forbidden - 권한 없음
FORBIDDEN_ACCESS(HttpStatus.UNAUTHORIZED, "IDEAMARKET403", "해당 요청에 대한 권한이 없습니다."),
INDIVIDUAL_ACCESS_COMPANY(HttpStatus.UNAUTHORIZED, "IDEAMARKET403", "개인은 기업 게시글에 접근할 수 없습니다."),
IDEA_OWNER_PURCHASE(HttpStatus.UNAUTHORIZED, "IDEAMARKET403", "게시글 작성자는 구매할 수 없습니다."),

// 404 Not Found - 리소스를 찾을 수 없음
IDEA_NOT_FOUND(HttpStatus.NOT_FOUND, "IDEAMARKET404", "아이디어 마켓 게시글을 찾을 수 없습니다."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static GetIdeaPurchasePageDto.Response toResponse(IdeaMarket ideaMarket,
.sellerId(seller.getId())
.name(seller.getName())
.profileImageUrl(seller.getProfileImage())
.email(seller.getEmail())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ public static class Response {
private Long sellerId; // 판매자의 식별자 값
private String name; // 판매자 이름
private String profileImageUrl; // 판매자 프로필 이미지 URL
private String email; // 판매자 이메일
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public GetIdeaDetailDto.Response getIdeaDetail(GetIdeaDetailDto.Parameter parame
// 개인이 기업 게시물을 상세보기 하는 경우 처리
if (ideaMarket.getPostAuth().equals(PostAuth.COMPANY) && user.getAuthority()
.equals(BrainpixAuthority.INDIVIDUAL)) {
throw new BrainPixException(IdeaMarketErrorCode.FORBIDDEN_ACCESS);
throw new BrainPixException(IdeaMarketErrorCode.INDIVIDUAL_ACCESS_COMPANY);
}

// 조회수 증가
Expand Down Expand Up @@ -174,11 +174,11 @@ public GetIdeaPurchasePageDto.Response getIdeaPurchasePage(GetIdeaPurchasePageDt
// 개인이 기업 게시물을 구매하려는 경우 처리
if (ideaMarket.getPostAuth().equals(PostAuth.COMPANY) && user.getAuthority()
.equals(BrainpixAuthority.INDIVIDUAL)) {
throw new BrainPixException(IdeaMarketErrorCode.FORBIDDEN_ACCESS);
throw new BrainPixException(IdeaMarketErrorCode.INDIVIDUAL_ACCESS_COMPANY);
}
// 글 작성자가 구매하려는 경우 처리
if (seller == user) {
throw new BrainPixException(IdeaMarketErrorCode.FORBIDDEN_ACCESS);
throw new BrainPixException(IdeaMarketErrorCode.IDEA_OWNER_PURCHASE);
}

return GetIdeaPurchasePageDtoConverter.toResponse(ideaMarket, seller);
Expand Down