-
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.
Merge pull request #99 from Mnseo/feature/attend-ui
[FEAT] 출석 기능 UI 구현
- Loading branch information
Showing
30 changed files
with
971 additions
and
20 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: 20 additions & 0 deletions
20
data/src/main/java/com/kusitms/data/remote/entity/response/home/AttendCurrentPayLoad.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,20 @@ | ||
package com.kusitms.data.remote.entity.response.home | ||
|
||
import com.kusitms.domain.model.home.AttendCurrentModel | ||
|
||
data class AttendCurrentPayLoad( | ||
val attendId: Int, | ||
val curriculum: String, | ||
val date: String, | ||
val time: String, | ||
val status:String | ||
) | ||
|
||
fun AttendCurrentPayLoad.toModel() = | ||
AttendCurrentModel( | ||
attendId = attendId ?: 0, | ||
curriculum = curriculum ?: "", | ||
date = date ?: "", | ||
time = time ?: "", | ||
status = status ?: "" | ||
) |
18 changes: 18 additions & 0 deletions
18
data/src/main/java/com/kusitms/data/remote/entity/response/home/AttendInfoPayload.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.kusitms.data.remote.entity.response.home | ||
|
||
import com.kusitms.domain.model.home.AttendInfoModel | ||
|
||
data class AttendInfoPayload( | ||
val curriculumId: Int, | ||
val curriculumName: String, | ||
val isAttended: Boolean, | ||
val date: String | ||
) | ||
|
||
fun AttendInfoPayload.toModel() = | ||
AttendInfoModel( | ||
curriculumId = curriculumId ?: 0, | ||
curriculumName = curriculumName ?: "", | ||
isAttended = isAttended ?: false, | ||
date = date ?: "2월 17일" | ||
) |
20 changes: 20 additions & 0 deletions
20
data/src/main/java/com/kusitms/data/remote/entity/response/home/AttendPayload.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,20 @@ | ||
package com.kusitms.data.remote.entity.response.home | ||
|
||
import com.kusitms.domain.model.home.AttendModel | ||
|
||
data class AttendPayload( | ||
val penalty: Int, | ||
val present: Int, | ||
val absent: Int, | ||
val late: Int, | ||
val passYn: String | ||
) | ||
|
||
fun AttendPayload.toModel() = | ||
AttendModel( | ||
penalty = penalty ?: 0, | ||
present = present ?: 0, | ||
absent = absent ?: 0, | ||
late = late ?: 0, | ||
passYn = passYn ?: "수료 가능한 점수에요" | ||
) |
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
24 changes: 24 additions & 0 deletions
24
domain/src/main/java/com/kusitms/domain/model/home/AttendCurrentModel.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,24 @@ | ||
package com.kusitms.domain.model.home | ||
|
||
data class AttendCurrentModel( | ||
val attendId: Int, | ||
val curriculum: String, | ||
val date: String, | ||
val time: String, | ||
val status: String, | ||
) | ||
|
||
data class AttendModel( | ||
val penalty: Int, | ||
val present: Int, | ||
val absent: Int, | ||
val late: Int, | ||
val passYn: String | ||
) | ||
|
||
data class AttendInfoModel( | ||
val curriculumId: Int, | ||
val curriculumName: String, | ||
val isAttended: Boolean, | ||
val date: String | ||
) |
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
21 changes: 21 additions & 0 deletions
21
domain/src/main/java/com/kusitms/domain/usecase/home/GetAttendCurrentListUseCase.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,21 @@ | ||
package com.kusitms.domain.usecase.home | ||
|
||
import com.kusitms.domain.model.home.AttendCurrentModel | ||
import com.kusitms.domain.repository.HomeRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.flow | ||
import javax.inject.Inject | ||
|
||
class GetAttendCurrentListUseCase @Inject constructor( | ||
private val homeRepository: HomeRepository | ||
) { | ||
operator fun invoke(): Flow<List<AttendCurrentModel>> = flow { | ||
homeRepository.getAttendCurrentList() | ||
.onSuccess { | ||
emit(it) | ||
} | ||
.onFailure { | ||
throw it | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
domain/src/main/java/com/kusitms/domain/usecase/home/GetAttendInfoUseCase.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,20 @@ | ||
package com.kusitms.domain.usecase.home | ||
|
||
import com.kusitms.domain.model.home.AttendInfoModel | ||
import com.kusitms.domain.repository.HomeRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.flow | ||
import javax.inject.Inject | ||
|
||
class GetAttendInfoUseCase @Inject constructor( | ||
private val homeRepository: HomeRepository | ||
) { | ||
operator fun invoke(): Flow<AttendInfoModel> = flow { | ||
homeRepository.getAttendInfo() | ||
.onSuccess { | ||
emit(it) | ||
}.onFailure { | ||
throw it | ||
} | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
presentation/src/main/java/com/kusitms/presentation/model/home/attend/AttendUiState.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,19 @@ | ||
package com.kusitms.presentation.model.home.attend | ||
|
||
import com.kusitms.domain.model.home.AttendCurrentModel | ||
|
||
data class AttendUiState( | ||
val curriculum:String, | ||
val date: String, | ||
val time: String, | ||
val status: String, | ||
val attendList: List<AttendCurrentModel> = emptyList() | ||
) | ||
|
||
|
||
val curriDummy = listOf( | ||
AttendUiState("전체 OT", "9월 2일", "오후 1:59", "PRESENT"), | ||
AttendUiState("전체 OT", "9월 9일","출석 실패", "ABSENT"), | ||
AttendUiState("전문가 초청 강연", "9월 16일","오후 2:13", "LATE"), | ||
|
||
) |
Oops, something went wrong.