-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 피드 수정 api 개발 및 피드 생성 리펙토링 #91
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
Show all changes
31 commits
Select commit
Hold shift + click to select a range
08aadd6
[feat] 관련 에러 코드 추가 (#86)
hd0rable 1d596e3
[feat] feed 도메인 규칙 책임 추가(#86)
hd0rable 24dced5
[feat] FeedCommandController.updateFeed (#86)
hd0rable 6435b25
[feat] 피드 수정시 영속성 커맨드 어댑터 작성 (#86)
hd0rable 315c2b0
[feat] FeedCommandPort.update (#86)
hd0rable 40656b7
[refactor] 피드 생성/수정시 카테고리 검증 안하도록 수정 및 s3 삭제관련 todo 추가 (#86)
hd0rable e8df46c
[refactor] 피드 생성/수정 response dto 통일 (#86)
hd0rable 9540bf9
[refactor] 피드 생성/수정 response dto 통일 (#86)
hd0rable 26c43ed
[refactor] 피드 생성/수정시 카테고리 검증 안하도록 수정 및 s3 삭제관련 todo 추가 (#86)
hd0rable b09b505
[feat] jpa 엔티티 한번에 업데이트하는 updateFrom 추가 (#86)
hd0rable 310cb9f
[fix] feed<->content 양방향 매핑관계 설정후, 피드도메인 엔티티 변환시 누락되었던 content 매핑관계 추…
hd0rable 7abfbdf
[test] 피드 생성 테스트코드 수정 (#86)
hd0rable 2e5b31e
[test] 피드 수정 통합 테스트코드 (#86)
hd0rable 7cc67d1
[test] 피드 수정 컨트롤러 단위 테스트코드 작성 (#86)
hd0rable e84d924
[test] 테스트팩토리에 피드/피드태그/콘텐츠포함피드 생성 코드 추가(#86)
hd0rable 88211fd
[feat] TagJpaRepository.findAllByFeedId (#86)
hd0rable 4121382
[feat] FeedTagJpaRepository.deleteAllByFeedJpaEntity (#86)
hd0rable cbb46c8
[feat] 피드 수정 커맨드 작성 (#86)
hd0rable 0431eb7
[feat] 피드 수정 request dto (#86)
hd0rable 5af7c9c
[feat] 피드 수정 유즈케이스 구현체 서비스 작성 (#86)
hd0rable b4f35f1
[feat] 피드 수정 유즈케이스 작성 (#86)
hd0rable b4464d6
[refactor] 피드 수정시 엔티티가 부모 필드 값 수정가능하도록 제어자 protected로 수정 (#86)
hd0rable c8e4b61
[refactor] 카테고리 검증 로직 사라지면서 안쓰는 함수 삭제 (#86)
hd0rable 2d96332
Merge remote-tracking branch 'origin/develop' into feat/#86-feed-update
hd0rable 7311c58
[refactor] 충돌 해결 (#86)
hd0rable ce71420
[test] 테스트 이름 수정 (#86)
hd0rable fc79d91
[test] 테스트 이름 수정 (#86)
hd0rable 17f4408
[test] 테스트 이름 수정 (#86)
hd0rable bd8adf8
[refactor] final 추가 (#86)
hd0rable 89e73f7
[refactor] 도메인 내부에서 피드 생성/수정 로직 리펙 추가 (#92)
hd0rable f660133
[refactor] 메서드명 수정 (#86)
hd0rable 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
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
27 changes: 27 additions & 0 deletions
27
src/main/java/konkuk/thip/feed/adapter/in/web/request/FeedUpdateRequest.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,27 @@ | ||
| package konkuk.thip.feed.adapter.in.web.request; | ||
|
|
||
| import konkuk.thip.feed.application.port.in.dto.FeedUpdateCommand; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record FeedUpdateRequest( | ||
|
|
||
| String contentBody, | ||
|
|
||
| Boolean isPublic, | ||
|
|
||
| List<String> tagList, | ||
|
|
||
| List<String> remainImageUrls | ||
| ) { | ||
| public FeedUpdateCommand toCommand(Long userId, Long feedId) { | ||
| return new FeedUpdateCommand( | ||
| contentBody, | ||
| isPublic, | ||
| tagList, | ||
| remainImageUrls, | ||
| userId, | ||
| feedId | ||
| ); | ||
| } | ||
| } | ||
7 changes: 0 additions & 7 deletions
7
src/main/java/konkuk/thip/feed/adapter/in/web/response/FeedCreateResponse.java
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
src/main/java/konkuk/thip/feed/adapter/in/web/response/FeedIdResponse.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,7 @@ | ||
| package konkuk.thip.feed.adapter.in.web.response; | ||
|
|
||
| public record FeedIdResponse(Long feedId) { | ||
| public static FeedIdResponse of(Long feedId) { | ||
| return new FeedIdResponse(feedId); | ||
| } | ||
| } |
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
9 changes: 9 additions & 0 deletions
9
...ava/konkuk/thip/feed/adapter/out/persistence/repository/FeedTag/FeedTagJpaRepository.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,7 +1,16 @@ | ||
| package konkuk.thip.feed.adapter.out.persistence.repository.FeedTag; | ||
|
|
||
| import konkuk.thip.feed.adapter.out.jpa.FeedJpaEntity; | ||
| import konkuk.thip.feed.adapter.out.jpa.FeedTagJpaEntity; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.data.jpa.repository.Modifying; | ||
| import org.springframework.data.jpa.repository.Query; | ||
| import org.springframework.data.repository.query.Param; | ||
|
|
||
| public interface FeedTagJpaRepository extends JpaRepository<FeedTagJpaEntity, Long>{ | ||
|
|
||
| @Modifying | ||
| @Query("DELETE FROM FeedTagJpaEntity ft WHERE ft.feedJpaEntity = :feedJpaEntity") | ||
| void deleteAllByFeedJpaEntity(@Param("feedJpaEntity") FeedJpaEntity feedJpaEntity); | ||
|
|
||
| } |
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: 7 additions & 0 deletions
7
src/main/java/konkuk/thip/feed/application/port/in/FeedUpdateUseCase.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,7 @@ | ||
| package konkuk.thip.feed.application.port.in; | ||
|
|
||
| import konkuk.thip.feed.application.port.in.dto.FeedUpdateCommand; | ||
|
|
||
| public interface FeedUpdateUseCase { | ||
| Long updateFeed(FeedUpdateCommand command); | ||
| } |
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
20 changes: 20 additions & 0 deletions
20
src/main/java/konkuk/thip/feed/application/port/in/dto/FeedUpdateCommand.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,20 @@ | ||
| package konkuk.thip.feed.application.port.in.dto; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record FeedUpdateCommand( | ||
|
|
||
| String contentBody, | ||
|
|
||
| Boolean isPublic, | ||
|
|
||
| List<String> tagList, | ||
|
|
||
| List<String> remainImageUrls, | ||
|
|
||
| Long userId, | ||
|
|
||
| Long feedId | ||
| ) | ||
| { | ||
| } |
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 |
|---|---|---|
|
|
@@ -5,4 +5,6 @@ | |
|
|
||
| public interface FeedCommandPort { | ||
| Long save(Feed feed); | ||
| Long update(Feed feed); | ||
| Feed findById(Long id); | ||
| } | ||
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.