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; } } 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);