-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2b70c8
commit c103bf1
Showing
57 changed files
with
2,433 additions
and
478 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
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
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/example/remind/data/model/request/SetAcceptrequest.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.example.remind.data.model.request | ||
|
||
data class SetAcceptrequest( | ||
val memberId: Int | ||
) |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/example/remind/data/model/response/GetAcceptResponse.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,10 @@ | ||
package com.example.remind.data.model.response | ||
|
||
data class GetAcceptResponse( | ||
val code: Int, | ||
val `data`: Accept, | ||
val message: String | ||
) | ||
data class Accept( | ||
val connectionId: Int | ||
) |
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/example/remind/data/model/response/GetPatientResponse.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.example.remind.data.model.response | ||
|
||
data class GetPatientResponse( | ||
val code: Int, | ||
val `data`: DoctorData, | ||
val message: String | ||
) | ||
data class DoctorData( | ||
val patientDtos: List<PatientDto> = emptyList(), | ||
val patientNumber: Int = 0, | ||
val targetMemberCode: String = "" | ||
) | ||
data class PatientDto( | ||
val age: Int=0, | ||
val gender: String="", | ||
val memberId: Int=0, | ||
val name: 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
22 changes: 22 additions & 0 deletions
22
app/src/main/java/com/example/remind/data/network/service/DoctorService.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,22 @@ | ||
package com.example.remind.data.network.service | ||
|
||
import com.example.remind.data.model.request.SetAcceptrequest | ||
import com.example.remind.data.model.response.GetAcceptResponse | ||
import com.example.remind.data.model.response.GetPatientResponse | ||
import com.example.remind.data.network.adapter.ApiResult | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.Query | ||
|
||
interface DoctorService { | ||
@GET("/member/patients") | ||
suspend fun getPatientsList( | ||
@Query("status") status:String | ||
): ApiResult<GetPatientResponse> | ||
|
||
@POST("/prescription/relation/accept") | ||
suspend fun setRequest( | ||
@Body body: SetAcceptrequest | ||
): ApiResult<GetAcceptResponse> | ||
} |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/example/remind/data/repository/doctor/DoctorRepository.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,11 @@ | ||
package com.example.remind.data.repository.doctor | ||
|
||
import com.example.remind.data.model.request.SetAcceptrequest | ||
import com.example.remind.data.model.response.GetAcceptResponse | ||
import com.example.remind.data.model.response.GetPatientResponse | ||
import com.example.remind.data.network.adapter.ApiResult | ||
|
||
interface DoctorRepository { | ||
suspend fun getPatientList(status: String): ApiResult<GetPatientResponse> | ||
suspend fun getRequest(body: SetAcceptrequest): ApiResult<GetAcceptResponse> | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/example/remind/data/repository/doctor/DoctorRepositoryImpl.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.example.remind.data.repository.doctor | ||
|
||
import com.example.remind.data.model.request.SetAcceptrequest | ||
import com.example.remind.data.model.response.GetAcceptResponse | ||
import com.example.remind.data.model.response.GetPatientResponse | ||
import com.example.remind.data.network.adapter.ApiResult | ||
import com.example.remind.data.network.service.DoctorService | ||
import javax.inject.Inject | ||
|
||
class DoctorRepositoryImpl @Inject constructor( | ||
private val service: DoctorService | ||
):DoctorRepository { | ||
override suspend fun getPatientList(status: String): ApiResult<GetPatientResponse> { | ||
return service.getPatientsList(status) | ||
} | ||
|
||
override suspend fun getRequest(body: SetAcceptrequest): ApiResult<GetAcceptResponse> { | ||
return service.setRequest(body) | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/example/remind/domain/usecase/doctor_usecase/GetPatientUseCase.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,14 @@ | ||
package com.example.remind.domain.usecase.doctor_usecase | ||
|
||
import com.example.remind.data.model.response.GetPatientResponse | ||
import com.example.remind.data.network.adapter.ApiResult | ||
import com.example.remind.data.repository.doctor.DoctorRepository | ||
import javax.inject.Inject | ||
|
||
class GetPatientUseCase @Inject constructor( | ||
private val doctorRepository: DoctorRepository | ||
) { | ||
suspend operator fun invoke(status: String): ApiResult<GetPatientResponse> { | ||
return doctorRepository.getPatientList(status) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
app/src/main/java/com/example/remind/domain/usecase/doctor_usecase/GetRequestUseCase.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.example.remind.domain.usecase.doctor_usecase | ||
|
||
import com.example.remind.data.model.request.SetAcceptrequest | ||
import com.example.remind.data.model.response.GetAcceptResponse | ||
import com.example.remind.data.network.adapter.ApiResult | ||
import com.example.remind.data.repository.doctor.DoctorRepository | ||
import javax.inject.Inject | ||
|
||
class GetRequestUseCase @Inject constructor( | ||
private val doctorRepository: DoctorRepository | ||
) { | ||
suspend operator fun invoke(body: SetAcceptrequest): ApiResult<GetAcceptResponse> { | ||
return doctorRepository.getRequest(body) | ||
} | ||
} |
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.