diff --git a/src/main/java/zipdabang/server/apiPayload/code/CommonStatus.java b/src/main/java/zipdabang/server/apiPayload/code/CommonStatus.java index 1442753..d0fff59 100644 --- a/src/main/java/zipdabang/server/apiPayload/code/CommonStatus.java +++ b/src/main/java/zipdabang/server/apiPayload/code/CommonStatus.java @@ -5,6 +5,7 @@ import lombok.Getter; import org.springframework.http.HttpStatus; + @Getter @AllArgsConstructor public enum CommonStatus implements BaseCode { @@ -21,6 +22,11 @@ public enum CommonStatus implements BaseCode { NICKNAME_MEMBER_NOT_EXIST(HttpStatus.OK, 2058, "해당 키워드를 포함한 닉네임을 가진 유저가 없습니다."), + // recipe response + + RECIPE_NOT_FOUND(HttpStatus.OK, 2100, "조회된 레시피 목록이 없습니다"), + COMMENT_NOT_FOUND(HttpStatus.OK, 2101, "조회된 댓글 목록이 없습니다"), + TEMP_RECIPE_NOT_FOUND(HttpStatus.OK, 2102, "조회된 임시저장 레시피 목록이 없습니다"), // market response @@ -30,76 +36,110 @@ public enum CommonStatus implements BaseCode { // error Codes + JWT_FORBIDDEN(HttpStatus.FORBIDDEN, 4000, "이미 로그아웃 된 토큰입니다."), //FORBIDDEN - JWT_FORBIDDEN(HttpStatus.OK, 4000, "이미 로그아웃 된 토큰입니다."), - //FORBIDDEN - FORBIDDEN(HttpStatus.OK, 4001, "접근 권한이 없습니다."), + FORBIDDEN(HttpStatus.FORBIDDEN, 4001, "접근 권한이 없습니다."), //BAD_REQUEST - BAD_REQUEST(HttpStatus.OK,4002 ,"잘못된 요청 입니다."), + BAD_REQUEST(HttpStatus.BAD_REQUEST,4002 ,"잘못된 요청 입니다."), //UNAUTHORIZED - UNAUTHORIZED(HttpStatus.OK, 4003, "UnAuthorized"), + UNAUTHORIZED(HttpStatus.UNAUTHORIZED, 4003, "UnAuthorized"), //UNAUTHORIZED - JWT_BAD_REQUEST(HttpStatus.OK, 4004,"잘못된 JWT 서명입니다."), + JWT_BAD_REQUEST(HttpStatus.UNAUTHORIZED, 4004,"잘못된 JWT 서명입니다."), //UNAUTHORIZED - JWT_ACCESS_TOKEN_EXPIRED(HttpStatus.OK, 4005,"액세스 토큰이 만료되었습니다."), + JWT_ACCESS_TOKEN_EXPIRED(HttpStatus.UNAUTHORIZED, 4005,"액세스 토큰이 만료되었습니다."), //UNAUTHORIZED - JWT_REFRESH_TOKEN_EXPIRED(HttpStatus.OK, 4006,"리프레시 토큰이 만료되었습니다. 다시 로그인하시기 바랍니다."), + JWT_REFRESH_TOKEN_EXPIRED(HttpStatus.UNAUTHORIZED, 4006,"리프레시 토큰이 만료되었습니다. 다시 로그인하시기 바랍니다."), //UNAUTHORIZED - JWT_UNSUPPORTED_TOKEN(HttpStatus.OK, 4007,"지원하지 않는 JWT 토큰입니다."), + JWT_UNSUPPORTED_TOKEN(HttpStatus.UNAUTHORIZED, 4007,"지원하지 않는 JWT 토큰입니다."), //UNAUTHORIZED - JWT_TOKEN_NOT_FOUND(HttpStatus.OK, 4008,"유효한 JWT 토큰이 없습니다."), + JWT_TOKEN_NOT_FOUND(HttpStatus.UNAUTHORIZED, 4008,"유효한 JWT 토큰이 없습니다."), //BAD_REQUEST - FEIGN_CLIENT_ERROR_400(HttpStatus.OK, 4009, "feign에서 400번대 에러가 발생했습니다."), + FEIGN_CLIENT_ERROR_400(HttpStatus.BAD_REQUEST, 4009, "feign에서 400번대 에러가 발생했습니다."), //NOT_FOUND - NOTIFICATION_NOT_FOUND(HttpStatus.OK, 4010, "공지를 찾을 수 없습니다."), + NOTIFICATION_NOT_FOUND(HttpStatus.NOT_FOUND, 4010, "공지를 찾을 수 없습니다."), + // member error + //BAD_REQUEST - REFRESH_TOKEN_NOT_FOUND(HttpStatus.OK, 4050,"refresh token이 필요합니다."), + REFRESH_TOKEN_NOT_FOUND(HttpStatus.BAD_REQUEST, 4050,"refresh token이 필요합니다."), //BAD_REQUEST - LOGOUT_FAIL(HttpStatus.OK, 4051, "fcmToken, serialNumber 주세요"), + LOGOUT_FAIL(HttpStatus.BAD_REQUEST, 4051, "fcmToken, serialNumber 주세요"), //UNAUTHORIZED - MEMBER_NOT_FOUND(HttpStatus.OK, 4052,"해당 사용자가 존재하지 않습니다"), + MEMBER_NOT_FOUND(HttpStatus.UNAUTHORIZED, 4052,"해당 사용자가 존재하지 않습니다"), //BAD_REQUEST - NO_CATEGORY_EXIST(HttpStatus.OK, 4053, "선호하는 음료 카테고리가 잘못 되었습니다."), + NO_CATEGORY_EXIST(HttpStatus.BAD_REQUEST, 4053, "선호하는 음료 카테고리가 잘못 되었습니다."), //BAD_REQUEST - UNDER_PAGE_INDEX_ERROR(HttpStatus.OK, 4054, "페이지 번호는 1 이상이여야 합니다."), + UNDER_PAGE_INDEX_ERROR(HttpStatus.BAD_REQUEST, 4054, "페이지 번호는 1 이상이여야 합니다."), //BAD_REQUEST - OVER_PAGE_INDEX_ERROR(HttpStatus.OK, 4055, "페이지 번호가 페이징 범위를 초과했습니다."), + OVER_PAGE_INDEX_ERROR(HttpStatus.BAD_REQUEST, 4055, "페이지 번호가 페이징 범위를 초과했습니다."), //BAD_REQUEST - PHONE_AUTH_NOT_FOUND(HttpStatus.OK, 4056, "인증 번호 요청이 필요합니다."), + PHONE_AUTH_NOT_FOUND(HttpStatus.BAD_REQUEST, 4056, "인증 번호 요청이 필요합니다."), //BAD_REQUEST - PHONE_AUTH_ERROR(HttpStatus.OK, 4057, "잘못된 인증 번호 입니다."), + PHONE_AUTH_ERROR(HttpStatus.BAD_REQUEST, 4057, "잘못된 인증 번호 입니다."), //BAD_REQUEST - PHONE_AUTH_TIMEOUT(HttpStatus.OK, 4058, "인증 시간이 초과되었습니다."), + PHONE_AUTH_TIMEOUT(HttpStatus.BAD_REQUEST, 4058, "인증 시간이 초과되었습니다."), //FORBIDDEN - TEMP_MEMBER_FORBIDDEN(HttpStatus.OK, 4059, "해당 기능은 로그인을 해야 합니다."), + TEMP_MEMBER_FORBIDDEN(HttpStatus.FORBIDDEN, 4059, "해당 기능은 로그인을 해야 합니다."), //BAD_REQUEST - NO_REPORT_EXIST(HttpStatus.OK, 4060, "해당 id를 가진 신고 목록이 없습니다. 잘못 보내줬어요"), + NO_REPORT_EXIST(HttpStatus.BAD_REQUEST, 4060, "해당 id를 가진 신고 목록이 없습니다. 잘못 보내줬어요"), //BAD_REQUEST - DEREGISTER_FAIL(HttpStatus.OK, 4061, "탈퇴할 수 없는 유저입니다. 탈퇴 불가 사유가 존재합니다."), + DEREGISTER_FAIL(HttpStatus.BAD_REQUEST, 4061, "탈퇴할 수 없는 유저입니다. 탈퇴 불가 사유가 존재합니다."), - ALREADY_BLOCKED_MEMBER(HttpStatus.OK, 4062, "이미 차단된 사용자입니다."), - BLOCK_SELF(HttpStatus.OK, 4063, "자신을 차단할 수 없습니다."), + ALREADY_BLOCKED_MEMBER(HttpStatus.BAD_REQUEST, 4062, "이미 차단된 사용자입니다."), + BLOCK_SELF(HttpStatus.BAD_REQUEST, 4063, "자신을 차단할 수 없습니다."), // BAD_REQUEST - TARGET_MEMBER_NOT_FOUND(HttpStatus.OK, 4064,"대상 사용자가 없습니다.."), + TARGET_MEMBER_NOT_FOUND(HttpStatus.BAD_REQUEST, 4064,"대상 사용자가 없습니다.."), //FORBIDDEN - SELF_FOLLOW_FORBIDDEN(HttpStatus.OK, 4065, "스스로 팔로우는 안됩니다."), + SELF_FOLLOW_FORBIDDEN(HttpStatus.FORBIDDEN, 4065, "스스로 팔로우는 안됩니다."), + + BLOCKED_MEMBER(HttpStatus.BAD_GATEWAY, 4066, "내가 차단한 사용자입니다."), + + INQUERY_NOT_FOUND(HttpStatus.NOT_FOUND, 4067, "문의가 없습니다."), - BLOCKED_MEMBER(HttpStatus.OK, 4066, "내가 차단한 사용자입니다."), + NOT_MY_INQUERY(HttpStatus.BAD_REQUEST, 4068, "로그인 한 사용자의 문의가 아닙니다."), + + + // recipe error + + //BAD_REQUEST + NULL_RECIPE_ERROR(HttpStatus.BAD_REQUEST, 4100, "레시피 작성시 누락된 내용이 있습니다."), + //BAD_REQUEST + NO_RECIPE_EXIST(HttpStatus.BAD_REQUEST, 4101, "해당 레시피가 존재하지 않습니다."), + //BAD_REQUEST + BLOCKED_USER_RECIPE(HttpStatus.BAD_REQUEST, 4102, "차단한 사용자의 레시피입니다."), + //BAD_REQUEST + WRITTEN_BY_TYPE_ERROR(HttpStatus.BAD_REQUEST, 4103, "레시피 작성자 타입이 잘못되었습니다. official, barista, common중 하나로 보내주세요."), + //BAD_REQUEST + ORDER_BY_TYPE_ERROR(HttpStatus.BAD_REQUEST, 4104, "조회 방식 타입이 잘못되었습니다. likes, views, latest중 하나로 보내주세요."), + //BAD_REQUEST + NO_RECIPE_CATEGORY_EXIST(HttpStatus.BAD_REQUEST, 4105, "해당 id를 가진 레시피 카테고리가 없습니다. 잘못 보내줬어요"), + //BAD_REQUEST + NOT_RECIPE_OWNER(HttpStatus.BAD_REQUEST, 4106, "본인이 작성한 레시피가 아닙니다. 변경할 수 없습니다"), + //BAD_REQUEST + NO_COMMENT_EXIST(HttpStatus.BAD_REQUEST, 4107, "해당 댓글이 존재하지 않습니다."), + //BAD_REQUEST + NOT_COMMENT_OWNER(HttpStatus.BAD_REQUEST, 4108, "본인이 작성한 댓글이 아닙니다. 변경할 수 없습니다"), + //BAD_REQUEST + RECIPE_OWNER(HttpStatus.BAD_REQUEST, 4109, "본인의 레시피입니다. 좋아요/스크랩/신고/차단할 수 없습니다"), + //BAD_REQUEST + COMMENT_OWNER(HttpStatus.BAD_REQUEST, 4110, "본인의 댓글입니다. 좋아요/스크랩/신고/차단할 수 없습니다"), + //BAD_REQUEST + NO_TEMP_RECIPE_EXIST(HttpStatus.BAD_REQUEST, 4111, "해당 임시저장 Id가 존재하지 않습니다."), + NOT_MATCH_RECIPE(HttpStatus.BAD_REQUEST, 4112, "해당 댓글은 넘겨준 레시피 Id에 존재하지 않습니다. 레시피 Id를 올바르게 보내주세요"), // market error //INTERNAL_SERVER_ERROR - INTERNAL_ERROR(HttpStatus.OK, 5000, "Internal server Error"), + INTERNAL_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, 5000, "Internal server Error"), //INTERNAL_SERVER_ERROR - FEIGN_CLIENT_ERROR_500(HttpStatus.OK, 5001, "Inter server Error in feign client"); + FEIGN_CLIENT_ERROR_500(HttpStatus.INTERNAL_SERVER_ERROR, 5001, "Inter server Error in feign client"); private final HttpStatus httpStatus; private final Integer code; diff --git a/src/main/java/zipdabang/server/apiPayload/code/RecipeStatus.java b/src/main/java/zipdabang/server/apiPayload/code/RecipeStatus.java deleted file mode 100644 index b6b4dd4..0000000 --- a/src/main/java/zipdabang/server/apiPayload/code/RecipeStatus.java +++ /dev/null @@ -1,65 +0,0 @@ -package zipdabang.server.apiPayload.code; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import org.springframework.http.HttpStatus; - -@Getter -@AllArgsConstructor -public enum RecipeStatus implements BaseCode{ - - RECIPE_NOT_FOUND(HttpStatus.OK, 2100, "조회된 레시피 목록이 없습니다"), - COMMENT_NOT_FOUND(HttpStatus.OK, 2101, "조회된 댓글 목록이 없습니다"), - TEMP_RECIPE_NOT_FOUND(HttpStatus.OK, 2102, "조회된 임시저장 레시피 목록이 없습니다"), - - //BAD_REQUEST - NULL_RECIPE_ERROR(HttpStatus.OK, 4100, "레시피 작성시 누락된 내용이 있습니다."), - //BAD_REQUEST - NO_RECIPE_EXIST(HttpStatus.OK, 4101, "해당 레시피가 존재하지 않습니다."), - //BAD_REQUEST - BLOCKED_USER_RECIPE(HttpStatus.OK, 4102, "차단한 사용자의 레시피입니다."), - //BAD_REQUEST - WRITTEN_BY_TYPE_ERROR(HttpStatus.OK, 4103, "레시피 작성자 타입이 잘못되었습니다. official, barista, common중 하나로 보내주세요."), - //BAD_REQUEST - ORDER_BY_TYPE_ERROR(HttpStatus.OK, 4104, "조회 방식 타입이 잘못되었습니다. likes, views, latest중 하나로 보내주세요."), - //BAD_REQUEST - NO_RECIPE_CATEGORY_EXIST(HttpStatus.OK, 4105, "해당 id를 가진 레시피 카테고리가 없습니다. 잘못 보내줬어요"), - //BAD_REQUEST - NOT_RECIPE_OWNER(HttpStatus.OK, 4106, "본인이 작성한 레시피가 아닙니다. 변경할 수 없습니다"), - //BAD_REQUEST - NO_COMMENT_EXIST(HttpStatus.OK, 4107, "해당 댓글이 존재하지 않습니다."), - //BAD_REQUEST - NOT_COMMENT_OWNER(HttpStatus.OK, 4108, "본인이 작성한 댓글이 아닙니다. 변경할 수 없습니다"), - //BAD_REQUEST - RECIPE_OWNER(HttpStatus.OK, 4109, "본인의 레시피입니다. 좋아요/스크랩/신고/차단할 수 없습니다"), - //BAD_REQUEST - COMMENT_OWNER(HttpStatus.OK, 4110, "본인의 댓글입니다. 좋아요/스크랩/신고/차단할 수 없습니다"), - //BAD_REQUEST - NO_TEMP_RECIPE_EXIST(HttpStatus.OK, 4111, "해당 임시저장 Id가 존재하지 않습니다."), - NOT_MATCH_RECIPE(HttpStatus.OK, 4112, "해당 댓글은 넘겨준 레시피 Id에 존재하지 않습니다. 레시피 Id를 올바르게 보내주세요") - ; - - private final HttpStatus httpStatus; - private final Integer code; - private final String message; - - @Override - public Reason getReason() { - return Reason.builder() - .message(message) - .code(code) - .isSuccess((code >= 2000 && code < 3000) ? true : false) - .build(); - } - - @Override - public Reason getReasonHttpStatus() { - return Reason.builder() - .message(message) - .code(code) - .isSuccess((code >= 2000 && code < 3000) ? true : false) - .httpStatus(httpStatus) - .build() - ; - } -} diff --git a/src/main/java/zipdabang/server/converter/MemberConverter.java b/src/main/java/zipdabang/server/converter/MemberConverter.java index 3563049..08f2af6 100644 --- a/src/main/java/zipdabang/server/converter/MemberConverter.java +++ b/src/main/java/zipdabang/server/converter/MemberConverter.java @@ -464,6 +464,18 @@ public static MemberResponseDto.PushAlarmListDto toPushAlarmListDto(Page imageList = inquery.getInqueryImageList().stream() + .map(InqueryImage::getImageUrl).collect(Collectors.toList()); + + return MemberResponseDto.InquerySpecDto.builder() + .title(inquery.getTitle()) + .body(inquery.getBody()) + .receiveEmail(inquery.getReceiveEmail()) + .imageList(imageList) + .build(); + } } diff --git a/src/main/java/zipdabang/server/converter/RecipeConverter.java b/src/main/java/zipdabang/server/converter/RecipeConverter.java index a1903d2..5cac434 100644 --- a/src/main/java/zipdabang/server/converter/RecipeConverter.java +++ b/src/main/java/zipdabang/server/converter/RecipeConverter.java @@ -6,7 +6,7 @@ import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; //import zipdabang.server.aws.s3.AmazonS3Manager; -import zipdabang.server.apiPayload.code.RecipeStatus; +import zipdabang.server.apiPayload.code.CommonStatus; import zipdabang.server.aws.s3.AmazonS3Manager; import zipdabang.server.apiPayload.exception.handler.RecipeException; import zipdabang.server.domain.Report; @@ -21,7 +21,6 @@ import javax.annotation.PostConstruct; import java.io.IOException; import java.util.List; -import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Matcher; @@ -254,7 +253,7 @@ public static List toStep(RecipeRequestDto.CreateRecipeDto request, Recipe return request.getSteps().stream() .map(step-> { if (step.getDescription() == null) - throw new RecipeException(RecipeStatus.NULL_RECIPE_ERROR); + throw new RecipeException(CommonStatus.NULL_RECIPE_ERROR); try { return toStepDto(step, recipe, stepImages); } catch (IOException e) { @@ -474,7 +473,7 @@ public static Recipe toRecipe(RecipeRequestDto.CreateRecipeDto request, Multipar if(thumbnail != null) imageUrl = uploadThumbnail(thumbnail); else - throw new RecipeException(RecipeStatus.NULL_RECIPE_ERROR); + throw new RecipeException(CommonStatus.NULL_RECIPE_ERROR); recipe.setThumbnail(imageUrl); return recipe; @@ -535,7 +534,7 @@ private static Step toStepDto(RecipeRequestDto.StepDto step, Recipe recipe, List if(stepImages != null) imageUrl = uploadStepImage(stepImage); else - throw new RecipeException(RecipeStatus.NULL_RECIPE_ERROR); + throw new RecipeException(CommonStatus.NULL_RECIPE_ERROR); createdStep.setImage(imageUrl); return createdStep; diff --git a/src/main/java/zipdabang/server/repository/memberRepositories/InqueryRepository.java b/src/main/java/zipdabang/server/repository/memberRepositories/InqueryRepository.java index 4f88795..045cc82 100644 --- a/src/main/java/zipdabang/server/repository/memberRepositories/InqueryRepository.java +++ b/src/main/java/zipdabang/server/repository/memberRepositories/InqueryRepository.java @@ -6,6 +6,8 @@ import zipdabang.server.domain.member.Inquery; import zipdabang.server.domain.member.Member; +import java.util.Optional; + public interface InqueryRepository extends JpaRepository { Page findByMember(Member member, PageRequest pageRequest); diff --git a/src/main/java/zipdabang/server/service/MemberService.java b/src/main/java/zipdabang/server/service/MemberService.java index f8330e8..0dc5098 100644 --- a/src/main/java/zipdabang/server/service/MemberService.java +++ b/src/main/java/zipdabang/server/service/MemberService.java @@ -79,4 +79,8 @@ public interface MemberService { public Page findByNicknameContains(Integer page, String nickname); public Page findFollowerByNicknameContains(Integer page, Long targetId, String nickname); public Page findFollowingByNicknameContains(Integer page, Long targetId, String nickname); + + Optional findInqueryById(Long inqueryId); + + Inquery findMyInqueryById(Member member,Long inqueryId); } diff --git a/src/main/java/zipdabang/server/service/serviceImpl/MemberServiceImpl.java b/src/main/java/zipdabang/server/service/serviceImpl/MemberServiceImpl.java index 51872a4..dd07342 100644 --- a/src/main/java/zipdabang/server/service/serviceImpl/MemberServiceImpl.java +++ b/src/main/java/zipdabang/server/service/serviceImpl/MemberServiceImpl.java @@ -46,10 +46,7 @@ import javax.annotation.PostConstruct; import java.io.IOException; import java.time.LocalDate; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -568,4 +565,20 @@ public Page findFollowingByNicknameContains(Integer page, Long targetId, return searchByNicknameMembers; } + + @Override + public Optional findInqueryById(Long inqueryId) { + return inqueryRepository.findById(inqueryId); + } + + @Override + public Inquery findMyInqueryById(Member member,Long inqueryId) { + + Inquery inquery = inqueryRepository.findById(inqueryId).get(); + + if(!Objects.equals(inquery.getMember().getMemberId(), member.getMemberId())) + throw new MemberException(CommonStatus.NOT_MY_INQUERY); + + return inquery; + } } \ No newline at end of file diff --git a/src/main/java/zipdabang/server/service/serviceImpl/RecipeServiceImpl.java b/src/main/java/zipdabang/server/service/serviceImpl/RecipeServiceImpl.java index 0e81409..1a4f73e 100644 --- a/src/main/java/zipdabang/server/service/serviceImpl/RecipeServiceImpl.java +++ b/src/main/java/zipdabang/server/service/serviceImpl/RecipeServiceImpl.java @@ -13,7 +13,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import zipdabang.server.apiPayload.code.RecipeStatus; import zipdabang.server.apiPayload.code.CommonStatus; import zipdabang.server.apiPayload.exception.handler.MemberException; import zipdabang.server.aws.s3.AmazonS3Manager; @@ -23,7 +22,6 @@ import zipdabang.server.converter.RecipeConverter; import zipdabang.server.domain.Report; import zipdabang.server.domain.enums.AlarmType; -import zipdabang.server.domain.inform.AlarmCategory; import zipdabang.server.domain.inform.PushAlarm; import zipdabang.server.domain.member.*; import zipdabang.server.domain.recipe.*; @@ -46,7 +44,6 @@ import java.util.stream.Collectors; import static zipdabang.server.domain.member.QFollow.follow; -import static zipdabang.server.domain.member.QMember.*; import static zipdabang.server.domain.recipe.QComment.comment; import static zipdabang.server.domain.recipe.QRecipe.recipe; import static zipdabang.server.domain.recipe.QRecipeCategoryMapping.*; @@ -127,10 +124,10 @@ public Recipe create(RecipeRequestDto.CreateRecipeDto request, MultipartFile thu public Recipe update(Long recipeId, RecipeRequestDto.UpdateRecipeDto request, MultipartFile thumbnail, List stepImages, Member member) throws IOException { log.info("service: ", request.toString()); - Recipe recipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); + Recipe recipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); if(!recipe.getMember().equals(member)) - throw new RecipeException(RecipeStatus.NOT_RECIPE_OWNER); + throw new RecipeException(CommonStatus.NOT_RECIPE_OWNER); recipeCategoryMappingRepository.deleteAllByRecipe(recipe); @@ -217,7 +214,7 @@ public TempRecipe tempUpdate(Long tempId, RecipeRequestDto.TempRecipeDto request log.info("service: ", request.toString()); - TempRecipe tempRecipe = tempRecipeRepository.findById(tempId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_TEMP_RECIPE_EXIST)); + TempRecipe tempRecipe = tempRecipeRepository.findById(tempId).orElseThrow(() -> new RecipeException(CommonStatus.NO_TEMP_RECIPE_EXIST)); //recipe String thumbnailUrl = null; @@ -275,14 +272,14 @@ else if (request.getThumbnailUrl() != null) @Override public TempRecipe getTempRecipe(Long tempId) { - return tempRecipeRepository.findById(tempId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_TEMP_RECIPE_EXIST)); + return tempRecipeRepository.findById(tempId).orElseThrow(() -> new RecipeException(CommonStatus.NO_TEMP_RECIPE_EXIST)); } @Override @Transactional(readOnly = false) public Boolean deleteTempRecipe(Long tempId, Member member) { - TempRecipe findTempRecipe = tempRecipeRepository.findById(tempId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_TEMP_RECIPE_EXIST)); + TempRecipe findTempRecipe = tempRecipeRepository.findById(tempId).orElseThrow(() -> new RecipeException(CommonStatus.NO_TEMP_RECIPE_EXIST)); if (findTempRecipe.getMember().equals(member)) { if(findTempRecipe.getThumbnailUrl() != null) @@ -300,7 +297,7 @@ public Boolean deleteTempRecipe(Long tempId, Member member) { tempRecipeRepository.deleteById(tempId); } else - throw new RecipeException(RecipeStatus.NOT_RECIPE_OWNER); + throw new RecipeException(CommonStatus.NOT_RECIPE_OWNER); return tempRecipeRepository.existsById(tempId) == false; } @@ -308,7 +305,7 @@ public Boolean deleteTempRecipe(Long tempId, Member member) { @Override @Transactional(readOnly = false) public Recipe createFromTempRecipe(Long tempId, RecipeRequestDto.RecipeCategoryList categoryList, Member member) { - TempRecipe tempRecipe = tempRecipeRepository.findById(tempId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_TEMP_RECIPE_EXIST)); + TempRecipe tempRecipe = tempRecipeRepository.findById(tempId).orElseThrow(() -> new RecipeException(CommonStatus.NO_TEMP_RECIPE_EXIST)); List tempSteps = tempStepRepository.findAllByTempRecipe(tempRecipe); List tempIngredients = tempIngredientRepository.findAllByTempRecipe(tempRecipe); @@ -365,11 +362,11 @@ public Page getTempRecipeList(Integer pageIndex, Member member) { @Override public Recipe getRecipe(Long recipeId, Member member) { - Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(()->new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); + Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(()->new RecipeException(CommonStatus.NO_RECIPE_EXIST)); Optional blockedInfos= blockedMemberRepository.findByOwnerAndBlocked(member, findRecipe.getMember()); if(blockedInfos.isPresent()){ - throw new RecipeException(RecipeStatus.BLOCKED_USER_RECIPE); + throw new RecipeException(CommonStatus.BLOCKED_USER_RECIPE); } else { findRecipe.updateView(); @@ -402,7 +399,7 @@ public Page searchRecipe(Long categoryId, String keyword, Integer pageIn List recipeCategory = recipeCategoryRepository.findAllById(categoryId); if(recipeCategory.isEmpty()) - throw new RecipeException(RecipeStatus.RECIPE_NOT_FOUND); + throw new RecipeException(CommonStatus.RECIPE_NOT_FOUND); QRecipe qRecipe = recipe; QRecipeCategoryMapping qRecipeCategoryMapping = recipeCategoryMapping; @@ -458,7 +455,7 @@ else if (writtenby.equals("common")) else if (writtenby.equals("official")) return recipe.isOfficial.eq(true); else - throw new RecipeException(RecipeStatus.WRITTEN_BY_TYPE_ERROR); + throw new RecipeException(CommonStatus.WRITTEN_BY_TYPE_ERROR); } private BooleanExpression blockedMemberNotInForRecipe(Member member) { @@ -487,10 +484,10 @@ private List getBlockedMember(Member member) { @Override @Transactional(readOnly = false) public Recipe updateLikeOnRecipe(Long recipeId, Member member) { - Recipe recipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); + Recipe recipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); if(recipe.getMember() == member) - throw new RecipeException(RecipeStatus.RECIPE_OWNER); + throw new RecipeException(CommonStatus.RECIPE_OWNER); Optional likesExist = likesRepository.findByRecipeAndMember(recipe,member); @@ -509,10 +506,10 @@ public Recipe updateLikeOnRecipe(Long recipeId, Member member) { @Override @Transactional(readOnly = false) public Recipe updateScrapOnRecipe(Long recipeId, Member member) { - Recipe recipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); + Recipe recipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); if(recipe.getMember() == member) - throw new RecipeException(RecipeStatus.RECIPE_OWNER); + throw new RecipeException(CommonStatus.RECIPE_OWNER); Optional scrapExist = scrapRepository.findByRecipeAndMember(recipe,member); if(scrapExist.isEmpty()) { @@ -568,7 +565,7 @@ public Page recipeListByCategory(Long categoryId, Integer pageIndex, Mem List recipeCategory = recipeCategoryRepository.findAllById(categoryId); if(recipeCategory.isEmpty()) - throw new RecipeException(RecipeStatus.RECIPE_NOT_FOUND); + throw new RecipeException(CommonStatus.RECIPE_NOT_FOUND); QRecipe qRecipe = recipe; QRecipeCategoryMapping qRecipeCategoryMapping = recipeCategoryMapping; @@ -653,7 +650,7 @@ else if(order.equals("follow")) else if(order.equals("latest")) return new OrderSpecifier(Order.DESC, recipe.createdAt); else - throw new RecipeException(RecipeStatus.ORDER_BY_TYPE_ERROR); + throw new RecipeException(CommonStatus.ORDER_BY_TYPE_ERROR); } @Override @@ -784,7 +781,7 @@ public List getRecipeBannerList() { @Transactional(readOnly = false) @Override public Boolean deleteRecipe(Long recipeId, Member member) { - Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); + Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); if (findRecipe.getMember().equals(member)) { amazonS3Manager.deleteFile(RecipeConverter.toKeyName(findRecipe.getThumbnailUrl()).substring(1)); @@ -793,7 +790,7 @@ public Boolean deleteRecipe(Long recipeId, Member member) { recipeRepository.deleteById(recipeId); } else - throw new RecipeException(RecipeStatus.NOT_RECIPE_OWNER); + throw new RecipeException(CommonStatus.NOT_RECIPE_OWNER); return recipeRepository.existsById(recipeId) == false; } @@ -801,7 +798,7 @@ public Boolean deleteRecipe(Long recipeId, Member member) { @Transactional(readOnly = false) @Override public Long reportRecipe(Long recipeId, Long reportId, Member member) { - Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); + Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); Report findReport = reportRepository.findById(reportId).orElseThrow(() -> new RecipeException(CommonStatus.NO_REPORT_EXIST)); if (!findRecipe.getMember().equals(member)) { @@ -811,13 +808,13 @@ public Long reportRecipe(Long recipeId, Long reportId, Member member) { return findRecipe.getId(); } else - throw new RecipeException(RecipeStatus.RECIPE_OWNER); + throw new RecipeException(CommonStatus.RECIPE_OWNER); } @Transactional(readOnly = false) @Override public Comment createComment(String content, Long recipeId, Member member){ - Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); + Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); findRecipe.updateComment(1); List existAlarms = pushAlarmRepository.findByTitleAndOwnerMemberAndIsConfirmedFalse("나의 글에 댓글이 달렸어요. 확인해보세요!", findRecipe.getMember()); @@ -873,7 +870,7 @@ public Comment createComment(String content, Long recipeId, Member member){ @Override public Page commentList(Integer pageIndex, Long recipeId, Member member) { - Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); + Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); QComment qComment = comment; @@ -895,7 +892,7 @@ public Page commentList(Integer pageIndex, Long recipeId, Member member ); if (count.fetchOne() == 0) - throw new RecipeException(RecipeStatus.COMMENT_NOT_FOUND); + throw new RecipeException(CommonStatus.COMMENT_NOT_FOUND); return PageableExecutionUtils.getPage(content,PageRequest.of(pageIndex,pageSize), ()->count.fetchOne()); } @@ -909,13 +906,13 @@ private BooleanExpression blockedMemberNotInForComment(Member member) { @Transactional(readOnly = false) @Override public Boolean deleteComment(Long recipeId, Long commentId, Member member) { - Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); - Comment findComment = commentRepository.findById(commentId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_COMMENT_EXIST)); + Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); + Comment findComment = commentRepository.findById(commentId).orElseThrow(() -> new RecipeException(CommonStatus.NO_COMMENT_EXIST)); if (!findComment.getMember().equals(member)) - throw new RecipeException(RecipeStatus.NOT_COMMENT_OWNER); + throw new RecipeException(CommonStatus.NOT_COMMENT_OWNER); else if (!findComment.getRecipe().equals(findRecipe)) - throw new RecipeException(RecipeStatus.NOT_MATCH_RECIPE); + throw new RecipeException(CommonStatus.NOT_MATCH_RECIPE); else{ commentRepository.deleteById(commentId); findRecipe.updateComment(-1); @@ -927,13 +924,13 @@ else if (!findComment.getRecipe().equals(findRecipe)) @Transactional(readOnly = false) @Override public Comment updateComment(RecipeRequestDto.updateCommentDto request, Long recipeId, Long commentId, Member member) { - Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); - Comment findComment = commentRepository.findById(commentId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_COMMENT_EXIST)); + Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); + Comment findComment = commentRepository.findById(commentId).orElseThrow(() -> new RecipeException(CommonStatus.NO_COMMENT_EXIST)); if (!findComment.getMember().equals(member)) - throw new RecipeException(RecipeStatus.NOT_COMMENT_OWNER); + throw new RecipeException(CommonStatus.NOT_COMMENT_OWNER); else if (!findComment.getRecipe().equals(findRecipe)) - throw new RecipeException(RecipeStatus.NOT_MATCH_RECIPE); + throw new RecipeException(CommonStatus.NOT_MATCH_RECIPE); else{ return findComment.updateContent(request.getComment()); } @@ -942,14 +939,14 @@ else if (!findComment.getRecipe().equals(findRecipe)) @Transactional(readOnly = false) @Override public Long reportComment(Long recipeId, Long commentId, Long reportId, Member member) { - Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_RECIPE_EXIST)); - Comment findComment = commentRepository.findById(commentId).orElseThrow(() -> new RecipeException(RecipeStatus.NO_COMMENT_EXIST)); + Recipe findRecipe = recipeRepository.findById(recipeId).orElseThrow(() -> new RecipeException(CommonStatus.NO_RECIPE_EXIST)); + Comment findComment = commentRepository.findById(commentId).orElseThrow(() -> new RecipeException(CommonStatus.NO_COMMENT_EXIST)); Report findReport = reportRepository.findById(reportId).orElseThrow(() -> new RecipeException(CommonStatus.NO_REPORT_EXIST)); if (findComment.getMember().equals(member)) - throw new RecipeException(RecipeStatus.COMMENT_OWNER); + throw new RecipeException(CommonStatus.COMMENT_OWNER); else if (!findComment.getRecipe().equals(findRecipe)) - throw new RecipeException(RecipeStatus.NOT_MATCH_RECIPE); + throw new RecipeException(CommonStatus.NOT_MATCH_RECIPE); else{ ReportedComment mapping = RecipeConverter.toCommentReport(findReport, findComment, member); reportedCommentRepository.save(mapping); diff --git a/src/main/java/zipdabang/server/validation/annotation/ExistInquery.java b/src/main/java/zipdabang/server/validation/annotation/ExistInquery.java new file mode 100644 index 0000000..c2341b1 --- /dev/null +++ b/src/main/java/zipdabang/server/validation/annotation/ExistInquery.java @@ -0,0 +1,18 @@ +package zipdabang.server.validation.annotation; + +import zipdabang.server.validation.validator.ExistInqueryValidator; +import zipdabang.server.validation.validator.ExistNicknameValidator; + +import javax.validation.Constraint; +import javax.validation.Payload; +import java.lang.annotation.*; + +@Documented +@Constraint(validatedBy = ExistInqueryValidator.class) +@Target( { ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER }) +@Retention(RetentionPolicy.RUNTIME) +public @interface ExistInquery { + String message() default "해당하는 문의가 존재하지 않습니다."; + Class[] groups() default {}; + Class[] payload() default {}; +} diff --git a/src/main/java/zipdabang/server/validation/validator/ExistInqueryValidator.java b/src/main/java/zipdabang/server/validation/validator/ExistInqueryValidator.java new file mode 100644 index 0000000..70aa653 --- /dev/null +++ b/src/main/java/zipdabang/server/validation/validator/ExistInqueryValidator.java @@ -0,0 +1,35 @@ +package zipdabang.server.validation.validator; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import zipdabang.server.apiPayload.code.CommonStatus; +import zipdabang.server.domain.member.Inquery; +import zipdabang.server.service.MemberService; +import zipdabang.server.validation.annotation.ExistInquery; +import zipdabang.server.validation.annotation.ExistNickname; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; +import java.util.Optional; + +@RequiredArgsConstructor +@Component +public class ExistInqueryValidator implements ConstraintValidator { + + private final MemberService memberService; + + @Override + public void initialize(ExistInquery constraintAnnotation) { + ConstraintValidator.super.initialize(constraintAnnotation); + } + + @Override + public boolean isValid(Long value, ConstraintValidatorContext context) { + if (memberService.findInqueryById(value).isEmpty()) { + context.disableDefaultConstraintViolation(); + context.buildConstraintViolationWithTemplate(CommonStatus.INQUERY_NOT_FOUND.toString()).addConstraintViolation(); + return false; + } + return true; + } +} diff --git a/src/main/java/zipdabang/server/validation/validator/ExistRecipeCategoryValidator.java b/src/main/java/zipdabang/server/validation/validator/ExistRecipeCategoryValidator.java index a707bf7..296f9f9 100644 --- a/src/main/java/zipdabang/server/validation/validator/ExistRecipeCategoryValidator.java +++ b/src/main/java/zipdabang/server/validation/validator/ExistRecipeCategoryValidator.java @@ -3,7 +3,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import zipdabang.server.apiPayload.code.CommonStatus; -import zipdabang.server.apiPayload.code.RecipeStatus; import zipdabang.server.domain.recipe.RecipeCategory; import zipdabang.server.repository.recipeRepositories.RecipeCategoryRepository; import zipdabang.server.validation.annotation.ExistRecipeCategory; @@ -28,7 +27,7 @@ public boolean isValid(Long value, ConstraintValidatorContext context) { Optional findRecipeCategory = recipeCategoryRepository.findById(value); if(findRecipeCategory.isEmpty()){ context.disableDefaultConstraintViolation(); - context.buildConstraintViolationWithTemplate(RecipeStatus.NO_RECIPE_CATEGORY_EXIST.toString()).addConstraintViolation(); + context.buildConstraintViolationWithTemplate(CommonStatus.NO_RECIPE_CATEGORY_EXIST.toString()).addConstraintViolation(); return false; } return true; diff --git a/src/main/java/zipdabang/server/web/controller/MemberRestController.java b/src/main/java/zipdabang/server/web/controller/MemberRestController.java index 2b00794..662aa6a 100644 --- a/src/main/java/zipdabang/server/web/controller/MemberRestController.java +++ b/src/main/java/zipdabang/server/web/controller/MemberRestController.java @@ -36,10 +36,7 @@ import zipdabang.server.service.MemberService; import zipdabang.server.sms.service.SmsService; import zipdabang.server.utils.dto.OAuthJoin; -import zipdabang.server.validation.annotation.CheckPage; -import zipdabang.server.validation.annotation.CheckTempMember; -import zipdabang.server.validation.annotation.CheckDeregister; -import zipdabang.server.validation.annotation.ExistMember; +import zipdabang.server.validation.annotation.*; import zipdabang.server.web.dto.requestDto.MemberRequestDto; import zipdabang.server.web.dto.responseDto.MemberResponseDto; @@ -340,6 +337,23 @@ public ResponseDto showInquery(@CheckTempMembe return ResponseDto.of(MemberConverter.toInqueryListDto(inqueryPage)); } + @Operation(summary = "🎪[더보기 - 나의 문의내역2] 내 문의내역 상세조회 ✔️🔑", description = "내 문의 상세조회 API") + @Parameters({ + @Parameter(name = "member", hidden = true), + @Parameter(name = "inqueryId", description = "문의 아이디"), + }) + @ApiResponses({ + @ApiResponse(responseCode = "2000", description = "OK 성공"), + @ApiResponse(responseCode = "4067", description = "NOT_FOUND , 문의가 없음", content = @Content(schema = @Schema(implementation = ResponseDto.class))), + @ApiResponse(responseCode = "4068", description = "BAD_REQEUST , 내 문의 아님", content = @Content(schema = @Schema(implementation = ResponseDto.class))), + + }) + @GetMapping("/members/inquiries/{inqueryId}") + public ResponseDto showInquerySepc(@CheckTempMember @AuthMember Member member,@ExistInquery @PathVariable(name = "inqueryId") Long inqueryId){ + Inquery myInquryById = memberService.findMyInqueryById(member,inqueryId); + return ResponseDto.of(MemberConverter.toInquerySpecDto(myInquryById)); + } + @Operation(summary = "[figma 더보기 - 회원 탈퇴] 회원 탈퇴 API ✔️🔑", description = "회원 탈퇴 API입니다.
테스트를 위해 임시로 해당 유저의 상세주소를 \"TEST\" 로 설정하면(상세정보 수정 API - zipCode) 탈퇴 불가능한 경우로 처리되도록 해놨습니다.
deregisterTypes 종류
" + "- NOTHING_TO_BUY(\"사고싶은 물건이 없어요.\"),
" + "- DISINTERESTED(\"앱을 이용하지 않아요.\"),
" + diff --git a/src/main/java/zipdabang/server/web/controller/RecipeRestController.java b/src/main/java/zipdabang/server/web/controller/RecipeRestController.java index 2719808..066a5aa 100644 --- a/src/main/java/zipdabang/server/web/controller/RecipeRestController.java +++ b/src/main/java/zipdabang/server/web/controller/RecipeRestController.java @@ -10,13 +10,11 @@ import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.jetbrains.annotations.NotNull; import org.springframework.data.domain.Page; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import zipdabang.server.apiPayload.code.CommonStatus; -import zipdabang.server.apiPayload.code.RecipeStatus; import zipdabang.server.apiPayload.exception.handler.MemberException; import zipdabang.server.apiPayload.reponse.ResponseDto; import zipdabang.server.auth.handler.annotation.AuthMember; @@ -229,7 +227,7 @@ public ResponseDto getTempRecipeList(@CheckP log.info(tempRecipes.toString()); if (tempRecipes.getTotalElements() == 0) - throw new RecipeException(RecipeStatus.TEMP_RECIPE_NOT_FOUND); + throw new RecipeException(CommonStatus.TEMP_RECIPE_NOT_FOUND); if (pageIndex >= tempRecipes.getTotalPages()) throw new RecipeException(CommonStatus.OVER_PAGE_INDEX_ERROR); @@ -341,7 +339,7 @@ else if (pageIndex < 1) Page recipes = recipeService.searchRecipe(categoryId, keyword, pageIndex, member); if (recipes.getTotalElements() == 0) - throw new RecipeException(RecipeStatus.RECIPE_NOT_FOUND); + throw new RecipeException(CommonStatus.RECIPE_NOT_FOUND); if (pageIndex >= recipes.getTotalPages()) throw new RecipeException(CommonStatus.OVER_PAGE_INDEX_ERROR); @@ -406,7 +404,7 @@ public ResponseDto recipeListByCategory(@Ex log.info(recipes.toString()); if (recipes.getTotalElements() == 0) - throw new RecipeException(RecipeStatus.RECIPE_NOT_FOUND); + throw new RecipeException(CommonStatus.RECIPE_NOT_FOUND); if (pageIndex >= recipes.getTotalPages()) throw new RecipeException(CommonStatus.OVER_PAGE_INDEX_ERROR); @@ -435,7 +433,7 @@ public ResponseDto recipeListPreviewWrittenBy(@ log.info(recipes.toString()); if (recipes.size() == 0) - throw new RecipeException(RecipeStatus.RECIPE_NOT_FOUND); + throw new RecipeException(CommonStatus.RECIPE_NOT_FOUND); return ResponseDto.of(RecipeConverter.toPreviewRecipeDtoList(recipes, member)); } @@ -531,7 +529,7 @@ public ResponseDto recipeByOwner(@CheckPage log.info(recipes.toString()); if (recipes.getTotalElements() == 0) - throw new RecipeException(RecipeStatus.RECIPE_NOT_FOUND); + throw new RecipeException(CommonStatus.RECIPE_NOT_FOUND); if (pageIndex >= recipes.getTotalPages()) throw new RecipeException(CommonStatus.OVER_PAGE_INDEX_ERROR); @@ -565,7 +563,7 @@ public ResponseDto myRecipeList(@CheckPage log.info(recipes.toString()); if (recipes.getTotalElements() == 0) - throw new RecipeException(RecipeStatus.RECIPE_NOT_FOUND); + throw new RecipeException(CommonStatus.RECIPE_NOT_FOUND); if (pageIndex >= recipes.getTotalPages()) throw new RecipeException(CommonStatus.OVER_PAGE_INDEX_ERROR); diff --git a/src/main/java/zipdabang/server/web/dto/responseDto/MemberResponseDto.java b/src/main/java/zipdabang/server/web/dto/responseDto/MemberResponseDto.java index c7dac87..7bae43b 100644 --- a/src/main/java/zipdabang/server/web/dto/responseDto/MemberResponseDto.java +++ b/src/main/java/zipdabang/server/web/dto/responseDto/MemberResponseDto.java @@ -313,4 +313,15 @@ public static class PushAlarmListDto{ Boolean isFirst; Boolean isLast; } + + @Builder + @Getter + @AllArgsConstructor(access = AccessLevel.PROTECTED) + @NoArgsConstructor(access = AccessLevel.PROTECTED) + public static class InquerySpecDto{ + String receiveEmail; + String title; + String body; + List imageList; + } }