Skip to content

Commit

Permalink
Merge pull request #28 from tukcomCD2024/develop_front
Browse files Browse the repository at this point in the history
데모 발표 전 중간 병합
  • Loading branch information
kyujin0911 authored Mar 21, 2024
2 parents dcc2c78 + 24a5acc commit 8c05c68
Show file tree
Hide file tree
Showing 42 changed files with 1,876 additions and 864 deletions.
2 changes: 1 addition & 1 deletion frontend/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ dependencies {
//naver map
implementation("com.naver.maps:map-sdk:3.17.0")

implementation("com.google.android.gms:play-services-location:21.0.1")
implementation("com.google.android.gms:play-services-location:21.2.0")
}
kapt {
correctErrorTypes = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package kr.ac.tukorea.whereareu.data.api

import kr.ac.tukorea.whereareu.data.model.ResponseBody
import kr.ac.tukorea.whereareu.data.model.home.LocationInfo
import kr.ac.tukorea.whereareu.data.model.home.PostLocationInfoResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.POST

interface DementiaHomeService {
@POST("receive-location-info")
suspend fun postLocationInfo(
@Body request: LocationInfo
): Response<PostLocationInfoResponse>

package kr.ac.tukorea.whereareu.data.api.dementia

import kr.ac.tukorea.whereareu.data.model.ResponseBody
import kr.ac.tukorea.whereareu.data.model.home.LocationInfo
import kr.ac.tukorea.whereareu.data.model.home.PostLocationInfoResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.POST

interface DementiaHomeService {
@POST("receive-location-info")
suspend fun postLocationInfo(
@Body request: LocationInfo
): Response<PostLocationInfoResponse>

}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package kr.ac.tukorea.whereareu.data.api

import kr.ac.tukorea.whereareu.data.model.ResponseBody
import kr.ac.tukorea.whereareu.data.model.home.GetLocationInfoResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

interface NokHomeService {
@GET("send-live-location-info")
suspend fun getDementiaLocationInfo(@Query("dementiaKey") dementiaKey: String): Response<ResponseBody<GetLocationInfoResponse>>
package kr.ac.tukorea.whereareu.data.api.nok

import kr.ac.tukorea.whereareu.data.model.ResponseBody
import kr.ac.tukorea.whereareu.data.model.home.GetLocationInfoResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

interface NokHomeService {
@GET("send-live-location-info")
suspend fun getDementiaLocationInfo(@Query("dementiaKey") dementiaKey: String): Response<ResponseBody<GetLocationInfoResponse>>
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package kr.ac.tukorea.whereareu.data.repository.home

import kr.ac.tukorea.whereareu.data.model.home.LocationInfo
import kr.ac.tukorea.whereareu.data.model.home.PostLocationInfoResponse
import kr.ac.tukorea.whereareu.util.network.NetworkResult

interface DementiaHomeRepository {
suspend fun postLocationInfo(request: LocationInfo): NetworkResult<PostLocationInfoResponse>
package kr.ac.tukorea.whereareu.data.repository.dementia.home

import kr.ac.tukorea.whereareu.data.model.home.LocationInfo
import kr.ac.tukorea.whereareu.data.model.home.PostLocationInfoResponse
import kr.ac.tukorea.whereareu.util.network.NetworkResult

interface DementiaHomeRepository {
suspend fun postLocationInfo(request: LocationInfo): NetworkResult<PostLocationInfoResponse>
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package kr.ac.tukorea.whereareu.data.repository.home

import kr.ac.tukorea.whereareu.data.api.DementiaHomeService
import kr.ac.tukorea.whereareu.data.model.ResponseBody
import kr.ac.tukorea.whereareu.data.model.home.LocationInfo
import kr.ac.tukorea.whereareu.data.model.home.PostLocationInfoResponse
import kr.ac.tukorea.whereareu.util.network.NetworkResult
import kr.ac.tukorea.whereareu.util.network.handleApi
import javax.inject.Inject

class DementiaHomeRepositoryImpl @Inject constructor(
private val api: DementiaHomeService
): DementiaHomeRepository {
override suspend fun postLocationInfo(request: LocationInfo): NetworkResult<PostLocationInfoResponse> {
return handleApi({api.postLocationInfo(request)}) {response: PostLocationInfoResponse -> response}
}
package kr.ac.tukorea.whereareu.data.repository.dementia.home

import kr.ac.tukorea.whereareu.data.api.dementia.DementiaHomeService
import kr.ac.tukorea.whereareu.data.model.home.LocationInfo
import kr.ac.tukorea.whereareu.data.model.home.PostLocationInfoResponse
import kr.ac.tukorea.whereareu.util.network.NetworkResult
import kr.ac.tukorea.whereareu.util.network.handleApi
import javax.inject.Inject

class DementiaHomeRepositoryImpl @Inject constructor(
private val api: DementiaHomeService
): DementiaHomeRepository {
override suspend fun postLocationInfo(request: LocationInfo): NetworkResult<PostLocationInfoResponse> {
return handleApi({api.postLocationInfo(request)}) {response: PostLocationInfoResponse -> response}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package kr.ac.tukorea.whereareu.data.repository.home

import kr.ac.tukorea.whereareu.data.model.home.GetLocationInfoResponse
import kr.ac.tukorea.whereareu.util.network.NetworkResult

interface NokHomeRepository {
suspend fun getDementiaLocationInfo(dementiaKey: String): NetworkResult<GetLocationInfoResponse>
package kr.ac.tukorea.whereareu.data.repository.nok.home

import kr.ac.tukorea.whereareu.data.model.home.GetLocationInfoResponse
import kr.ac.tukorea.whereareu.util.network.NetworkResult

interface NokHomeRepository {
suspend fun getDementiaLocationInfo(dementiaKey: String): NetworkResult<GetLocationInfoResponse>
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package kr.ac.tukorea.whereareu.data.repository.home

import kr.ac.tukorea.whereareu.data.api.NokHomeService
import kr.ac.tukorea.whereareu.data.model.ResponseBody
import kr.ac.tukorea.whereareu.data.model.home.GetLocationInfoResponse
import kr.ac.tukorea.whereareu.util.network.NetworkResult
import kr.ac.tukorea.whereareu.util.network.handleApi
import javax.inject.Inject

class NokHomeRepositoryImpl @Inject constructor(
private val api: NokHomeService
): NokHomeRepository{
override suspend fun getDementiaLocationInfo(dementiaKey: String): NetworkResult<GetLocationInfoResponse> {
return handleApi({api.getDementiaLocationInfo(dementiaKey)}) {response: ResponseBody<GetLocationInfoResponse> -> response.result}
}

package kr.ac.tukorea.whereareu.data.repository.nok.home

import kr.ac.tukorea.whereareu.data.api.nok.NokHomeService
import kr.ac.tukorea.whereareu.data.model.ResponseBody
import kr.ac.tukorea.whereareu.data.model.home.GetLocationInfoResponse
import kr.ac.tukorea.whereareu.util.network.NetworkResult
import kr.ac.tukorea.whereareu.util.network.handleApi
import javax.inject.Inject

class NokHomeRepositoryImpl @Inject constructor(
private val api: NokHomeService
): NokHomeRepository {
override suspend fun getDementiaLocationInfo(dementiaKey: String): NetworkResult<GetLocationInfoResponse> {
return handleApi({api.getDementiaLocationInfo(dementiaKey)}) {response: ResponseBody<GetLocationInfoResponse> -> response.result}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import kr.ac.tukorea.whereareu.R
import kr.ac.tukorea.whereareu.WhereAreUApplication
import kr.ac.tukorea.whereareu.data.api.DementiaHomeService
import kr.ac.tukorea.whereareu.data.api.dementia.DementiaHomeService
import kr.ac.tukorea.whereareu.data.api.LoginService
import kr.ac.tukorea.whereareu.data.api.NokHomeService
import kr.ac.tukorea.whereareu.data.api.nok.NokHomeService
import kr.ac.tukorea.whereareu.util.location.LocationService
import okhttp3.Interceptor
import okhttp3.Interceptor.*
import okhttp3.OkHttpClient
Expand Down Expand Up @@ -42,8 +43,8 @@ object NetworkModule {
}

return OkHttpClient.Builder()
.connectTimeout(5, TimeUnit.SECONDS)
.readTimeout(5, TimeUnit.SECONDS)
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.SECONDS)
.writeTimeout(5, TimeUnit.SECONDS)
.addInterceptor(interceptor)
.addNetworkInterceptor(closeInterceptor)
Expand Down Expand Up @@ -80,6 +81,12 @@ object NetworkModule {
return retrofit.buildService()
}

@Provides
@Singleton
fun provideLocationService(): LocationService{
return LocationService()
}

private inline fun <reified T> Retrofit.buildService(): T {
return this.create(T::class.java)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ViewModelComponent
import dagger.hilt.android.scopes.ViewModelScoped
import kr.ac.tukorea.whereareu.data.api.DementiaHomeService
import kr.ac.tukorea.whereareu.data.api.dementia.DementiaHomeService
import kr.ac.tukorea.whereareu.data.api.LoginService
import kr.ac.tukorea.whereareu.data.repository.home.DementiaHomeRepository
import kr.ac.tukorea.whereareu.data.repository.home.DementiaHomeRepositoryImpl
import kr.ac.tukorea.whereareu.data.repository.dementia.home.DementiaHomeRepository
import kr.ac.tukorea.whereareu.data.repository.dementia.home.DementiaHomeRepositoryImpl
import kr.ac.tukorea.whereareu.data.repository.login.LoginRepository
import kr.ac.tukorea.whereareu.data.repository.login.LoginRepositoryImpl

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package kr.ac.tukorea.whereareu.domain.home

data class MeaningfulPlace(
val name: String,
val address: String
)
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package kr.ac.tukorea.whereareu.presentation.dementia

import android.content.pm.PackageManager
import android.os.Build
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import kr.ac.tukorea.whereareu.R
import kr.ac.tukorea.whereareu.databinding.FragmentHomeBinding
import kr.ac.tukorea.whereareu.presentation.base.BaseFragment

class DementiaHomeFragment: BaseFragment<FragmentHomeBinding>(R.layout.fragment_home) {
override fun initObserver() {

}

override fun initView() {

}
package kr.ac.tukorea.whereareu.presentation.dementia.home

import android.content.pm.PackageManager
import android.os.Build
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import kr.ac.tukorea.whereareu.R
import kr.ac.tukorea.whereareu.databinding.FragmentHomeBinding
import kr.ac.tukorea.whereareu.presentation.base.BaseFragment

class DementiaHomeFragment: BaseFragment<FragmentHomeBinding>(R.layout.fragment_home) {
override fun initObserver() {

}

override fun initView() {

}
}
Loading

0 comments on commit 8c05c68

Please sign in to comment.