-
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 #230 from School-of-Company/feature/229-training-l…
…ist-training-teacher-list-qr-code-scan 🔀 :: (#229) - 연수 프로그램 리스트, 프로그램별 교원연수 리스트 출석부 불러오기 및 연수 QR인식 기능을 구현하였습니다.
- Loading branch information
Showing
44 changed files
with
1,155 additions
and
244 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
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
8 changes: 8 additions & 0 deletions
8
...ta/src/main/java/com/school_of_company/data/repository/attendance/AttendanceRepository.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.school_of_company.data.repository.attendance | ||
|
||
import com.school_of_company.model.param.attendance.TrainingQrCodeRequestParam | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface AttendanceRepository { | ||
fun trainingQrCode(trainingId: Long, body: TrainingQrCodeRequestParam) : Flow<Unit> | ||
} |
21 changes: 21 additions & 0 deletions
21
...rc/main/java/com/school_of_company/data/repository/attendance/AttendanceRepositoryImpl.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.school_of_company.data.repository.attendance | ||
|
||
import com.school_of_company.model.param.attendance.TrainingQrCodeRequestParam | ||
import com.school_of_company.network.datasource.attendance.AttendanceDataSource | ||
import com.school_of_company.network.mapper.attendance.request.toDto | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class AttendanceRepositoryImpl @Inject constructor( | ||
private val dataSource: AttendanceDataSource | ||
) : AttendanceRepository { | ||
override fun trainingQrCode( | ||
trainingId: Long, | ||
body: TrainingQrCodeRequestParam | ||
): Flow<Unit> { | ||
return dataSource.trainingQrCode( | ||
trainingId = trainingId, | ||
body = body.toDto() | ||
) | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...main/java/com/school_of_company/domain/usecase/attendance/TrainingQrCodeRequestUseCase.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.school_of_company.domain.usecase.attendance | ||
|
||
import com.school_of_company.data.repository.attendance.AttendanceRepository | ||
import com.school_of_company.model.param.attendance.TrainingQrCodeRequestParam | ||
import javax.inject.Inject | ||
|
||
class TrainingQrCodeRequestUseCase @Inject constructor( | ||
private val repository: AttendanceRepository | ||
) { | ||
operator fun invoke( | ||
trainingId: Long, | ||
body: TrainingQrCodeRequestParam | ||
) = runCatching { | ||
repository.trainingQrCode( | ||
trainingId = trainingId, | ||
body = body | ||
) | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
.../java/com/school_of_company/model/entity/training/TeacherTrainingProgramResponseEntity.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,11 +1,12 @@ | ||
package com.school_of_company.model.entity.training | ||
|
||
data class TeacherTrainingProgramResponseEntity( | ||
val id: Long, | ||
val name: String, | ||
val organization: String, | ||
val position: String, | ||
val programName: String, | ||
val status: Boolean, | ||
val entryTime: String, | ||
val leaveTime: String | ||
val entryTime: String?, | ||
val leaveTime: String? | ||
) |
5 changes: 5 additions & 0 deletions
5
.../src/main/java/com/school_of_company/model/param/attendance/TrainingQrCodeRequestParam.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,5 @@ | ||
package com.school_of_company.model.param.attendance | ||
|
||
data class TrainingQrCodeRequestParam ( | ||
val traineeId: Long | ||
) |
15 changes: 15 additions & 0 deletions
15
core/network/src/main/java/com/school_of_company/network/api/AttendanceAPI.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,15 @@ | ||
package com.school_of_company.network.api | ||
|
||
import com.school_of_company.network.dto.attendance.request.TrainingQrCodeRequest | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.Path | ||
|
||
interface AttendanceAPI { | ||
|
||
@GET("/attendance/training/{trainingPro_id}") | ||
suspend fun trainingQrCode( | ||
@Path("trainingPro_id") trainingId: Long, | ||
@Body body: TrainingQrCodeRequest | ||
) | ||
} |
8 changes: 8 additions & 0 deletions
8
...src/main/java/com/school_of_company/network/datasource/attendance/AttendanceDataSource.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.school_of_company.network.datasource.attendance | ||
|
||
import com.school_of_company.network.dto.attendance.request.TrainingQrCodeRequest | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface AttendanceDataSource { | ||
fun trainingQrCode(trainingId: Long, body: TrainingQrCodeRequest) : Flow<Unit> | ||
} |
20 changes: 20 additions & 0 deletions
20
...main/java/com/school_of_company/network/datasource/attendance/AttendanceDataSourceImpl.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.school_of_company.network.datasource.attendance | ||
|
||
import com.school_of_company.network.api.AttendanceAPI | ||
import com.school_of_company.network.dto.attendance.request.TrainingQrCodeRequest | ||
import com.school_of_company.network.util.performApiRequest | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class AttendanceDataSourceImpl @Inject constructor( | ||
private val service: AttendanceAPI | ||
) : AttendanceDataSource { | ||
override fun trainingQrCode( | ||
trainingId: Long, | ||
body: TrainingQrCodeRequest | ||
): Flow<Unit> = | ||
performApiRequest { service.trainingQrCode( | ||
body = body, | ||
trainingId = trainingId | ||
) } | ||
} |
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
9 changes: 9 additions & 0 deletions
9
...c/main/java/com/school_of_company/network/dto/attendance/request/TrainingQrCodeRequest.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,9 @@ | ||
package com.school_of_company.network.dto.attendance.request | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
@JsonClass(generateAdapter = true) | ||
data class TrainingQrCodeRequest( | ||
@Json(name = "traineeId") val traineeId: Long | ||
) |
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
7 changes: 7 additions & 0 deletions
7
...va/com/school_of_company/network/mapper/attendance/request/TrainingQrCodeRequestMapper.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,7 @@ | ||
package com.school_of_company.network.mapper.attendance.request | ||
|
||
import com.school_of_company.model.param.attendance.TrainingQrCodeRequestParam | ||
import com.school_of_company.network.dto.attendance.request.TrainingQrCodeRequest | ||
|
||
fun TrainingQrCodeRequestParam.toDto(): TrainingQrCodeRequest = | ||
TrainingQrCodeRequest(traineeId = traineeId) |
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
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
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
Oops, something went wrong.