This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
리팩토링 및 변경 내역 저장 로직 추가(아직 모든 코드 변경 안함)
- Loading branch information
Showing
121 changed files
with
845 additions
and
728 deletions.
There are no files selected for viewing
This file contains 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
28 changes: 14 additions & 14 deletions
28
...ontent/api/DocumentContentController.java → ...ontent/api/DocumentContentController.java
This file contains 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
10 changes: 5 additions & 5 deletions
10
.../editor/api/DocumentEditorController.java → ..._editor/api/DocumentEditorController.java
This file contains 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: 4 additions & 4 deletions
8
...vision/api/RevisionHistoryController.java → ...vision/api/RevisionHistoryController.java
This file contains 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
14 changes: 7 additions & 7 deletions
14
...awiki/domain/auth/api/AuthController.java → .../domain/user_auth/api/AuthController.java
This file contains 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 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 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 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
23 changes: 23 additions & 0 deletions
23
...awiki-domain/src/main/java/org/daemawiki/domain/article_comment/model/ArticleComment.java
This file contains 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,23 @@ | ||
package org.daemawiki.domain.article_comment.model; | ||
|
||
import org.daemawiki.domain.user.model.Writer; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.Id; | ||
import org.springframework.data.mongodb.core.mapping.Document; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Document | ||
public class ArticleComment { | ||
|
||
@Id | ||
private String id; | ||
|
||
private String content; | ||
|
||
private Writer writer; | ||
|
||
@CreatedDate | ||
private LocalDateTime createdAt; | ||
|
||
} |
101 changes: 101 additions & 0 deletions
101
daemawiki-domain/src/main/java/org/daemawiki/domain/document/adapter/DocumentAdapter.java
This file contains 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,101 @@ | ||
package org.daemawiki.domain.document.adapter; | ||
|
||
import org.daemawiki.domain.document.model.DefaultDocument; | ||
import org.daemawiki.domain.document.model.DocumentSearchResult; | ||
import org.daemawiki.domain.document.port.DeleteDocumentPort; | ||
import org.daemawiki.domain.document.port.FindDocumentPort; | ||
import org.daemawiki.domain.document.port.SaveDocumentPort; | ||
import org.daemawiki.domain.document.repository.DocumentRepository; | ||
import org.daemawiki.utils.PagingInfo; | ||
import org.springframework.stereotype.Component; | ||
import reactor.core.publisher.Flux; | ||
import reactor.core.publisher.Mono; | ||
|
||
@Component | ||
public class DocumentAdapter implements SaveDocumentPort, FindDocumentPort, DeleteDocumentPort { | ||
private final DocumentRepository documentRepository; | ||
|
||
public DocumentAdapter(DocumentRepository documentRepository) { | ||
this.documentRepository = documentRepository; | ||
} | ||
|
||
@Override | ||
public Mono<DefaultDocument> findById(String id) { | ||
return documentRepository.findById(id); | ||
} | ||
|
||
@Override | ||
public Mono<DefaultDocument> findRandom() { | ||
return documentRepository.findRandomDocument(); | ||
} | ||
|
||
@Override | ||
public Flux<DocumentSearchResult> search(String text, PagingInfo pagingInfo) { | ||
return documentRepository.findByTextContaining( | ||
text, | ||
pagingInfo.sortBy(), | ||
pagingInfo.sortDirection(), | ||
pagingInfo.page() * pagingInfo.size(), | ||
pagingInfo.size() | ||
); | ||
} | ||
|
||
@Override | ||
public Flux<DefaultDocument> searchByTitle(String text, PagingInfo pagingInfo) { | ||
return documentRepository.findByTitleContaining( | ||
text, | ||
pagingInfo.sortBy(), | ||
pagingInfo.sortDirection(), | ||
pagingInfo.page() * pagingInfo.size(), | ||
pagingInfo.size()); | ||
} | ||
|
||
@Override | ||
public Flux<DocumentSearchResult> searchByContent(String text, PagingInfo pagingInfo) { | ||
return documentRepository.findByContentTextContaining( | ||
text, | ||
pagingInfo.sortBy(), | ||
pagingInfo.sortDirection(), | ||
pagingInfo.page() * pagingInfo.size(), | ||
pagingInfo.size() | ||
); | ||
} | ||
|
||
public Flux<DefaultDocument> findAllSortByMostRevision(PagingInfo pagingInfo) { | ||
return documentRepository.findAllByOrderByVersion( | ||
pagingInfo.sortDirection(), | ||
pagingInfo.page() * pagingInfo.size(), | ||
pagingInfo.size() | ||
); | ||
} | ||
|
||
@Override | ||
public Flux<DefaultDocument> findAllSortByView(PagingInfo pagingInfo) { | ||
return documentRepository.findAllByOrderByView( | ||
pagingInfo.sortDirection(), | ||
pagingInfo.page() * pagingInfo.size(), | ||
pagingInfo.size() | ||
); | ||
} | ||
|
||
@Override | ||
public Mono<DefaultDocument> save(DefaultDocument document) { | ||
return documentRepository.save(document); | ||
} | ||
|
||
@Override | ||
public Mono<DefaultDocument> increaseView(DefaultDocument document) { | ||
return documentRepository.increaseView(document); | ||
} | ||
|
||
@Override | ||
public Mono<Void> deleteById(String id) { | ||
return documentRepository.deleteById(id); | ||
} | ||
|
||
@Override | ||
public Mono<Void> delete(DefaultDocument document) { | ||
return documentRepository.delete(document); | ||
} | ||
|
||
} |
18 changes: 0 additions & 18 deletions
18
...wiki-domain/src/main/java/org/daemawiki/domain/document/application/FindDocumentPort.java
This file was deleted.
Oops, something went wrong.
This file contains 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
6 changes: 3 additions & 3 deletions
6
...-domain/src/main/java/org/daemawiki/domain/document/dto/response/GetDocumentResponse.java
This file contains 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 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 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.