Skip to content

Commit

Permalink
Merge pull request #179 from Genti2024/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
LeeJae-H authored Sep 30, 2024
2 parents c6f827d + 2d00dca commit 493b485
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class CommonPictureResponseDto {
"PictureCompleted",
"PictureCreatedByCreator",
"PicturePose",
"PictureUserVerification",
"PicturePost",
"PictureProfile",
"PictureUserFace",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class PGREQAdminMatchedDetailFindByAdminResponseDto {
String promptAdvanced;
@Schema(description = "구도 참고 사진", nullable = true)
CommonPictureResponseDto posePicture;
@Schema(description = "본인 인증 사진", nullable = true)
CommonPictureResponseDto pictureUserVerification;
@Schema(description = "사용자의 얼굴 사진")
List<CommonPictureResponseDto> facePictureList;

Expand All @@ -50,7 +52,7 @@ public class PGREQAdminMatchedDetailFindByAdminResponseDto {
@Builder
public PGREQAdminMatchedDetailFindByAdminResponseDto(Long pictureGenerateRequestId, String requesterEmail,
Sex sex, String prompt, PictureRatio pictureRatio, String promptAdvanced, List<CommonPictureResponseDto> facePictureList,
CommonPictureResponseDto posePicture, CameraAngle cameraAngle, ShotCoverage shotCoverage,
CommonPictureResponseDto posePicture, CommonPictureResponseDto pictureUserVerification,CameraAngle cameraAngle, ShotCoverage shotCoverage,
LocalDateTime createdAt, List<PGRESAdminMatchedDetailFindByAdminResponseDto> responseList) {
this.pictureGenerateRequestId = pictureGenerateRequestId;
this.requesterEmail = requesterEmail;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -343,8 +344,22 @@ private Function<PictureGenerateRequest, PGREQAdminMatchedDetailFindByAdminRespo

private PGREQAdminMatchedDetailFindByAdminResponseDto buildAdminMatchedPGREQDetail(PictureGenerateRequest pgreq,
List<PGRESAdminMatchedDetailFindByAdminResponseDto> responseList) {
// Optional<User> foundUser = userRepository.findById(pgreq.getRequester().getId());
// User user = foundUser.orElse(null);
// PictureUserVerification puv;
// if(user == null) {
// puv = null;
// } else{
// Optional<PictureUserVerification> 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())
Expand Down

0 comments on commit 493b485

Please sign in to comment.