Skip to content

Commit

Permalink
RAC-184 fix : certification등록시 이전 이미지 삭제 코드 제거
Browse files Browse the repository at this point in the history
인증성공시 수동 제거 예정
  • Loading branch information
ywj9811 committed Nov 25, 2023
1 parent f22765a commit 4104f9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.postgraduate.domain.image.application.usecase;

import com.postgraduate.domain.image.application.dto.res.ImageUrlResponse;
import com.postgraduate.domain.senior.domain.entity.Senior;
import com.postgraduate.domain.senior.domain.service.SeniorGetService;
import com.postgraduate.domain.user.domain.entity.User;
import com.postgraduate.global.config.s3.S3UploadService;
import lombok.RequiredArgsConstructor;
Expand All @@ -13,12 +11,8 @@
@RequiredArgsConstructor
public class ImageUploadUseCase {
private final S3UploadService uploadService;
private final SeniorGetService seniorGetService;

public ImageUrlResponse uploadCertification(User user, MultipartFile certification) {
Senior senior = seniorGetService.byUser(user);
if (senior.getCertification() != null)
uploadService.deleteCertificationImage(senior.getCertification());
public ImageUrlResponse uploadCertification(MultipartFile certification) {
String url = uploadService.saveCertificationFile(certification);
return new ImageUrlResponse(url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ public ResponseDto<PreSignedUrlResponse> getCertificationPreSignedUrl(@RequestBo
}

@PostMapping("/upload/profile")
@Operation(summary = "USER Profile 업로드 후 업로드 URL return", description = "profileFile 사진 Multipart File로 보내주세요")
@Operation(summary = "USER Profile 업로드 후 업로드 URL return / 토큰 필요", description = "profileFile 사진 Multipart File로 보내주세요")
public ResponseDto<ImageUrlResponse> getProfileUrl(@AuthenticationPrincipal User user, @RequestPart MultipartFile profileFile) {
ImageUrlResponse imageUrlResponse = imageUploadUseCase.uploadProfile(user, profileFile);
return ResponseDto.create(IMAGE_CREATE.getCode(), UPLOAD_URL.getMessage(), imageUrlResponse);
}

@PostMapping("/upload/certification")
@Operation(summary = "SENIOR Certification 업로드 후 업로드 URL return", description = "certificationFile 사진 Multipart File로 보내주세요")
public ResponseDto<ImageUrlResponse> getCertificationUrl(@AuthenticationPrincipal User user, @RequestPart MultipartFile certificationFile) {
ImageUrlResponse imageUrlResponse = imageUploadUseCase.uploadCertification(user, certificationFile);
public ResponseDto<ImageUrlResponse> getCertificationUrl(@RequestPart MultipartFile certificationFile) {
ImageUrlResponse imageUrlResponse = imageUploadUseCase.uploadCertification(certificationFile);
return ResponseDto.create(IMAGE_CREATE.getCode(), UPLOAD_URL.getMessage(), imageUrlResponse);
}
}

0 comments on commit 4104f9e

Please sign in to comment.