-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#265] 임시저장 API연결을 진행합니다. #271
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
28 commits
Select commit
Hold shift + click to select a range
3b05efd
[ADD/#265] Kotest 의존성 추가 및 단위 테스트를 위한 JUnit 플랫폼 설정
MoonsuKang 8309c17
[ADD/#265] DraftDiaryContents 및 CreatedDraftDiaryInfo 데이터 클래스 추가
MoonsuKang ba09f76
[ADD/#265] 임시저장을 위한 Response/Request DTO 추가
MoonsuKang bf282eb
[FEAT/#265] 임시저장 Diary API 메서드 추가
MoonsuKang ffdab1b
[FEAT/#265] 임시저장 Diary 관련 API 메서드 추가(dataSource)
MoonsuKang 54ab943
[FEAT/#265] 임시저장을 위한 다이어리 API 메서드 추가(Repository)
MoonsuKang 761fa55
[FEAT/#265] 임시저장 기능을 위한 UseCase 추가
MoonsuKang 9e9a87c
[FEAT/#265] ViewModel에 임시 일기 fetch/save 로직 추가 및 상태 처리 구현
MoonsuKang c80e418
[ADD/#265] Lifecycle STARTED 기준 LaunchedEffect 유틸 함수 추가
MoonsuKang d822f93
[ADD/#265] route단에 임시저장 fetch 추가 및 뒤로가기 분기 추가
MoonsuKang 6a1ebec
[TEST/#265] FakeDiaryRepository 추가
MoonsuKang 64ff044
[TEST/#265] FakeDiaryRemoteDataSource 클래스 추가 및 임시저장 기능 구현
MoonsuKang 62c351c
[TEST/#265] 임시저장 다이어리 조회 및 저장 기능에 대한 테스트 추가
MoonsuKang d674b06
[TEST/#265] WriteDiaryViewModel 단위 테스트 구현 (임시저장 한정)
MoonsuKang 29d1f2d
[REFACTOR/#265] onDismiss, onDismissExitDialog 분리 및 BackHandler 처리
MoonsuKang 1863b26
[REFACTOR/#265] "보내기" 클릭 시 에러메시지가 나타나지 않는 문제 해결
MoonsuKang 2e10906
[ADD/#265] 임시저장 Fetch실패 시 에러메시지 처리 추가
MoonsuKang 808001c
[MOD/#265] 프린트문 제거
MoonsuKang 794e940
[REFACTOR/#265] API 명세 변경에 따른 비즈니스 로직 수정
MoonsuKang b6c76f4
[REFACTOR/#265] 임시저장 처리 개선 및 기본 항목 보장 추가
MoonsuKang ca66f7a
[REFACTOR/#265] 임시저장 처리 개선 및 기본 항목 보장 추가
MoonsuKang 84ccb64
[REFACTOR/#265] 임시저장 API 응답 타입 변경(->Unit) 및 관련 코드 수정
MoonsuKang 05b2f97
[REFACTOR/#265] 임시저장 API 응답 타입 변경(->Unit) 및 관련 코드 수정
MoonsuKang a606664
[REFACTOR/#265] Repository의 임시저장 일기 조회 실패 메시지 처리 책임을 ViewModel로 이동
MoonsuKang 58c726d
[ADD/#265] trailing comma
MoonsuKang 14fc909
Merge branch 'develop' into feat/#265-draft-save-api
MoonsuKang 9fda999
[ADD/#265] close blacket 추가
MoonsuKang bd24e15
[ADD/#265] import 순서 변경
MoonsuKang 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
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: 10 additions & 0 deletions
10
app/src/main/java/com/sopt/clody/data/remote/dto/request/SaveDraftDiaryRequestDto.kt
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.sopt.clody.data.remote.dto.request | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class SaveDraftDiaryRequestDto( | ||
| @SerialName("date") val date: String, | ||
| @SerialName("draftDiaries") val draftDiaries: List<String>, | ||
| ) |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/sopt/clody/data/remote/dto/response/DraftDiariesResponseDto.kt
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.sopt.clody.data.remote.dto.response | ||
|
|
||
| import com.sopt.clody.domain.model.DraftDiaryContents | ||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class DraftDiariesResponseDto( | ||
| @SerialName("draftDiaries") val draftDiaries: List<String>, | ||
| ) { | ||
| fun toDomain() = DraftDiaryContents( | ||
| draftDiaries = draftDiaries ?: emptyList(), | ||
| ) | ||
| } | ||
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
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/sopt/clody/domain/model/DraftDiaryContents.kt
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.sopt.clody.domain.model | ||
|
|
||
| data class DraftDiaryContents( | ||
| val draftDiaries: List<String>, | ||
| ) |
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
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/sopt/clody/domain/usecase/FetchDraftDiaryUseCase.kt
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,13 @@ | ||
| package com.sopt.clody.domain.usecase | ||
|
|
||
| import com.sopt.clody.domain.model.DraftDiaryContents | ||
| import com.sopt.clody.domain.repository.DiaryRepository | ||
| import javax.inject.Inject | ||
|
|
||
| class FetchDraftDiaryUseCase @Inject constructor( | ||
| private val repository: DiaryRepository, | ||
| ) { | ||
| suspend operator fun invoke(year: Int, month: Int, day: Int): Result<DraftDiaryContents> { | ||
| return repository.fetchDraftDiary(year, month, day) | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/sopt/clody/domain/usecase/SaveDraftDiaryUseCase.kt
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,12 @@ | ||
| package com.sopt.clody.domain.usecase | ||
|
|
||
| import com.sopt.clody.domain.repository.DiaryRepository | ||
| import javax.inject.Inject | ||
|
|
||
| class SaveDraftDiaryUseCase @Inject constructor( | ||
| private val diaryRepository: DiaryRepository, | ||
| ) { | ||
| suspend operator fun invoke(date: String, contents: List<String>): Result<Unit> { | ||
| return diaryRepository.saveDraftDiary(date, contents) | ||
| } | ||
| } |
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.
Fix inconsistency between property nullability and null check.
There's a logical inconsistency:
draftDiariesis declared as non-nullList<String>on line 9, but line 12 performs a null checkdraftDiaries ?: emptyList(). This null check is unnecessary since the property cannot be null.Option 1: If the API can return null, make the property nullable:
Option 2: If the API always returns a list, remove the null check:
Please verify the API contract to determine which approach is correct.
📝 Committable suggestion
🤖 Prompt for AI Agents