Skip to content

Commit

Permalink
[feat] 더미 사진들 모두 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seunghee17 committed May 23, 2024
1 parent d2b70c8 commit c103bf1
Show file tree
Hide file tree
Showing 57 changed files with 2,433 additions and 478 deletions.
5 changes: 0 additions & 5 deletions app/src/main/java/com/example/remind/app/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
package com.example.remind.app

import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Surface
import androidx.compose.ui.Modifier
import com.example.remind.core.designsystem.theme.RemindTheme
import com.google.firebase.Firebase
import dagger.hilt.android.AndroidEntryPoint
import com.google.firebase.messaging.messaging

@AndroidEntryPoint
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
RemindTheme {

Surface(
modifier = Modifier.fillMaxSize(),
color = RemindTheme.colors.white
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/example/remind/app/RemindNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import com.example.remind.feature.screens.patience.PatienceScreen
import com.example.remind.feature.screens.auth.RegisterGraph
import com.example.remind.feature.screens.auth.onboarding.OnBoardingViewModel
import com.example.remind.feature.screens.auth.splash.SplashGraph
import com.example.remind.feature.screens.doctor.DoctorViewModel

@Composable
fun RemindNavHost() {
val navHostController = rememberNavController()
val onBoardingViewModel: OnBoardingViewModel = hiltViewModel()
val doctorViewModel: DoctorViewModel = hiltViewModel()
NavHost(
navController = navHostController,
startDestination = Screens.Splash.route
Expand All @@ -25,7 +27,7 @@ fun RemindNavHost() {
composable(route = Screens.Patience.route) {
PatienceScreen()
}
DoctorGraph(navHostController)
DoctorGraph(navHostController,doctorViewModel)
CenterGraph(navHostController)
}
}
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/java/com/example/remind/app/Screens.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ sealed class Screens(val route: String) {
object Doctor: Screens("doctor") {
object DoctorMain: Screens("DoctorMain")
object DoctorPatienceRegister: Screens("PatienceRegister_doctor")
object PatienceManage: Screens("PatienceManage_doctor")
object PrescriptionUpdate: Screens("PatienceUpdate_doctor")
object ManageMedicine: Screens("PatienceMedicine_doctor")
object ManageMood: Screens("PatienceMood_doctor")
object ExDoctorBottomSheet: Screens("doctor_example")
}
object Center: Screens("center") {
object CenterMain: Screens("CenterMain")
Expand All @@ -32,7 +37,9 @@ sealed class Screens(val route: String) {
object WritingMoodStep3: Screens("writing_step3")
object SplashCheering: Screens("cheering")
}
object MoodChart: Screens("MoodChart")
object MoodChart: Screens("MoodChart") {
object ExMoodChartBottomSheet:Screens("bottomsheet")
}
object Medicine: Screens("Medicine") {
object AlarmSetting: Screens("alarm_setting")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fun BasicButton(
textColor: Color,
verticalPadding: Dp,
onClick: () -> Unit,
textStyle: TextStyle
textStyle: TextStyle,
) {
Button(
modifier = modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.example.remind.core.common.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -22,7 +23,8 @@ fun BasicListItem(
modifier: Modifier = Modifier,
name: String,
index: String,
backgroundColor: Color
backgroundColor: Color,
catiousClicked: () -> Unit
) {
Row(
modifier = Modifier
Expand All @@ -45,7 +47,11 @@ fun BasicListItem(
)
Spacer(Modifier.weight(1f))
Text(
modifier = modifier.padding(end = 5.dp),
modifier = modifier
.padding(end = 5.dp)
.clickable (
onClick = catiousClicked
),
text = "관리",
color = RemindTheme.colors.main_6,
style = RemindTheme.typography.b3Medium
Expand All @@ -60,5 +66,5 @@ fun BasicListItem(
@Preview
@Composable
fun ListItemPreview() {
BasicListItem(modifier = Modifier,"송승희", "01", backgroundColor = Color.White)
//BasicListItem(modifier = Modifier,"송승희", "01", backgroundColor = Color.White)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,19 @@ fun MainAppBar(
verticalAlignment = Alignment.CenterVertically
) {
Image(
painter = painterResource(id = R.drawable.ic_logo),
painter = painterResource(id = R.drawable.ic_main_logo),
contentDescription = null,
modifier = modifier
.size(width = 36.dp, height = 21.dp)
)
Spacer(Modifier.weight(1f))
IconButton(
onClick = onClick,
) {
Icon(
painter = painterResource(id = R.drawable.ic_setting),
contentDescription = null,
modifier = modifier
.size(width = 24.dp, height = 28.dp),
tint = RemindTheme.colors.icon
)
}
Icon(
painter = painterResource(id = R.drawable.ic_setting),
contentDescription = null,
modifier = modifier
.size(width = 24.dp, height = 28.dp),
tint = RemindTheme.colors.icon
)
}
}

Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/com/example/remind/data/di/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import com.example.remind.BuildConfig
import com.example.remind.data.network.adapter.ApiResultCallAdapterFactory
import com.example.remind.data.network.interceptor.AuthInterceptor
import com.example.remind.data.network.service.AuthService
import com.example.remind.data.network.service.DoctorService
import com.example.remind.data.network.service.PatientService
import com.example.remind.data.repository.auth.AuthRepository
import com.example.remind.data.repository.auth.AuthRepositoryImpl
import com.example.remind.data.repository.auth.TokenRepository
import com.example.remind.data.repository.auth.TokenRepositoryImpl
import com.example.remind.data.repository.doctor.DoctorRepository
import com.example.remind.data.repository.doctor.DoctorRepositoryImpl
import com.example.remind.data.repository.patient.PatientMedicineRepository
import com.example.remind.data.repository.patient.PatientMedicineRepositoryImpl
import com.example.remind.data.repository.patient.PatientMoodChartRepository
Expand Down Expand Up @@ -70,6 +73,12 @@ object NetworkModule {
return retrofit.create(PatientService::class.java)
}

@Singleton
@Provides
fun provideDoctorService(retrofit: Retrofit): DoctorService {
return retrofit.create(DoctorService::class.java)
}

@Module
@InstallIn(SingletonComponent::class)
abstract class RepositoryModule {
Expand All @@ -86,6 +95,10 @@ object NetworkModule {
@Singleton
@Binds
abstract fun providesPatientMoodChartRepository(patientMoodChartRepositoryImpl: PatientMoodChartRepositoryImpl): PatientMoodChartRepository

@Singleton
@Binds
abstract fun providesDoctorRepository(doctorRepositoryImpl: DoctorRepositoryImpl): DoctorRepository
}

}
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
)
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
)
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=""
)

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface AuthService {
@Body body: KakaoLoginRequest
): ApiResult<SocialLoginResponse>

@POST("/member/onboarding")
@POST("/prescription/relation/accept")
suspend fun OnBoarding(
@Body body: OnBoardingRequest
): ApiResult<OnBoardingResponse>
Expand Down
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>
}
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>
}
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)
}

}
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)
}
}
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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LoginViewModel @Inject constructor(
private fun KakaoLogin(context : Context) {
val callback: (OAuthToken?, Throwable?) -> Unit = { token, error ->
if(error != null) {
Log.e("kakao", "카카오 로그인 실패")
Log.e("kakao", "카카오 로그인 실패${error.message}")
} else if(token != null) {
UserApiClient.instance.me { user, error ->
viewModelScope.launch {
Expand Down Expand Up @@ -76,7 +76,8 @@ private fun socialLogin(token: String) {
val result = authUseCase.invoke(KakaoLoginRequest(token))
when(result) {
is ApiResult.Success -> {
runBlocking { tokenManager.saveAccessToken(
runBlocking {
tokenManager.saveAccessToken(
result.data.data.accessToken,
result.data.data.refreshToken
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ fun OnBoardingCheckDoctorScreen(
)
Spacer(modifier = Modifier.height(12.dp))
Text(
modifier = Modifier.padding(horizontal = 20.dp),
text = stringResource(id = R.string.정신질환_환자_사례관리),
style = RemindTheme.typography.b3Medium.copy(
color = RemindTheme.colors.grayscale_3,
lineHeight = 49.sp
lineHeight = 30.sp
)
)
Text(
modifier = Modifier.padding(top = 66.dp),
modifier = Modifier.padding(start = 20.dp, top = 66.dp),
text= "면허번호",
style = RemindTheme.typography.b2Medium.copy(color = RemindTheme.colors.text)
)
Expand All @@ -86,10 +87,11 @@ fun OnBoardingCheckDoctorScreen(
bottomPadding = 13.dp,
maxLine = 1
)
Spacer(modifier = Modifier.weight(1f))
BasicButton(
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 32.dp),
.padding(bottom = 32.dp, start = 20.dp, end = 20.dp),
text = stringResource(id = R.string.인증_신청),
RoundedCorner = 12.dp,
backgroundColor = RemindTheme.colors.main_4,
Expand All @@ -114,7 +116,7 @@ fun DoctorPreview() {
text = stringResource(id = R.string.정신질환_환자_사례관리),
style = RemindTheme.typography.b3Medium.copy(
color = RemindTheme.colors.grayscale_3,
lineHeight = 49.sp
lineHeight = 30.sp
)
)
}
Loading

0 comments on commit c103bf1

Please sign in to comment.