-
Notifications
You must be signed in to change notification settings - Fork 1
[Feat]#111 커뮤니티 댓글 isMine 응답 및 게시글 수정 API 추가 #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/com/redo/domain/community/dto/req/CommunityUpdateRequestDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package com.redo.domain.community.dto.req; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import org.springframework.web.multipart.MultipartFile; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| // 첨부 이미지는 부분 수정한다. deleteImageIds 로 지정한 기존 이미지만 삭제하고, images 로 받은 이미지를 새로 추가한다. | ||
| // (둘 다 보내지 않으면 기존 이미지는 그대로 유지된다.) | ||
| public record CommunityUpdateRequestDTO( | ||
| @NotNull Integer category, | ||
| @NotBlank String title, | ||
| @NotBlank String content, | ||
| List<Long> deleteImageIds, | ||
| List<MultipartFile> images | ||
| ) { | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/com/redo/domain/community/dto/res/CommunityImageResponseDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.redo.domain.community.dto.res; | ||
|
|
||
| // 수정 시 삭제할 이미지를 지정할 수 있도록 조회용 Presigned URL 과 이미지 id 를 함께 내려준다. | ||
| public record CommunityImageResponseDTO( | ||
| Long imageId, | ||
| String imageUrl | ||
| ) { | ||
| } |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/redo/domain/community/dto/res/CommunityUpdateResponseDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package com.redo.domain.community.dto.res; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.List; | ||
|
|
||
| public record CommunityUpdateResponseDTO( | ||
| Long id, | ||
| String title, | ||
| String content, | ||
| String category, | ||
| List<CommunityImageResponseDTO> images, | ||
| LocalDateTime updatedAt | ||
| ) { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: REDO-Team/Back
Length of output: 19062
🏁 Script executed:
Repository: REDO-Team/Back
Length of output: 50370
수정 API에서
title길이를 영속화 전에 제한하십시오.Community.title은length = 100으로 제한되지만,CommunityUpdateRequestDTO.title은 공백만 검증합니다. 101자 제목 요청은editImages()의 S3 업로드/삭제 작업 이후 flush에서 실패할 수 있습니다. DTO에@Size(max = 100)을 적용하고,editImages()전CommunityService.validatePostRequest()에도 같은 길이 검증을 추가하십시오.수정 예시
🤖 Prompt for AI Agents