Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/docs/asciidoc/posts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++];
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/swyp8team2/post/domain/Post.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Post(Long id, Long userId, String description, Status status, List<PostIm
}

private void validatePostImages(List<PostImage> images) {
if (images.size() < 2) {
if (images.size() < 2 || images.size() > 9) {
throw new BadRequestException(ErrorCode.INVALID_POST_IMAGE_COUNT);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
}
Expand Down