-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 콘텐츠 관리 - 콘텐츠 수정, 삭제 기능 구현 #157
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 21 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7b1fc65
refactor: EntityGraph attributePaths 수정
plzslp 920ee39
feat: ContentController 수정 API 엔드포인트 추가
plzslp 172cd16
feat: Content 수정 비지니스 로직 작성
plzslp f8bafbc
feat: Content 수정 필드 검증 실패 예외 추가
plzslp b5da4f3
refactor: Content 설명은 nullable 유지
plzslp 47596ce
refactor: Content 수정 로직에 썸네일 수정 로직 추가
plzslp 18527bb
refactor: 썸네일 수정 시에 기존 썸네일 상태를 PENDING으로 변경하는 로직 추가
plzslp d4b9ca2
feat: ContentController 삭제 API 엔드포인트 추가
plzslp 76f37fb
feat: Content 삭제 비지니스 로직 작성
plzslp 9a940c3
refactor: BinaryContentUploadStatus에 DELETED 상태 추가
plzslp af83fd3
refactor: 최대 태그 개수 제한 비지니스 규칙 추가 및 코드 적용
plzslp 0c99824
refactor: ContentApi ErrorResponse 마이그레이션
plzslp 2e5fc95
test: ContentRepository 테스트 코드 작성
plzslp 3d43379
refactor: ContentNotFoundException details 추가
plzslp daba827
refactor: 파일 업로드 로직 변경사항 ContentController/Service 적용
plzslp 1dc7b66
refactor: User 프로필 업데이트시 기존 프로필 Soft Delete 로직 추가
plzslp 18f55bb
refactor: V10 schema.sql 중복으로 인해 V11로 변경
plzslp b44bd1a
refactor: 사용자 프로필 테스트 findWithProfileImageById() 적용
plzslp 2fafd8c
refactor: ContentException 추상클래스화 및 생성자 추가
plzslp baaee05
test: ContentController 수정, 삭제 API 테스트 코드 작성
plzslp ae254d3
test: ContentService 수정, 삭제 로직 테스트 코드 작성
plzslp 3ff1776
refactor: ContentService 태그 갱신 로직 diff방식으로 변경
plzslp c67621f
refactor: 커서 페이지네이션 조회 메서드 toMany EntityGraph 제거
plzslp 466307d
refactor: 콘텐츠 수정 로직 중 태그 검증, 부분 변경 호출 위치 변경
plzslp 3dc5faf
refactor: 콘텐츠 엔티티 update() StringUtils 적용
plzslp 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,5 +3,6 @@ | |
| public enum BinaryContentUploadStatus { | ||
| PENDING, | ||
| COMPLETED, | ||
| FAILED | ||
| FAILED, | ||
| DELETED | ||
| } | ||
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
21 changes: 21 additions & 0 deletions
21
src/main/java/com/codeit/team5/mopl/content/dto/request/ContentUpdateRequest.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,21 @@ | ||
| package com.codeit.team5.mopl.content.dto.request; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotEmpty; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Size; | ||
| import java.util.List; | ||
|
|
||
| public record ContentUpdateRequest( | ||
| @NotBlank(message = "제목은 필수입니다.") | ||
| @Size(max = 500, message = "제목은 500자를 초과할 수 없습니다.") | ||
| String title, | ||
|
|
||
| String description, | ||
|
|
||
| @NotNull(message = "콘텐츠 태그는 필수입니다.") | ||
| @NotEmpty(message = "콘텐츠 태그 목록은 비어있을 수 없습니다.") | ||
| @Size(max = 10, message = "태그는 최대 10개까지 등록할 수 있습니다.") | ||
| List<@NotBlank(message = "태그는 공백일 수 없습니다.") String> tags | ||
| ) { | ||
| } |
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
7 changes: 6 additions & 1 deletion
7
src/main/java/com/codeit/team5/mopl/content/exception/ContentException.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 |
|---|---|---|
| @@ -1,11 +1,16 @@ | ||
| package com.codeit.team5.mopl.content.exception; | ||
|
|
||
| import com.codeit.team5.mopl.global.exception.BusinessException; | ||
| import java.util.Map; | ||
| import org.springframework.http.HttpStatus; | ||
|
|
||
| public class ContentException extends BusinessException { | ||
| public abstract class ContentException extends BusinessException { | ||
|
|
||
| public ContentException(HttpStatus status, String message) { | ||
| super(status, message); | ||
| } | ||
|
|
||
| public ContentException(HttpStatus status, String message, Map<String, Object> details) { | ||
| super(status, message, details); | ||
| } | ||
| } |
6 changes: 4 additions & 2 deletions
6
src/main/java/com/codeit/team5/mopl/content/exception/ContentNotFoundException.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 |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| package com.codeit.team5.mopl.content.exception; | ||
|
|
||
| import java.util.Map; | ||
| import java.util.UUID; | ||
| import org.springframework.http.HttpStatus; | ||
|
|
||
| public class ContentNotFoundException extends ContentException { | ||
|
|
||
| public ContentNotFoundException() { | ||
| super(HttpStatus.NOT_FOUND, "콘텐츠를 찾을 수 없습니다."); | ||
| public ContentNotFoundException(UUID contentId) { | ||
| super(HttpStatus.NOT_FOUND, "콘텐츠를 찾을 수 없습니다.", Map.of("contentId", contentId)); | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/codeit/team5/mopl/content/exception/InvalidContentTitleException.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,10 @@ | ||
| package com.codeit.team5.mopl.content.exception; | ||
|
|
||
| import org.springframework.http.HttpStatus; | ||
|
|
||
| public class InvalidContentTitleException extends ContentException { | ||
|
|
||
| public InvalidContentTitleException() { | ||
| super(HttpStatus.BAD_REQUEST, "제목은 필수입니다."); | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/codeit/team5/mopl/content/exception/TooManyTagsException.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,10 @@ | ||
| package com.codeit.team5.mopl.content.exception; | ||
|
|
||
| import org.springframework.http.HttpStatus; | ||
|
|
||
| public class TooManyTagsException extends ContentException { | ||
|
|
||
| public TooManyTagsException() { | ||
| super(HttpStatus.BAD_REQUEST, "태그는 최대 10개까지 등록할 수 있습니다."); | ||
| } | ||
| } |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.