diff --git a/Match-Api/src/main/generated/com/example/matchapi/admin/notice/mapper/AdminNoticeMapperImpl.java b/Match-Api/src/main/generated/com/example/matchapi/admin/notice/mapper/AdminNoticeMapperImpl.java index 0bd2a686..f297dbaa 100644 --- a/Match-Api/src/main/generated/com/example/matchapi/admin/notice/mapper/AdminNoticeMapperImpl.java +++ b/Match-Api/src/main/generated/com/example/matchapi/admin/notice/mapper/AdminNoticeMapperImpl.java @@ -10,7 +10,7 @@ @Generated( value = "org.mapstruct.ap.MappingProcessor", - date = "2024-01-17T19:31:30+0900", + date = "2024-03-13T17:32:00+0900", comments = "version: 1.5.3.Final, compiler: javac, environment: Java 11.0.19 (Oracle Corporation)" ) public class AdminNoticeMapperImpl implements AdminNoticeMapper { @@ -43,6 +43,23 @@ public Notice toEntityNotice(NoticeUploadReq noticeUploadReq) { return notice.build(); } + @Override + public NoticeContent toEntityNoticeContent(ContentsList contentsList, Long noticeId) { + if ( contentsList == null && noticeId == null ) { + return null; + } + + NoticeContent.NoticeContentBuilder noticeContent = NoticeContent.builder(); + + if ( contentsList != null ) { + noticeContent.contentsType( contentsList.getContentsType() ); + noticeContent.contents( contentsList.getContents() ); + } + noticeContent.noticeId( noticeId ); + + return noticeContent.build(); + } + protected NoticeContent contentsListToNoticeContent(ContentsList contentsList) { if ( contentsList == null ) { return null; diff --git a/Match-Api/src/main/java/com/example/matchapi/admin/project/controller/AdminProjectController.java b/Match-Api/src/main/java/com/example/matchapi/admin/project/controller/AdminProjectController.java index c037d768..c11b24de 100644 --- a/Match-Api/src/main/java/com/example/matchapi/admin/project/controller/AdminProjectController.java +++ b/Match-Api/src/main/java/com/example/matchapi/admin/project/controller/AdminProjectController.java @@ -109,27 +109,15 @@ public CommonResponse patchActiveProject(@PathVariable Long projectId){ } @Operation(summary = "ADMIN-03-06💻 프로젝트 글 수정.",description = "프로젝트 글 수정 API 입니다.") - @PatchMapping(value = "/{projectId}", consumes = {"multipart/form-data"}, produces = "application/json") + @RequestMapping(value = "/modify/{projectId}", consumes = {"multipart/form-data"}, method = RequestMethod.POST) @ApiErrorCodeExample({UserAuthErrorCode.class, ProjectGetErrorCode.class}) public CommonResponse patchProject(@PathVariable Long projectId, @RequestPart ProjectReq.ModifyProject modifyProject, - @Schema(description = "대표 이미지 파일 변경될 경우") @RequestPart(value = "presentFile", required = false) MultipartFile presentFile, - @Schema(description = "이미지 리스트 추가될 경우")@RequestPart(value = "multipartFiles", required = false) List multipartFiles){ + @RequestPart(value = "presentFile", required = false) MultipartFile presentFile, + @RequestPart(value = "multipartFiles", required = false) List multipartFiles){ projectService.patchProject(projectId, modifyProject, presentFile, multipartFiles); return CommonResponse.onSuccess("수정 성공"); } - /* - @Operation(summary = "ADMIN-03-07💻 프로젝트 이미지 수정", description = "프로젝트 이미지 수정 API") - @PatchMapping(value = "/img/{projectId}/{projectImgId}", consumes = {"multipart/form-data"}, produces = "application/json") - @ApiErrorCodeExample({UserAuthErrorCode.class, PatchProjectImageErrorCode.class, FileUploadException.class}) - public CommonResponse modifyProjectImg(@PathVariable Long projectId, @PathVariable Long projectImgId, - @RequestPart("img") MultipartFile multipartFile){ - if(multipartFile.isEmpty()) throw new BadRequestException(FILE_UPLOAD_NOT_EMPTY); - ProjectRes.PatchProjectImg patchProjectImg = projectService.modifyProjectImg(projectId, projectImgId, multipartFile); - return CommonResponse.onSuccess(patchProjectImg); - } - */ - } diff --git a/Match-Api/src/main/java/com/example/matchapi/config/WebConfig.java b/Match-Api/src/main/java/com/example/matchapi/config/WebConfig.java index 2349aab3..61c0564d 100644 --- a/Match-Api/src/main/java/com/example/matchapi/config/WebConfig.java +++ b/Match-Api/src/main/java/com/example/matchapi/config/WebConfig.java @@ -60,7 +60,10 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) { @Bean public CommonsMultipartResolver multipartResolver() { - return new CommonsMultipartResolver(); + CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(); + multipartResolver.setMaxUploadSize(524288000); // 20MB + multipartResolver.setMaxUploadSizePerFile(524288000); // 5MB + return multipartResolver; } } diff --git a/Match-Api/src/main/java/com/example/matchapi/project/dto/ProjectReq.java b/Match-Api/src/main/java/com/example/matchapi/project/dto/ProjectReq.java index 978e3ecf..ba2aa725 100644 --- a/Match-Api/src/main/java/com/example/matchapi/project/dto/ProjectReq.java +++ b/Match-Api/src/main/java/com/example/matchapi/project/dto/ProjectReq.java @@ -74,8 +74,6 @@ public static class ModifyProject { @NotNull(message = "기부 프로젝트 종류 날자를 입력해주세요") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") private LocalDateTime endDate; - @Enum(message = "DOG, CHILDREN,YOUTH,WOMEN, ELDER, DISABLED, SOCIAL, EARTH, NEIGHBOR, ANIMAL, ENVIRONMENT 중 입력해주세요") - private ProjectKind projectKind; @Schema(description = "추천 검색어", required = false) private String searchKeyword; @Schema(description = "삭제할 이미지 리스트", required = false) diff --git a/Match-Api/src/main/java/com/example/matchapi/project/service/ProjectService.java b/Match-Api/src/main/java/com/example/matchapi/project/service/ProjectService.java index da395554..6ac51662 100644 --- a/Match-Api/src/main/java/com/example/matchapi/project/service/ProjectService.java +++ b/Match-Api/src/main/java/com/example/matchapi/project/service/ProjectService.java @@ -156,7 +156,7 @@ public void patchProject(Long projectId, ProjectReq.ModifyProject modifyProject, List multipartFiles) { Project project = projectAdaptor.findById(projectId); - project.modifyProject(modifyProject.getProjectName(), modifyProject.getUsages(), modifyProject.getDetail(), modifyProject.getRegularStatus(), modifyProject.getStartDate(), modifyProject.getEndDate(), modifyProject.getProjectKind(), modifyProject.getSearchKeyword()); + project.modifyProject(modifyProject.getProjectName(), modifyProject.getUsages(), modifyProject.getDetail(), modifyProject.getRegularStatus(), modifyProject.getStartDate(), modifyProject.getEndDate(), modifyProject.getSearchKeyword()); projectImgService.updateImageLists(project, modifyProject.getDeleteImageList(), presentFile, multipartFiles); diff --git a/Match-Domain/src/main/java/com/example/matchdomain/project/entity/Project.java b/Match-Domain/src/main/java/com/example/matchdomain/project/entity/Project.java index 50089ef4..5f1f6155 100644 --- a/Match-Domain/src/main/java/com/example/matchdomain/project/entity/Project.java +++ b/Match-Domain/src/main/java/com/example/matchdomain/project/entity/Project.java @@ -86,14 +86,13 @@ public Project(Long id, String projectName, String usages, List pr this.projectImage = projectImage; } - public void modifyProject(String projectName, String usages, String detail, RegularStatus regularStatus, LocalDateTime startDate, LocalDateTime endDate, ProjectKind projectKind, String searchKeyword) { + public void modifyProject(String projectName, String usages, String detail, RegularStatus regularStatus, LocalDateTime startDate, LocalDateTime endDate, String searchKeyword) { this.projectName = projectName; this.usages = usages; this.projectExplanation = detail; this.regularStatus = regularStatus; this.startedAt = startDate; this.finishedAt = endDate; - this.projectKind = projectKind; this.searchKeyword = searchKeyword; } } diff --git a/Match-Infrastructure/src/main/java/com/example/matchinfrastructure/pay/portone/aop/AopForPayment.java b/Match-Infrastructure/src/main/java/com/example/matchinfrastructure/pay/portone/aop/AopForPayment.java index df239a86..059144fa 100644 --- a/Match-Infrastructure/src/main/java/com/example/matchinfrastructure/pay/portone/aop/AopForPayment.java +++ b/Match-Infrastructure/src/main/java/com/example/matchinfrastructure/pay/portone/aop/AopForPayment.java @@ -22,8 +22,6 @@ public class AopForPayment { private final PortOneService portOneService; private final KeyGenerator keyGenerator; - - // @PaymentValidator 어노테이션이 붙은 메소드에서 예외가 발생하면 이 메소드가 호출됩니다. @AfterThrowing(pointcut = "execution(* *(..)) && @annotation(paymentIntercept)", throwing = "exception") public void refundOnPaymentFailure(JoinPoint joinPoint, PaymentIntercept paymentIntercept, Throwable exception) { MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); @@ -32,17 +30,12 @@ public void refundOnPaymentFailure(JoinPoint joinPoint, PaymentIntercept payment String impUid = (String) keyGenerator.getDynamicValue(methodSignature.getParameterNames(), joinPoint.getArgs(), parameter); - log.info("ERROR OCCUR : " + impUid); + log.error("ERROR OCCUR : " + impUid); + try { - if(parameter.contains(CANCEL_IMP_UID)) { - log.info(CANCEL_IMP_UID + " 값 환불"); - log.error("에러 발생 환불 IMP_UID : " + impUid); - portOneService.refundPayment(impUid); - }else{ - log.info(CANCEL_ORDER_ID + " 값 환불"); - log.error("에러 발생 환불 ORDER_ID : " + impUid); - portOneService.refundPaymentOrderId(impUid); - } + portOneService.refundPayment(impUid); + log.error("에러 발생 환불 : " + impUid); + log.error(exception.getMessage()); } catch (Exception e) { log.error("환불 처리 중 에러 발생 IMP_UID : " + impUid); } diff --git a/Match-Infrastructure/src/main/java/com/example/matchinfrastructure/pay/portone/service/PortOneService.java b/Match-Infrastructure/src/main/java/com/example/matchinfrastructure/pay/portone/service/PortOneService.java index 2c674a9e..86a6f8e8 100644 --- a/Match-Infrastructure/src/main/java/com/example/matchinfrastructure/pay/portone/service/PortOneService.java +++ b/Match-Infrastructure/src/main/java/com/example/matchinfrastructure/pay/portone/service/PortOneService.java @@ -1,5 +1,7 @@ package com.example.matchinfrastructure.pay.portone.service; +import static com.example.matchcommon.constants.MatchStatic.*; + import com.example.matchcommon.properties.PortOneProperties; import com.siot.IamportRestClient.IamportClient; import com.siot.IamportRestClient.exception.IamportResponseException;