-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/#132 : 마이페이지 출석내역 내비게이션 연결 및 작업 #133
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
6 commits
Select commit
Hold shift + click to select a range
0adda4f
feature#132 : 출석 내역 모듈 추가 및 컴포저블 구현
TaeseongYun 9dd8d88
feature#132 : 출석 네트워크 api 연결 및 세션 api 연결
TaeseongYun 64ec73e
feature#132 : 마이페이지 출석 내역 화면이동 연결
TaeseongYun b1ed24c
feature#132 : 출석내역 내비게이션 그래프 연결 및 모듈 연결
TaeseongYun 1a998ce
feature#132 : API 호출 AuthRetrofit 어노테이션 적용
TaeseongYun 367ac9c
refactor#132 : API 프록시 코드리뷰 적용
TaeseongYun 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
8 changes: 8 additions & 0 deletions
8
core/data-api/src/main/java/com/yapp/dataapi/AttendanceRepository.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,8 @@ | ||
| package com.yapp.dataapi | ||
|
|
||
| import com.yapp.model.AttendStatistics | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| interface AttendanceRepository { | ||
| fun getAttendanceStatistics(): Flow<AttendStatistics> | ||
| } |
8 changes: 8 additions & 0 deletions
8
core/data-api/src/main/java/com/yapp/dataapi/SessionRepository.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,8 @@ | ||
| package com.yapp.dataapi | ||
|
|
||
| import com.yapp.model.Sessions | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| interface SessionRepository { | ||
| fun getSessions(): Flow<List<Sessions>> | ||
| } |
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
16 changes: 16 additions & 0 deletions
16
core/data/src/main/java/com/yapp/core/data/data/repository/AttendanceRepositoryImpl.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,16 @@ | ||
| package com.yapp.core.data.data.repository | ||
|
|
||
| import com.yapp.core.data.remote.api.AttendanceApi | ||
| import com.yapp.dataapi.AttendanceRepository | ||
| import com.yapp.model.AttendStatistics | ||
| import kotlinx.coroutines.flow.Flow | ||
| import kotlinx.coroutines.flow.flow | ||
| import javax.inject.Inject | ||
|
|
||
| internal class AttendanceRepositoryImpl @Inject constructor( | ||
| private val attendApi: AttendanceApi | ||
| ): AttendanceRepository{ | ||
| override fun getAttendanceStatistics(): Flow<AttendStatistics> = flow { | ||
| emit(attendApi.getAttendanceStatistics().toModel()) | ||
| } | ||
| } |
26 changes: 26 additions & 0 deletions
26
core/data/src/main/java/com/yapp/core/data/data/repository/SessionsRepositoryImpl.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,26 @@ | ||
| package com.yapp.core.data.data.repository | ||
|
|
||
| import com.yapp.core.data.remote.api.SessionApi | ||
| import com.yapp.dataapi.SessionRepository | ||
| import com.yapp.model.Sessions | ||
| import kotlinx.coroutines.flow.flow | ||
| import javax.inject.Inject | ||
|
|
||
| internal class SessionsRepositoryImpl @Inject constructor( | ||
| private val sessionApi: SessionApi | ||
| ): SessionRepository{ | ||
| override fun getSessions() = flow { | ||
| emit(sessionApi.getSessions().map { result -> | ||
| Sessions( | ||
| id = result.id, | ||
| name = result.name, | ||
| place = result.place, | ||
| date = result.date, | ||
| endDate = result.endDate, | ||
| time = result.time, | ||
| type = Sessions.AttendType.valueOf(result.type), | ||
| progressPhase = result.progressPhase | ||
| ) | ||
| }) | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
core/data/src/main/java/com/yapp/core/data/remote/api/AttendanceApi.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.yapp.core.data.remote.api | ||
|
|
||
| import com.yapp.core.data.remote.model.response.AttendStatisticsResponse | ||
| import retrofit2.http.GET | ||
| import retrofit2.http.POST | ||
|
|
||
| interface AttendanceApi { | ||
| @POST("v1/attendances") | ||
| suspend fun postAttendance() | ||
|
|
||
| @GET("v1/attendances/statistics") | ||
| suspend fun getAttendanceStatistics(): AttendStatisticsResponse | ||
| } |
9 changes: 9 additions & 0 deletions
9
core/data/src/main/java/com/yapp/core/data/remote/api/SessionApi.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,9 @@ | ||
| package com.yapp.core.data.remote.api | ||
|
|
||
| import com.yapp.core.data.remote.model.response.SessionResponse | ||
| import retrofit2.http.GET | ||
|
|
||
| interface SessionApi { | ||
| @GET("v1/sessions") | ||
| suspend fun getSessions(): List<SessionResponse> | ||
| } |
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
28 changes: 28 additions & 0 deletions
28
core/data/src/main/java/com/yapp/core/data/remote/model/response/AttendStatisticsResponse.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,28 @@ | ||
| package com.yapp.core.data.remote.model.response | ||
|
|
||
| import com.yapp.model.AttendStatistics | ||
| import com.yapp.model.UserInfo | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class AttendStatisticsResponse( | ||
| val totalSessionCount: Int, | ||
| val remainingSessionCount: Int, | ||
| val sessionProgressRate: Int, | ||
| val attendancePoint: Int, | ||
| val attendanceCount: Int, | ||
| val lateCount: Int, | ||
| val absenceCount: Int, | ||
| val latePassCount: Int | ||
| ) { | ||
| fun toModel() = AttendStatistics( | ||
| totalSessionCount = totalSessionCount, | ||
| remainingSessionCount = remainingSessionCount, | ||
| sessionProgressRate = sessionProgressRate, | ||
| attendancePoint = attendancePoint, | ||
| attendanceCount = attendanceCount, | ||
| lateCount = lateCount, | ||
| absenceCount = absenceCount, | ||
| latePassCount = latePassCount | ||
| ) | ||
| } |
15 changes: 15 additions & 0 deletions
15
core/data/src/main/java/com/yapp/core/data/remote/model/response/SessionResponse.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,15 @@ | ||
| package com.yapp.core.data.remote.model.response | ||
|
|
||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class SessionResponse( | ||
| val id: String, | ||
| val name: String, | ||
| val place: String?, | ||
| val date: String, | ||
| val endDate: String?, | ||
| val time: String?, | ||
| val type: String, | ||
| val progressPhase: String | ||
| ) |
12 changes: 12 additions & 0 deletions
12
core/model/src/main/java/com/yapp/model/AttendStatistics.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.yapp.model | ||
|
|
||
| data class AttendStatistics( | ||
| val totalSessionCount: Int, | ||
| val remainingSessionCount: Int, | ||
| val sessionProgressRate: Int, | ||
| val attendancePoint: Int, | ||
| val attendanceCount: Int, | ||
| val lateCount: Int, | ||
| val absenceCount: Int, | ||
| val latePassCount: Int | ||
| ) |
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,16 @@ | ||
| package com.yapp.model | ||
|
|
||
| data class Sessions( | ||
| val id: String, | ||
| val name: String, | ||
| val place: String?, | ||
| val date: String, | ||
| val endDate: String?, | ||
| val time: String?, | ||
| val type: AttendType, | ||
| val progressPhase: String | ||
| ) { | ||
| enum class AttendType { | ||
|
|
||
| } | ||
| } |
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 @@ | ||
| /build |
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,16 @@ | ||
| import com.yapp.app.setNamespace | ||
|
|
||
| plugins { | ||
| id("yapp.android.feature") | ||
| } | ||
|
|
||
| android { | ||
| setNamespace("feature.history") | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(libs.androidx.core.ktx) | ||
| implementation(libs.androidx.appcompat) | ||
| implementation(libs.androidx.activity.compose) | ||
| implementation(libs.material) | ||
| } |
Empty file.
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 @@ | ||
| # Add project specific ProGuard rules here. | ||
| # You can control the set of applied configuration files using the | ||
| # proguardFiles setting in build.gradle. | ||
| # | ||
| # For more details, see | ||
| # http://developer.android.com/guide/developing/tools/proguard.html | ||
|
|
||
| # If your project uses WebView with JS, uncomment the following | ||
| # and specify the fully qualified class name to the JavaScript interface | ||
| # class: | ||
| #-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| # public *; | ||
| #} | ||
|
|
||
| # Uncomment this to preserve the line number information for | ||
| # debugging stack traces. | ||
| #-keepattributes SourceFile,LineNumberTable | ||
|
|
||
| # If you keep the line number information, uncomment this to | ||
| # hide the original source file name. | ||
| #-renamesourcefileattribute SourceFile |
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,4 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| </manifest> |
33 changes: 33 additions & 0 deletions
33
feature/history/src/main/java/com/yapp/feature/history/AttendHistoryContract.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,33 @@ | ||
| package com.yapp.feature.history | ||
|
|
||
| import com.yapp.model.Sessions | ||
|
|
||
| data class AttendHistoryState( | ||
| val totalSessionCount: Int = 0, | ||
| val remainingSessionCount: Int = 0, | ||
| val sessionProgressRate: Int = 0, | ||
| val attendancePoint: Int = 0, | ||
| val attendanceCount: Int = 0, | ||
| val lateCount: Int = 0, | ||
| val absenceCount: Int = 0, | ||
| val latePassCount: Int = 0, | ||
| val sessions: List<Sessions> = emptyList() | ||
| ) { | ||
| val alertMessage: String | ||
| get() { | ||
| return if (absenceCount >= 10) { | ||
| "결석이 10번 이상이 되면 출결에 문제가 생겨 재적처리가 될 수 있어요. 출석 관리에 조금 더 신경 써 주세요!" | ||
| } else { | ||
| "" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| sealed interface AttendHistoryIntent { | ||
| data object OnEntryScreen : AttendHistoryIntent | ||
| data object OnClickBackButton : AttendHistoryIntent | ||
| } | ||
|
Comment on lines
+27
to
+29
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. C: Intent는 'On' 없이 그냥 EntryScreen으로 작성하고 있어서 컨벤션 맞춰주시면 감사하겠습니다. |
||
|
|
||
| sealed interface AttendHistorySideEffect { | ||
| data object NavigateToBack : AttendHistorySideEffect | ||
| } | ||
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.
A: get을 쓰지 않더라도 매번 AttendHistoryState는 copy로 새로 생성되기 때문에 get이 없어도 될거에요