Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6a7b300
refactor: 기존 더미데이터 삽입 repository를 FakeRepository로 rename후 그에 따른 리팩토링
codebidoof Feb 6, 2026
356806f
merge branch develop into feat/diary-v2
codebidoof Feb 6, 2026
2e98be8
resolve conflict
codebidoof Feb 6, 2026
f2878ea
feat: util패키지에 ApiResponseExt 작성
codebidoof Feb 6, 2026
7c58785
feat: request들 작성
codebidoof Feb 6, 2026
14bcf03
feat: response들 작성
codebidoof Feb 6, 2026
cecb355
fix: 갑자기 코드에 전부 빨간색줄이 뜨는 오류 해결
codebidoof Feb 6, 2026
e0d2f55
feat: DiaryApiService 작성
codebidoof Feb 7, 2026
b1b6105
refactor: mapper 신설 및 뷰모델과 Fragment간의 관심사 분리 개선
codebidoof Feb 8, 2026
4822153
refactor: DiariesPagingSource 신설
codebidoof Feb 8, 2026
210ac26
refactor: repository 수정
codebidoof Feb 8, 2026
da29a1b
refactor: 일기 목록 조회 api 연동
codebidoof Feb 8, 2026
fc753a4
refactor: 일기 추가 기능 api 연동
codebidoof Feb 8, 2026
8806140
fix: 일기 작성 창이 항상 오늘 날짜로만 나오는 오류 수정
codebidoof Feb 8, 2026
df54e00
refactor: 일기 상세조회 기능 usecase까지 리팩토링
codebidoof Feb 8, 2026
37efc06
refactor: 일기 상세조회 기능 api 연동
codebidoof Feb 8, 2026
3eeeb52
refactor: UTC와 KST의 차이로 인한 문제 부분해결
codebidoof Feb 8, 2026
6c94718
refactor: 일기 삭제 api 연동
codebidoof Feb 9, 2026
e58dd62
refactor: 뷰모델 수정
codebidoof Feb 9, 2026
7a475fd
refactor: 수정하기 버튼을 누르면 일기쓰기화면으로 이동하는 기능 리팩토링
codebidoof Feb 9, 2026
9b80506
refactor: 수정하기 api 연동을 위한 매퍼 추가
codebidoof Feb 9, 2026
2be7c5a
refactor: 수정하기 유스케이스 리팩토링
codebidoof Feb 9, 2026
e92fb76
refactor: 수정하기 기능 api 연동
codebidoof Feb 9, 2026
e9fe8e5
design: 일기 쓰기횟수 초과 커스텀 토스트 제작
codebidoof Feb 9, 2026
56e50d0
feat: 커스텀 토스트 출력 기능 구현
codebidoof Feb 9, 2026
c5a2498
feat: dailyCount 캐싱로직 구현
codebidoof Feb 9, 2026
77ae988
test: 단위 테스트 기능 추가
codebidoof Feb 9, 2026
ed069f2
fix: 오타 수정
codebidoof Feb 9, 2026
994b01d
Merge branch 'develop' into feat/diary-v2
codebidoof Feb 9, 2026
88d26f3
refactor: 백엔드 타임존 변경에 맞게 KST변환로직 삭제
codebidoof Feb 10, 2026
79e4395
design: 일기목록 ui 일관성 개선
codebidoof Feb 10, 2026
7bab6d1
remove: 쓸데없는 주석 삭제
codebidoof Feb 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,15 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.10.0") // JUnit 4 지원
testImplementation("junit:junit:4.13.2") // JUnit 4
testImplementation("org.assertj:assertj-core:3.27.6")

// 단위 테스트를 위한 의존성
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1")
testImplementation("io.mockk:mockk:1.13.8")
testImplementation("androidx.arch.core:core-testing:2.2.0")

androidTestImplementation(libs.androidx.junit)
androidTestImplementation("org.assertj:assertj-core:3.27.6")
androidTestImplementation(libs.androidx.espresso.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ interface AuthApiService {
@Body request: TokensRequestAgainByGuest
): Response<TokenResponseAgainByGuest>


}
54 changes: 54 additions & 0 deletions app/src/main/java/com/egobook/app/data/api/DiaryApiService.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.egobook.app.data.api

import com.egobook.app.data.model.ApiResponse
import com.egobook.app.data.model.diary.request.DiaryCreateRequest
import com.egobook.app.data.model.diary.request.DiaryUpdateRequest
import com.egobook.app.data.model.diary.response.DiariesResponse
import com.egobook.app.data.model.diary.response.DiaryCreateResponse
import com.egobook.app.data.model.diary.response.DiaryDeleteResponse
import com.egobook.app.data.model.diary.response.DiaryEntryResponse
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface DiaryApiService {

//일기 목록 불러오기
@GET("/diaries")
suspend fun getDiaries(
@Query("date") date: String,
@Query("type") type: String,
@Query("page") page: Int = 1,
@Query("size") size: Int = 10
): ApiResponse<DiariesResponse>

//일기 상세 확인
@GET("/diaries/{diaryId}")
suspend fun getDiary(
@Path("diaryId") diaryId: Long
): ApiResponse<DiaryEntryResponse>

//일기 추가
@POST("/diaries")
suspend fun addDiary(
@Body request: DiaryCreateRequest
): ApiResponse<DiaryCreateResponse>

//일기 삭제
@DELETE("/diaries/{diaryId}")
suspend fun deleteDiary(
@Path("diaryId") diaryId: Long
): ApiResponse<DiaryDeleteResponse>

//일기 수정
@PATCH("/diaries/{diaryId}")
suspend fun updateDiary(
@Path("diaryId") diaryId: Long,
@Body request: DiaryUpdateRequest
): ApiResponse<DiaryEntryResponse>

}
11 changes: 0 additions & 11 deletions app/src/main/java/com/egobook/app/data/local/UUIDProvider.kt

This file was deleted.

24 changes: 23 additions & 1 deletion app/src/main/java/com/egobook/app/data/model/ApiResponse.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
package com.egobook.app.data.model

data class ApiResponse<T>(
import com.egobook.app.data.model.diary.response.EmptyResponse
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class ApiResponse<T>(
@SerialName("code")
val code: String,

@SerialName("message")
val message: String,

@SerialName("status")
val status: Int,

@SerialName("data")
val data: T
)

@Serializable
data class ApiResponseEmpty(
@SerialName("code")
val code: String,

@SerialName("message")
val message: String,

@SerialName("status")
val status: Int,

@SerialName("data")
val data: EmptyResponse = EmptyResponse()
)

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.egobook.app.data.model.diary.request

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class DiaryCreateRequest(
@SerialName("type")
val type: List<String>,
@SerialName("emotionLevel")
val emotionLevel: Int?,
@SerialName("content")
val content: String,
@SerialName("date")
val date: String //LocalDate의 String형식 이어야 함.
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.egobook.app.data.model.diary.request

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class DiaryUpdateRequest (
@SerialName("type")
val type: List<String>,
@SerialName("emotionLevel")
val emotionLevel: Int?,
@SerialName("content")
val content: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.egobook.app.data.model.diary.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class DiariesResponse (
@SerialName("dailyCount")
val dailyCount: Int,

@SerialName("diaries")
val diaries: DiarySlice
)

@Serializable
data class DiarySlice(
@SerialName("content")
val content: List<DiaryEntryResponse>,

@SerialName("page")
val page: Int,

@SerialName("size")
val size: Int,

@SerialName("hasNext")
val hasNext: Boolean
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.egobook.app.data.model.diary.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

//일기 생성
@Serializable
data class DiaryCreateResponse(
@SerialName("entry")
val entry: DiaryEntryResponse,
@SerialName("rewards")
val rewards: List<Reward>
)
@Serializable
data class Reward(
@SerialName("rewardType")
val rewardType: String,
@SerialName("amount")
val amount: Int,
@SerialName("message")
val message: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.egobook.app.data.model.diary.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class DiaryDeleteResponse (
@SerialName("deleted")
val deleted: Boolean
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.egobook.app.data.model.diary.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

//일기 상세 확인, 일기 수정 이 직접 사용, 일기 생성에서 부분 사용
@Serializable
data class DiaryEntryResponse (
@SerialName("diaryId")
val diaryId: Long,

@SerialName("date")
val date: String,

@SerialName("writtenAt")
val writtenAt: String,

@SerialName("type")
val type: List<String>,

@SerialName("emotionLevel")
val emotionLevel: Int?,

@SerialName("content")
val content: String,

@SerialName("createdAt")
val createdAt: String,

@SerialName("updatedAt")
val updatedAt: String

)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.egobook.app.data.model.diary.response

import kotlinx.serialization.Serializable

@Serializable
class EmptyResponse
Loading