From 8509d2178d3492aab6e7246647b2534860edad83 Mon Sep 17 00:00:00 2001 From: LeeJaehyung <540900@naver.com> Date: Thu, 31 Oct 2024 18:45:56 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20#185=20=EC=82=AC=EC=A7=84=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EC=9A=94=EC=B2=AD=EB=B7=B0=EC=97=90?= =?UTF-8?q?=EC=84=9C=EC=9D=98=20=EC=98=88=EC=8B=9C=20=EC=82=AC=EC=A7=84=20?= =?UTF-8?q?api=20=EC=9D=91=EB=8B=B5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/UserResponseExampleApi.java | 3 ++- .../controller/UserExampleController.java | 3 ++- .../response/ExampleWithSquarePicture.java | 23 +++++++++++++++++++ .../service/ResponseExampleService.java | 7 +++--- 4 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 genti-api/src/main/java/com/gt/genti/responseexample/dto/response/ExampleWithSquarePicture.java diff --git a/genti-api/src/main/java/com/gt/genti/responseexample/api/UserResponseExampleApi.java b/genti-api/src/main/java/com/gt/genti/responseexample/api/UserResponseExampleApi.java index 0180b97c..7f0a1f9e 100644 --- a/genti-api/src/main/java/com/gt/genti/responseexample/api/UserResponseExampleApi.java +++ b/genti-api/src/main/java/com/gt/genti/responseexample/api/UserResponseExampleApi.java @@ -2,6 +2,7 @@ import java.util.List; +import com.gt.genti.responseexample.dto.response.ExampleWithSquarePicture; import org.springframework.http.ResponseEntity; import com.gt.genti.error.ResponseCode; @@ -30,5 +31,5 @@ public interface UserResponseExampleApi { @EnumResponses(value = { @EnumResponse(ResponseCode.OK) }) - ResponseEntity>> getAllResponseExamplesInGenerateView(); + ResponseEntity>> getAllResponseExamplesInGenerateView(); } diff --git a/genti-api/src/main/java/com/gt/genti/responseexample/controller/UserExampleController.java b/genti-api/src/main/java/com/gt/genti/responseexample/controller/UserExampleController.java index 84112789..04474a09 100644 --- a/genti-api/src/main/java/com/gt/genti/responseexample/controller/UserExampleController.java +++ b/genti-api/src/main/java/com/gt/genti/responseexample/controller/UserExampleController.java @@ -4,6 +4,7 @@ import java.util.List; +import com.gt.genti.responseexample.dto.response.ExampleWithSquarePicture; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -34,7 +35,7 @@ public ResponseEntity>> getAll @Logging(item = LogItem.RESPONSE_EXAMPLE, action = LogAction.VIEW, requester = LogRequester.USER) @GetMapping("/with-picture-square") - public ResponseEntity>> getAllResponseExamplesInGenerateView(){ + public ResponseEntity>> getAllResponseExamplesInGenerateView(){ return success(responseExampleService.getAllResponseExamplesInGenerateView()); } diff --git a/genti-api/src/main/java/com/gt/genti/responseexample/dto/response/ExampleWithSquarePicture.java b/genti-api/src/main/java/com/gt/genti/responseexample/dto/response/ExampleWithSquarePicture.java new file mode 100644 index 00000000..231518f7 --- /dev/null +++ b/genti-api/src/main/java/com/gt/genti/responseexample/dto/response/ExampleWithSquarePicture.java @@ -0,0 +1,23 @@ +package com.gt.genti.responseexample.dto.response; + +import com.gt.genti.aws.AwsUtils; +import com.gt.genti.picture.responseexample.model.ResponseExample; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Schema(name = "[ResponseExample][Admin&User] 사진 생성뷰1에서의 예시 사진 응답 dto") +@Getter +@NoArgsConstructor +public class ExampleWithSquarePicture { + @Schema(description = "해당 사진의 Url", example = "https://**") + String url; + + @Schema(description = "에시 프롬프트", example = "벚꽃길에서 벤치에 앉아있어요") + String prompt; + + public ExampleWithSquarePicture(ResponseExample responseExample) { + this.url = AwsUtils.CLOUDFRONT_BASEURL + "/" + responseExample.getKey(); + this.prompt = responseExample.getExamplePrompt(); + } +} diff --git a/genti-api/src/main/java/com/gt/genti/responseexample/service/ResponseExampleService.java b/genti-api/src/main/java/com/gt/genti/responseexample/service/ResponseExampleService.java index b06781a6..29440e53 100644 --- a/genti-api/src/main/java/com/gt/genti/responseexample/service/ResponseExampleService.java +++ b/genti-api/src/main/java/com/gt/genti/responseexample/service/ResponseExampleService.java @@ -5,6 +5,7 @@ import java.util.Optional; import java.util.stream.Collectors; +import com.gt.genti.responseexample.dto.response.ExampleWithSquarePicture; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; @@ -67,10 +68,10 @@ public void addResponseExamples(List commandList, .build()).toList()); } - public List getAllResponseExamplesInGenerateView() { - List examples = responseExampleRepository.findAllByPromptOnlyIsTrue() + public List getAllResponseExamplesInGenerateView() { + List examples = responseExampleRepository.findAllByPromptOnlyIsTrue() .stream() - .map(ExampleWithPictureFindResponseDto::new) + .map(ExampleWithSquarePicture::new) .collect(Collectors.toList()); Collections.shuffle(examples); From c3d7798fa20693ee860216f280c68df9131adf20 Mon Sep 17 00:00:00 2001 From: LeeJaehyung <540900@naver.com> Date: Thu, 31 Oct 2024 18:52:03 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20#187=20=ED=94=84=EB=A1=A0=ED=8A=B8?= =?UTF-8?q?=20=EA=B0=9C=EB=B0=9C=EC=9E=90=EA=B0=80=20=EC=82=AC=EC=A7=84=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EC=9D=91=EB=8B=B5=EC=9D=84=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=ED=95=98=EB=8A=94=20api=EC=97=90=EC=84=9C=20pgreq=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=20=EB=B3=80=EA=B2=BD=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/PictureGenerateWorkService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/genti-api/src/main/java/com/gt/genti/picturegenerateresponse/service/PictureGenerateWorkService.java b/genti-api/src/main/java/com/gt/genti/picturegenerateresponse/service/PictureGenerateWorkService.java index 61579cb6..c6cb570d 100644 --- a/genti-api/src/main/java/com/gt/genti/picturegenerateresponse/service/PictureGenerateWorkService.java +++ b/genti-api/src/main/java/com/gt/genti/picturegenerateresponse/service/PictureGenerateWorkService.java @@ -323,8 +323,7 @@ public Boolean finishPGRESByFrontend(Long userId){ .pictureRatio(foundpgreq.getPictureRatio()) .build(); pictureCompletedRepository.save(pictureCompleted); - foundpgres.userVerified(); - foundpgreq.userVerified(); + foundpgreq.submittedByAdmin(); return true; } }