diff --git a/genti-api/src/main/java/com/gt/genti/picture/dto/response/CommonPictureResponseDto.java b/genti-api/src/main/java/com/gt/genti/picture/dto/response/CommonPictureResponseDto.java index bc8d5edf..87eb30d3 100644 --- a/genti-api/src/main/java/com/gt/genti/picture/dto/response/CommonPictureResponseDto.java +++ b/genti-api/src/main/java/com/gt/genti/picture/dto/response/CommonPictureResponseDto.java @@ -30,6 +30,7 @@ public class CommonPictureResponseDto { "PictureCompleted", "PictureCreatedByCreator", "PicturePose", + "PictureUserVerification", "PicturePost", "PictureProfile", "PictureUserFace", diff --git a/genti-api/src/main/java/com/gt/genti/picturegeneraterequest/dto/response/PGREQAdminMatchedDetailFindByAdminResponseDto.java b/genti-api/src/main/java/com/gt/genti/picturegeneraterequest/dto/response/PGREQAdminMatchedDetailFindByAdminResponseDto.java index 7ca443b0..042493aa 100644 --- a/genti-api/src/main/java/com/gt/genti/picturegeneraterequest/dto/response/PGREQAdminMatchedDetailFindByAdminResponseDto.java +++ b/genti-api/src/main/java/com/gt/genti/picturegeneraterequest/dto/response/PGREQAdminMatchedDetailFindByAdminResponseDto.java @@ -37,6 +37,8 @@ public class PGREQAdminMatchedDetailFindByAdminResponseDto { String promptAdvanced; @Schema(description = "구도 참고 사진", nullable = true) CommonPictureResponseDto posePicture; + @Schema(description = "본인 인증 사진", nullable = true) + CommonPictureResponseDto pictureUserVerification; @Schema(description = "사용자의 얼굴 사진") List facePictureList; @@ -50,7 +52,7 @@ public class PGREQAdminMatchedDetailFindByAdminResponseDto { @Builder public PGREQAdminMatchedDetailFindByAdminResponseDto(Long pictureGenerateRequestId, String requesterEmail, Sex sex, String prompt, PictureRatio pictureRatio, String promptAdvanced, List facePictureList, - CommonPictureResponseDto posePicture, CameraAngle cameraAngle, ShotCoverage shotCoverage, + CommonPictureResponseDto posePicture, CommonPictureResponseDto pictureUserVerification,CameraAngle cameraAngle, ShotCoverage shotCoverage, LocalDateTime createdAt, List responseList) { this.pictureGenerateRequestId = pictureGenerateRequestId; this.requesterEmail = requesterEmail; @@ -60,6 +62,7 @@ public PGREQAdminMatchedDetailFindByAdminResponseDto(Long pictureGenerateRequest this.promptAdvanced = promptAdvanced; this.facePictureList = facePictureList; this.posePicture = posePicture; + this.pictureUserVerification = pictureUserVerification; this.cameraAngle = cameraAngle; this.shotCoverage = shotCoverage; this.createdAt = createdAt; diff --git a/genti-api/src/main/java/com/gt/genti/picturegeneraterequest/service/PictureGenerateRequestService.java b/genti-api/src/main/java/com/gt/genti/picturegeneraterequest/service/PictureGenerateRequestService.java index becdf808..84d7cebf 100644 --- a/genti-api/src/main/java/com/gt/genti/picturegeneraterequest/service/PictureGenerateRequestService.java +++ b/genti-api/src/main/java/com/gt/genti/picturegeneraterequest/service/PictureGenerateRequestService.java @@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; +import com.gt.genti.picture.userverification.model.PictureUserVerification; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.redis.core.RedisTemplate; @@ -343,8 +344,22 @@ private Function responseList) { +// Optional foundUser = userRepository.findById(pgreq.getRequester().getId()); +// User user = foundUser.orElse(null); +// PictureUserVerification puv; +// if(user == null) { +// puv = null; +// } else{ +// Optional pe = user.getPictureUserVerificationList().stream().findFirst(); +// puv = pe.orElse(null); +// } + User user = userRepository.findById(pgreq.getRequester().getId()).orElse(null); + PictureUserVerification puv = (user != null) + ? user.getPictureUserVerificationList().stream().findFirst().orElse(null) + : null; return PGREQAdminMatchedDetailFindByAdminResponseDto.builder() .posePicture(CommonPictureResponseDto.of(pgreq.getPicturePose())) + .pictureUserVerification(CommonPictureResponseDto.of(puv)) .cameraAngle(pgreq.getCameraAngle()) .facePictureList(pgreq.getUserFacePictureList().stream().map(CommonPictureResponseDto::of).toList()) .requesterEmail(pgreq.getRequester().getEmail())