-
Notifications
You must be signed in to change notification settings - Fork 1
[FEAT] 노트 조회, 상세 조회, 삭제 기능 추가 #165
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
54 commits
Select commit
Hold shift + click to select a range
7038007
[FEAT] 노트 불러오기 컨트롤러 구현
paragon0107 1aa2e17
[FEAT] 노트 불러오기 DTO 추가
paragon0107 211629e
[FEAT] 노트 불러오기 성공 메세지 추가
paragon0107 fab33fb
[FEAT] NoteService 노트 불러오기 메서드 추가
paragon0107 c44ac9e
[FEAT] pull 반영
paragon0107 63e9e1d
[CHORE] ContentEncoder 생성, 기존 메서드를 분리
paragon0107 3fd6487
[CHORE] NoteController 삭제, 조회부분 구현
paragon0107 05c8278
[CHORE] 노트 삭제 서비스레이어 DTO 구현
paragon0107 b0cb30c
[CHORE] 노트 관련 매니저 Deleter 구현
paragon0107 d35de2c
[FEAT] 노트 Deleter 구현
paragon0107 d7a795e
[CHORE] 노트 엔티티 작성자 필드 추가
paragon0107 383cabf
[CHORE] 잘못 만든 Repository 삭제
paragon0107 1327b08
[CHORE] Document, TimeBlock 어댑터 수정
paragon0107 ec4859c
[CHORE] 노트 관련 Manager Repository 구현
paragon0107 558ea7d
[FEAT] NoteService 삭제, 조회 메서드 구현
paragon0107 474bffa
[FEAT] NoteFinder 구현
paragon0107 d690324
[FEAT] Note 관련 Manager 어댑터 구현
paragon0107 f8ab31b
[FEAT] 노트 조회 DTO 구현
paragon0107 ed196ec
[FEAT] 노트 조회 과련 다른 도메인 DTO 구현
paragon0107 1cfb2db
[FEAT] TimeBlockFinder 메서드 수정 반영
paragon0107 dd6bec4
[FEAT] 노트 조회 성공 메세지 추가
paragon0107 04748be
Merge branch 'develop' of https://github.com/Team-Tiki/TIKI_SERVER in…
paragon0107 2a78c8c
[FEAT] 자유형식 노트 조회 메서드 구현
paragon0107 5c3eb37
[CHORE] 오용된 VO제거
paragon0107 c274a59
[CHORE] 오용된 VO제거
paragon0107 db625f8
[FEAT] ContentDecoder 추가
paragon0107 dc4cacf
[FEAT] 메서드 네이밍 수정
paragon0107 d054a70
[FEAT] 디테일 뷰 자유형식 DTO 구현
paragon0107 1409095
[CHORE] 쓸모없는 import문 제거
paragon0107 1e1bc29
[CHORE] 노트 디테일 반환타입 변경
paragon0107 8274c2c
[CHORE] 누락된 final 추가
paragon0107 156691e
[FEAT] 디테일 뷰 반환 DTO 추가
paragon0107 de0e335
[FEAT] 디테일 뷰 반환 DTO 분리
paragon0107 d35dc5c
[CHORE] 디테일 뷰 반환 DTO 분리
paragon0107 bb1e8a2
[FEAT] ContentDecoder 추가
paragon0107 d9c260d
[FEAT] 노트 조회, 페이지네이션을 위한 인자값 추가
paragon0107 f7f266d
[CHORE] INIT_NUM 상수 경로 변경
paragon0107 e9da487
[FEAT] 노트 조회 메서드 페이지네이션 적용
paragon0107 d7352ab
[FEAT] 정렬 기준 엔티티 추가
paragon0107 4477aef
[FEAT] NoteRepository 페이지네이션 메서드 추가
paragon0107 e343bad
[FEAT] NoteFinder 페이지네이션 메서드 추가
paragon0107 6e71c28
[CHORE] 노트 조회 반환타입 수정
paragon0107 acd4afe
[CHORE] 페이지네이션 크기 상수 추가
paragon0107 50ceb05
[CHORE] 컨벤션 적용
paragon0107 62303eb
[CHORE] 컨벤션 적용
paragon0107 2a6c161
[CHORE] DTO 네이밍 컨벤션 적용
paragon0107 b50bd38
[CHORE] 삭제 성공 메세지 삭제
paragon0107 d3119ef
[CHORE] DTO 네이밍 컨벤션 제거
paragon0107 0b1c614
[CHORE] 쓸모없는 DTO 삭제
paragon0107 ab6fffc
[CHORE] DTO 네이밍 변경
paragon0107 a56535a
[CHORE] NoteDetailReponseDTO에 노트 ID 추가
paragon0107 948d304
[CHORE] 로직 단순화
paragon0107 c05fc15
[CHORE] 컨벤션 적용
paragon0107 6d93b66
[CHORE] DTO 네이밍 수정
paragon0107 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.tiki.server.common.entity; | ||
|
|
||
| public enum SortOrder { | ||
| ASC, DESC | ||
| } |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/tiki/server/common/util/ContentDecoder.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.tiki.server.common.util; | ||
|
|
||
| import java.util.Base64; | ||
| import java.util.List; | ||
|
|
||
| public class ContentDecoder { | ||
|
|
||
| public static List<String> decodeNoteTemplate(final String encodedData) { | ||
| String[] parts = encodedData.split("\\|"); | ||
| String decodedActivity = new String(Base64.getDecoder().decode(parts[0])); | ||
| String decodedPrepare = new String(Base64.getDecoder().decode(parts[1])); | ||
| String decodedDisappointing = new String(Base64.getDecoder().decode(parts[2])); | ||
| String decodedComplement = new String(Base64.getDecoder().decode(parts[3])); | ||
| return List.of(decodedActivity, decodedPrepare, decodedDisappointing, decodedComplement); | ||
| } | ||
|
|
||
| public static String decodeNoteFree(final String encodeDate) { | ||
| byte[] decodedBytes = Base64.getDecoder().decode(encodeDate); | ||
| return new String(decodedBytes); | ||
| } | ||
| } |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/tiki/server/common/util/ContentEncoder.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,19 @@ | ||
| package com.tiki.server.common.util; | ||
|
|
||
| import java.util.Base64; | ||
|
|
||
| public class ContentEncoder { | ||
|
|
||
| public static String encodeNoteTemplate(final String activity, final String prepare, final String disappointing, final String complement) { | ||
| String encodedActivity = Base64.getEncoder().encodeToString(activity.getBytes()); | ||
| String encodedPrepare = Base64.getEncoder().encodeToString(prepare.getBytes()); | ||
| String encodedDisappointing = Base64.getEncoder().encodeToString(disappointing.getBytes()); | ||
| String encodedComplement = Base64.getEncoder().encodeToString(complement.getBytes()); | ||
|
|
||
| return String.join("|", encodedActivity, encodedPrepare, encodedDisappointing, encodedComplement); | ||
| } | ||
|
|
||
| public static String encodeNoteFree(final String contents) { | ||
| return Base64.getEncoder().encodeToString(contents.getBytes()); | ||
| } | ||
| } |
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
19 changes: 19 additions & 0 deletions
19
...ain/java/com/tiki/server/document/service/dto/response/DocumentTagGetServiceResponse.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,19 @@ | ||
| package com.tiki.server.document.service.dto.response; | ||
|
|
||
| import com.tiki.server.document.entity.Document; | ||
|
|
||
| public record DocumentTagGetServiceResponse( | ||
| long id, | ||
| String fileName, | ||
| String fileUrl, | ||
| double capacity | ||
| ) { | ||
|
|
||
| public static DocumentTagGetServiceResponse from(final Document document) { | ||
| return new DocumentTagGetServiceResponse( | ||
| document.getId(), | ||
| document.getFileName(), | ||
| document.getFileUrl(), | ||
| document.getCapacity()); | ||
| } | ||
| } |
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/tiki/server/note/adapter/NoteDeleter.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.tiki.server.note.adapter; | ||
|
|
||
| import com.tiki.server.common.support.RepositoryAdapter; | ||
| import com.tiki.server.note.repository.NoteRepository; | ||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @RepositoryAdapter | ||
| @RequiredArgsConstructor | ||
| public class NoteDeleter { | ||
|
|
||
| private final NoteRepository noteRepository; | ||
|
|
||
| public void deleteNoteByIds(final List<Long> noteIds){ | ||
| noteIds.forEach(noteRepository::deleteById); | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/tiki/server/note/adapter/NoteFinder.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,33 @@ | ||
| package com.tiki.server.note.adapter; | ||
|
|
||
| import com.tiki.server.common.support.RepositoryAdapter; | ||
| import com.tiki.server.note.entity.Note; | ||
| import com.tiki.server.note.exception.NoteException; | ||
| import com.tiki.server.note.repository.NoteRepository; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.data.domain.PageRequest; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.List; | ||
|
|
||
| import static com.tiki.server.note.message.ErrorCode.INVALID_NOTE; | ||
|
|
||
| @RepositoryAdapter | ||
| @RequiredArgsConstructor | ||
| public class NoteFinder { | ||
|
|
||
| private final NoteRepository noteRepository; | ||
|
|
||
| public List<Note> findByModifiedAtBeforeOrderByModifiedAtDesc(final LocalDateTime lastUpdatedAt, final PageRequest pageRequest) { | ||
| return noteRepository.findByModifiedAtBeforeOrderByModifiedAtDesc(lastUpdatedAt, pageRequest); | ||
| } | ||
|
|
||
| public List<Note> findByModifiedAtAfterOrderByModifiedAtAsc(final LocalDateTime lastUpdatedAt, final PageRequest pageRequest) { | ||
| return noteRepository.findByModifiedAtAfterOrderByModifiedAtAsc(lastUpdatedAt, pageRequest); | ||
| } | ||
|
|
||
| public Note findById(final long noteId) { | ||
| return noteRepository.findById(noteId) | ||
| .orElseThrow(() -> new NoteException(INVALID_NOTE)); | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/tiki/server/note/constants/NoteConstants.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,6 @@ | ||
| package com.tiki.server.note.constants; | ||
|
|
||
| public class NoteConstants { | ||
|
|
||
| public static final int PAGE_SIZE = 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
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
10 changes: 9 additions & 1 deletion
10
src/main/java/com/tiki/server/note/repository/NoteRepository.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,19 @@ | ||
| package com.tiki.server.note.repository; | ||
|
|
||
| import com.tiki.server.note.entity.Note; | ||
| import io.lettuce.core.dynamic.annotation.Param; | ||
| import org.springframework.data.domain.Pageable; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.data.jpa.repository.Query; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.List; | ||
|
|
||
| public interface NoteRepository extends JpaRepository<Note, Long> { | ||
|
|
||
| List<Note> findAllByTeamId(final long teamId); | ||
| @Query("SELECT n FROM Note n WHERE n.updatedAt < :lastModifiedAt ORDER BY n.updatedAt DESC") | ||
| List<Note> findByModifiedAtBeforeOrderByModifiedAtDesc(@Param("lastModifiedAt") LocalDateTime lastModifiedAt, Pageable pageable); | ||
|
|
||
| @Query("SELECT n FROM Note n WHERE n.updatedAt > :lastModifiedAt ORDER BY n.updatedAt ASC") | ||
| List<Note> findByModifiedAtAfterOrderByModifiedAtAsc(@Param("lastModifiedAt") LocalDateTime lastModifiedAt, Pageable pageable); | ||
| } |
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.