diff --git a/src/docs/asciidoc/posts.adoc b/src/docs/asciidoc/posts.adoc index 54301e7e..7087793d 100644 --- a/src/docs/asciidoc/posts.adoc +++ b/src/docs/asciidoc/posts.adoc @@ -24,13 +24,13 @@ operation::post-controller-test/find-post_share-url[snippets='http-request,curl- operation::post-controller-test/find-vote-status[snippets='http-request,curl-request,request-headers,path-parameters,http-response,response-fields'] -[[내가-작성한-게시글-조회]] -=== `GET` 내가 작성한 게시글 조회 +[[유저가-작성한-게시글-조회]] +=== `GET` 유저가 작성한 게시글 조회 operation::post-controller-test/find-my-post[snippets='http-request,curl-request,query-parameters,request-headers,http-response,response-fields'] -[[내가-참여한-게시글-조회]] -=== `GET` 내가 참여한 게시글 조회 +[[유저가-참여한-게시글-조회]] +=== `GET` 유저가 참여한 게시글 조회 operation::post-controller-test/find-voted-post[snippets='http-request,curl-request,query-parameters,request-headers,http-response,response-fields'] diff --git a/src/main/java/com/swyp8team2/common/dev/DataInitializer.java b/src/main/java/com/swyp8team2/common/dev/DataInitializer.java index a99ff0f1..2328c4ef 100644 --- a/src/main/java/com/swyp8team2/common/dev/DataInitializer.java +++ b/src/main/java/com/swyp8team2/common/dev/DataInitializer.java @@ -83,7 +83,7 @@ public void init() { for (int j = 0; j < 30; j += 2) { ImageFile imageFile1 = imageFileRepository.save(ImageFile.create(new ImageFileDto("202502240006030.png", "https://image.photopic.site/images-dev/202502240006030.png", "https://image.photopic.site/images-dev/resized_202502240006030.png"))); ImageFile imageFile2 = imageFileRepository.save(ImageFile.create(new ImageFileDto("202502240006030.png", "https://image.photopic.site/images-dev/202502240006030.png", "https://image.photopic.site/images-dev/resized_202502240006030.png"))); - Post post = postRepository.save(Post.create(user.getId(), "description" + j, List.of(PostImage.create("뽀또 A", imageFile1.getId()), PostImage.create("뽀또 B", imageFile2.getId())))); + Post post = postRepository.save(Post.create(user.getId(), "description" + j, List.of(PostImage.create("뽀또A", imageFile1.getId()), PostImage.create("뽀또B", imageFile2.getId())))); post.setShareUrl(shaereUrlCryptoService.encrypt(String.valueOf(post.getId()))); posts.add(post); } diff --git a/src/main/java/com/swyp8team2/post/application/PostImageNameGenerator.java b/src/main/java/com/swyp8team2/post/application/PostImageNameGenerator.java index b764e035..ab1edd99 100644 --- a/src/main/java/com/swyp8team2/post/application/PostImageNameGenerator.java +++ b/src/main/java/com/swyp8team2/post/application/PostImageNameGenerator.java @@ -16,6 +16,6 @@ public String generate() { if (index >= alphabets.length) { throw new InternalServerException(ErrorCode.POST_IMAGE_NAME_GENERATOR_INDEX_OUT_OF_BOUND); } - return "뽀또 " + alphabets[index++]; + return "뽀또" + alphabets[index++]; } } diff --git a/src/main/java/com/swyp8team2/post/domain/Post.java b/src/main/java/com/swyp8team2/post/domain/Post.java index 6105b2b9..79ff5700 100644 --- a/src/main/java/com/swyp8team2/post/domain/Post.java +++ b/src/main/java/com/swyp8team2/post/domain/Post.java @@ -57,7 +57,7 @@ public Post(Long id, Long userId, String description, Status status, List images) { - if (images.size() < 2) { + if (images.size() < 2 || images.size() > 9) { throw new BadRequestException(ErrorCode.INVALID_POST_IMAGE_COUNT); } } diff --git a/src/test/java/com/swyp8team2/post/application/PostImageNameGeneratorTest.java b/src/test/java/com/swyp8team2/post/application/PostImageNameGeneratorTest.java index 8f763b94..626bb21f 100644 --- a/src/test/java/com/swyp8team2/post/application/PostImageNameGeneratorTest.java +++ b/src/test/java/com/swyp8team2/post/application/PostImageNameGeneratorTest.java @@ -26,7 +26,7 @@ void generate() throws Exception { String generate2 = postImageNameGenerator.generate(); //then - assertThat(generate1).isEqualTo("뽀또 A"); - assertThat(generate2).isEqualTo("뽀또 B"); + assertThat(generate1).isEqualTo("뽀또A"); + assertThat(generate2).isEqualTo("뽀또B"); } } diff --git a/src/test/java/com/swyp8team2/post/application/PostServiceTest.java b/src/test/java/com/swyp8team2/post/application/PostServiceTest.java index af97d0a1..b85b73ee 100644 --- a/src/test/java/com/swyp8team2/post/application/PostServiceTest.java +++ b/src/test/java/com/swyp8team2/post/application/PostServiceTest.java @@ -87,10 +87,10 @@ void create() throws Exception { () -> assertThat(post.getShareUrl()).isEqualTo(shareUrl), () -> assertThat(images).hasSize(2), () -> assertThat(images.get(0).getImageFileId()).isEqualTo(1L), - () -> assertThat(images.get(0).getName()).isEqualTo("뽀또 A"), + () -> assertThat(images.get(0).getName()).isEqualTo("뽀또A"), () -> assertThat(images.get(0).getVoteCount()).isEqualTo(0), () -> assertThat(images.get(1).getImageFileId()).isEqualTo(2L), - () -> assertThat(images.get(1).getName()).isEqualTo("뽀또 B"), + () -> assertThat(images.get(1).getName()).isEqualTo("뽀또B"), () -> assertThat(images.get(1).getVoteCount()).isEqualTo(0) ); }