-
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.
Browse files
Browse the repository at this point in the history
…cture [Feature] firebase firestore 구조를 변경하고 캘린더 StudyDay를 불러와 반영합니다.
- Loading branch information
Showing
9 changed files
with
175 additions
and
66 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
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
20 changes: 0 additions & 20 deletions
20
main-domain/src/main/java/com/teamhy2/main/domain/model/StudyDay.kt
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
main-domain/src/main/java/com/teamhy2/main/domain/model/StudyDayResponse.kt
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,8 @@ | ||
package com.teamhy2.main.domain.model | ||
|
||
import java.time.LocalDate | ||
|
||
data class StudyDayResponse( | ||
val date: LocalDate, | ||
val studyStartTimes: List<String>, | ||
) |
4 changes: 4 additions & 0 deletions
4
main-domain/src/main/java/com/teamhy2/main/domain/repository/StudyDayRepository.kt
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
package com.teamhy2.main.domain.repository | ||
|
||
import com.teamhy2.main.domain.model.StudyDayResponse | ||
|
||
interface StudyDayRepository { | ||
suspend fun addStudyDay( | ||
uid: String, | ||
startTime: String, | ||
) | ||
|
||
suspend fun getStudyDays(uid: String): Map<String, List<StudyDayResponse>> | ||
} |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
plugins { | ||
id("hongikyeolgong2.android.feature") | ||
alias(libs.plugins.google.gms.google.services) | ||
} | ||
|
||
android { | ||
|
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
18 changes: 18 additions & 0 deletions
18
main-presentation/src/main/java/com/teamhy2/feature/main/mapper/StudyDayMapper.kt
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,18 @@ | ||
package com.teamhy2.feature.main.mapper | ||
|
||
import com.hongikyeolgong2.calendar.model.StudyDay | ||
import com.hongikyeolgong2.calendar.model.StudyRoomUsage | ||
import com.teamhy2.main.domain.model.StudyDayResponse | ||
|
||
object StudyDayMapper { | ||
fun mapToStudyDay(studyDayResponse: StudyDayResponse): StudyDay { | ||
val studyRoomUsage = | ||
when (studyDayResponse.studyStartTimes.size) { | ||
1 -> StudyRoomUsage.USED_ONCE | ||
2 -> StudyRoomUsage.USED_ONCE_EXTENDED_ONCE | ||
3 -> StudyRoomUsage.USED_ONCE_EXTENDED_TWICE | ||
else -> StudyRoomUsage.NEVER_USED | ||
} | ||
return StudyDay(date = studyDayResponse.date, studyRoomUsage = studyRoomUsage) | ||
} | ||
} |
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