Skip to content

Commit

Permalink
Refactor: #218 genti-api - picturegeneraterequest 관련 API 및 메서드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJae-H committed Dec 5, 2024
1 parent 1ff5139 commit 6d333c3
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ public PictureGenerateRequest save(PictureGenerateRequest pictureGenerateRequest
return pictureGenerateRequestRepository.save(pictureGenerateRequest);
}

@Override
public Page<PictureGenerateRequest> findAll(Pageable pageable) {
return pictureGenerateRequestRepository.findAll(pageable);
}

@Override
public Page<PictureGenerateResponse> findByPGRESStatusInAndMatchToAdminIsAndPaidIsNull(
List<PictureGenerateResponseStatus> statusList, boolean matchToAdmin, Pageable pageable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,4 @@ ResponseEntity<ApiResult<Boolean>> confirmCanceledPGREQ(
ResponseEntity<ApiResult<Boolean>> createPictureGenerateRequest(
@AuthUser Long userId,
@RequestBody @Valid PGREQSaveRequestDto pgreqSaveRequestDto);

@Deprecated
@Operation(summary = "사진생성요청 수정", description = "이전에 생성한 사진생성요청을 수정한다", deprecated = true)
@EnumResponses(value = {
@EnumResponse(ResponseCode.OK),
@EnumResponse(ResponseCode.PictureGenerateRequestNotFound),
@EnumResponse(ResponseCode.PictureGenerateRequestAlreadyInProgress)
})
ResponseEntity<ApiResult<Boolean>> modifyPictureGenerateRequest(
@AuthUser Long userId,
@PathVariable(value = "pictureGenerateRequestId")
@Schema(description = "사진생성요청id", example = "1")
Long pictureGenerateRequestId,
@RequestBody @Valid PGREQSaveRequestDto pgreqSaveRequestDto);
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,4 @@ public ResponseEntity<ApiResult<Boolean>> createPaidPictureGenerateRequestForTwo
pictureGenerateRequestUseCase.createPaidPGREQForTwo(userId, advancedPGREQSaveRequestDto.toCommand());
return GentiResponse.success(true);
}

@Deprecated
@Logging(item = LogItem.PGREQ, action = LogAction.UPDATE, requester = LogRequester.USER)
@PutMapping("/{pictureGenerateRequestId}")
public ResponseEntity<ApiResult<Boolean>> modifyPictureGenerateRequest(
@AuthUser Long userId,
@PathVariable(value = "pictureGenerateRequestId")
@Schema(description = "사진생성요청id", example = "1")
Long pictureGenerateRequestId,
@RequestBody @Valid PGREQSaveRequestDto pgreqSaveRequestDto) {
pictureGenerateRequestUseCase.modifyPGREQ(userId, pictureGenerateRequestId,
pgreqSaveRequestDto);
return GentiResponse.success(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public interface PictureGenerateRequestPort {
Page<PictureGenerateResponse> findByPGRESStatusInAndMatchToAdminIsAndPaidIsNull(List<PictureGenerateResponseStatus> statusList,
boolean matchToAdmin, Pageable pageable);

Page<PictureGenerateRequest> findAll(Pageable pageable);

Page<PictureGenerateRequest> findByMatchToAdminIsAndPaidIsNull(boolean matchToAdmin, Pageable pageable);

Page<PictureGenerateRequest> findByMatchToAdminIsAndPaidIsNotNull(boolean matchToAdmin, Pageable pageable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,37 +343,6 @@ private PGREQStatusResponseDto createPGREQStatusResponseDto(PictureGenerateReque
.build();
}

@Override
public void modifyPGREQ(Long userId, Long pictureGenerateRequestId, PGREQSaveRequestDto pgreqSaveRequestDto) {
User foundUser = findUserById(userId);
PictureGenerateRequest findPictureGenerateRequest = pictureGenerateRequestPort.findByIdAndRequester(
pictureGenerateRequestId, foundUser)
.orElseThrow(() -> ExpectedException.withLogging(ResponseCode.PictureGenerateRequestNotFound,
String.format("생성요청한 유저 id : %d 사진생성요청 Id : %d", foundUser.getId(), pictureGenerateRequestId)));

if (findPictureGenerateRequest.getCreator() != null) {
throw ExpectedException.withLogging(ResponseCode.PictureGenerateRequestAlreadyInProgress);
}

PicturePose picturePose = findPictureGenerateRequest.getPicturePose();
String givenPicturePoseKey = pgreqSaveRequestDto.getPosePicture().getKey();
picturePose.modify(givenPicturePoseKey);

List<PictureUserFace> pictureUserFaceList = findPictureGenerateRequest.getUserFacePictureList();
List<String> givenPictureUserFaceKeyList = pgreqSaveRequestDto.getFacePictureList()
.stream()
.map(CommonPictureKeyUpdateRequestDto::getKey)
.toList();
for (int i = 0; i < pictureUserFaceList.size(); i++) {
String newKey = givenPictureUserFaceKeyList.get(i);
pictureUserFaceList.get(i).modify(newKey);
}

findPictureGenerateRequest.modify(pgreqSaveRequestDto.getPrompt(), pgreqSaveRequestDto.getCameraAngle(),
pgreqSaveRequestDto.getShotCoverage(), pgreqSaveRequestDto.getPictureRatio(), picturePose,
pictureUserFaceList);
}

private PGREQStatusResponseDto handleAwaitUserVerification(PictureGenerateRequest foundPGREQ) {
PictureGenerateResponse needVerifyPGRES = foundPGREQ.getResponseList()
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ PictureGenerateRequest createPaidPGREQForOne(Long userId,
PictureGenerateRequest createPaidPGREQForTwo(Long userId,
AdvancedPGREQSaveCommand advancedPGREQSaveCommand);

void modifyPGREQ(Long userId,
Long pictureGenerateRequestId, PGREQSaveRequestDto pgreqSaveRequestDto);

Page<PGREQAdminMatchedDetailFindByAdminResponseDto> getAllAdminMatched(Pageable pageable);

Page<PGREQAdminMatchedDetailFindByAdminResponseDto> getAllAdminMatchedByPGRESStatus(
Expand Down

0 comments on commit 6d333c3

Please sign in to comment.