Skip to content

Commit

Permalink
Merge branch 'develop' into feat/#81-splash-api
Browse files Browse the repository at this point in the history
  • Loading branch information
chattymin committed Jan 12, 2024
2 parents 239f55d + c36e641 commit 8bcda27
Show file tree
Hide file tree
Showing 104 changed files with 2,010 additions and 583 deletions.
9 changes: 4 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
android:exported="false"
android:screenOrientation="portrait" />


<activity
android:name="com.going.presentation.tendency.splash.TendencySplashActivity"
android:exported="false"
Expand All @@ -80,7 +79,7 @@
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.tripdashboard.TripDashBoardActivity"
android:name="com.going.presentation.dashboard.DashBoardActivity"
android:exported="false"
android:screenOrientation="portrait" />

Expand All @@ -105,7 +104,7 @@
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.todo.mytodo.detail.MyTodoDetailActivity"
android:name="com.going.presentation.todo.detail.PrivateDetailActivity"
android:exported="false"
android:screenOrientation="portrait" />

Expand All @@ -115,7 +114,7 @@
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.todo.ourtodo.detail.OurTodoDetailActivity"
android:name="com.going.presentation.todo.detail.PublicDetailActivity"
android:exported="false"
android:screenOrientation="portrait" />

Expand All @@ -130,7 +129,7 @@
android:screenOrientation="portrait" />

<activity
android:name="com.going.presentation.profile.ProfileActivity"
android:name="com.going.presentation.tripdashboard.profile.ProfileActivity"
android:exported="false"
android:screenOrientation="portrait" />

Expand Down
14 changes: 14 additions & 0 deletions app/src/main/java/com/going/doorip/di/DataSourceModule.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package com.going.doorip.di

import com.going.data.datasource.AuthDataSource
import com.going.data.datasource.DashBoardDataSource
import com.going.data.datasource.EnterTripDataSource
import com.going.data.datasource.MockDataSource
import com.going.data.datasource.ProfileDataSource
import com.going.data.datasource.SettingDataSource
import com.going.data.datasource.TendencyDataSource
import com.going.data.datasource.TodoDataSource
import com.going.data.datasourceImpl.AuthDataSourceImpl
import com.going.data.datasourceImpl.DashBoardDataSourceImpl
import com.going.data.datasourceImpl.EnterTripDataSourceImpl
import com.going.data.datasourceImpl.MockDataSourceImpl
import com.going.data.datasourceImpl.ProfileDataSourceImpl
import com.going.data.datasourceImpl.SettingDataSourceImpl
Expand Down Expand Up @@ -42,6 +46,11 @@ object DataSourceModule {
fun provideTodoDataSource(todoDataSourceImpl: TodoDataSourceImpl): TodoDataSource =
todoDataSourceImpl

@Provides
@Singleton
fun provideDashBoardDataSource(dashBoardDataSourceImpl: DashBoardDataSourceImpl): DashBoardDataSource =
dashBoardDataSourceImpl

@Provides
@Singleton
fun provideTendencyDataSource(tendencyDataSourceImpl: TendencyDataSourceImpl): TendencyDataSource =
Expand All @@ -51,4 +60,9 @@ object DataSourceModule {
@Singleton
fun provideProfileDataSource(profileDataSourceImpl: ProfileDataSourceImpl): ProfileDataSource =
profileDataSourceImpl

@Provides
@Singleton
fun provideEnterTripDataSource(entertripDataSourceImpl: EnterTripDataSourceImpl): EnterTripDataSource =
entertripDataSourceImpl
}
14 changes: 14 additions & 0 deletions app/src/main/java/com/going/doorip/di/RepositoryModule.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.going.doorip.di

import com.going.data.repositoryImpl.AuthRepositoryImpl
import com.going.data.repositoryImpl.DashBoardRepositoryImpl
import com.going.data.repositoryImpl.EnterTripRepositoryImpl
import com.going.data.repositoryImpl.MockRepositoryImpl
import com.going.data.repositoryImpl.ProfileRepositoryImpl
import com.going.data.repositoryImpl.SettingRepositoryImpl
import com.going.data.repositoryImpl.TendencyRepositoryImpl
import com.going.data.repositoryImpl.TodoRepositoryImpl
import com.going.data.repositoryImpl.TokenRepositoryImpl
import com.going.domain.repository.AuthRepository
import com.going.domain.repository.DashBoardRepository
import com.going.domain.repository.EnterTripRepository
import com.going.domain.repository.MockRepository
import com.going.domain.repository.ProfileRepository
import com.going.domain.repository.SettingRepository
Expand Down Expand Up @@ -49,6 +53,16 @@ object RepositoryModule {
fun provideTodoRepository(todoRepositoryImpl: TodoRepositoryImpl): TodoRepository =
todoRepositoryImpl

@Provides
@Singleton
fun providesDashBoardRepository(dashBoardRepositoryImpl: DashBoardRepositoryImpl): DashBoardRepository =
dashBoardRepositoryImpl

@Provides
@Singleton
fun provideEnterTripRepository(entertripRepositoryImpl: EnterTripRepositoryImpl): EnterTripRepository =
entertripRepositoryImpl

@Provides
@Singleton
fun provideTendencyRepository(tendencyRepositoryImpl: TendencyRepositoryImpl): TendencyRepository =
Expand Down
13 changes: 12 additions & 1 deletion app/src/main/java/com/going/doorip/di/ServiceModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.going.doorip.di

import android.provider.ContactsContract.Profile
import com.going.data.service.AuthService
import com.going.data.service.DashBoardService
import com.going.data.service.EnterTripService
import com.going.data.service.MockService
import com.going.data.service.ProfileService
import com.going.data.service.SettingService
Expand Down Expand Up @@ -38,6 +40,16 @@ object ServiceModule {
fun provideTodoService(retrofit: Retrofit): TodoService =
retrofit.create(TodoService::class.java)

@Provides
@Singleton
fun provideDashBoardService(retrofit: Retrofit): DashBoardService =
retrofit.create(DashBoardService::class.java)

@Provides
@Singleton
fun provideEnterTripService(retrofit: Retrofit): EnterTripService =
retrofit.create(EnterTripService::class.java)

@Provides
@Singleton
fun provideTendencyService(retrofit: Retrofit): TendencyService =
Expand All @@ -47,5 +59,4 @@ object ServiceModule {
@Singleton
fun provideProfileService(retrofit: Retrofit): ProfileService =
retrofit.create(ProfileService::class.java)

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.going.ui.extension

enum class EnumUiState {
SUCCESS, FAILURE, LOADING, EMPTY
LOADING, SUCCESS, FAILURE, EMPTY
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.going.data.datasource

import com.going.data.dto.BaseResponse
import com.going.data.dto.response.DashBoardResponseDto

interface DashBoardDataSource {

suspend fun getTripList(
progress: String
): BaseResponse<DashBoardResponseDto>

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.going.data.datasource;

import com.going.data.dto.BaseResponse
import com.going.data.dto.request.EnterTripRequestDto
import com.going.data.dto.response.EnterTripResponseDto
import retrofit2.http.Body

interface EnterTripDataSource {
suspend fun postEnterTrip(
@Body request: EnterTripRequestDto,
): BaseResponse<EnterTripResponseDto>
}
29 changes: 28 additions & 1 deletion data/src/main/java/com/going/data/datasource/TodoDataSource.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
package com.going.data.datasource

import com.going.data.dto.BaseResponse
import com.going.data.dto.NonDataBaseResponse
import com.going.data.dto.request.TodoCreateRequestDto
import com.going.data.dto.response.MyTripInfoResponseDto
import com.going.data.dto.response.OurTripInfoResponseDto
import com.going.data.dto.response.TodoDetailResponseDto
import com.going.data.dto.response.TodoResponseDto

interface TodoDataSource {

suspend fun getTodoListData(
tripId: Long,
category: String,
progress: String,
progress: String
): BaseResponse<List<TodoResponseDto>>

suspend fun postToCreateTodoData(
tripId: Long,
request: TodoCreateRequestDto
): NonDataBaseResponse

suspend fun deleteTodoData(
todoId: Long
): NonDataBaseResponse

suspend fun getTodoDetailData(
todoId: Long
): BaseResponse<TodoDetailResponseDto>

suspend fun getMyTripInfo(
tripId: Long
): BaseResponse<MyTripInfoResponseDto>

suspend fun getOurTripInfo(
tripId: Long
): BaseResponse<OurTripInfoResponseDto>

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.going.data.datasourceImpl

import com.going.data.datasource.DashBoardDataSource
import com.going.data.dto.BaseResponse
import com.going.data.dto.response.DashBoardResponseDto
import com.going.data.service.DashBoardService
import javax.inject.Inject

class DashBoardDataSourceImpl @Inject constructor(
private val dashBoardService: DashBoardService
) : DashBoardDataSource {

override suspend fun getTripList(progress: String): BaseResponse<DashBoardResponseDto> =
dashBoardService.getTripList(progress)

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.going.data.datasourceImpl

import com.going.data.datasource.EnterTripDataSource
import com.going.data.dto.BaseResponse
import com.going.data.dto.request.EnterTripRequestDto
import com.going.data.dto.response.EnterTripResponseDto
import com.going.data.service.EnterTripService
import javax.inject.Inject

class EnterTripDataSourceImpl @Inject constructor(
private val enterTripService: EnterTripService,
) : EnterTripDataSource {
override suspend fun postEnterTrip(
code: EnterTripRequestDto
): BaseResponse<EnterTripResponseDto> =
enterTripService.postEnterTrip(code)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ package com.going.data.datasourceImpl

import com.going.data.datasource.TodoDataSource
import com.going.data.dto.BaseResponse
import com.going.data.dto.NonDataBaseResponse
import com.going.data.dto.request.TodoCreateRequestDto
import com.going.data.dto.response.MyTripInfoResponseDto
import com.going.data.dto.response.OurTripInfoResponseDto
import com.going.data.dto.response.TodoDetailResponseDto
import com.going.data.dto.response.TodoResponseDto
import com.going.data.service.TodoService
import javax.inject.Inject
Expand All @@ -17,4 +22,30 @@ class TodoDataSourceImpl @Inject constructor(
): BaseResponse<List<TodoResponseDto>> =
todoService.getTodoList(tripId, category, progress)

}
override suspend fun postToCreateTodoData(
tripId: Long,
request: TodoCreateRequestDto
): NonDataBaseResponse =
todoService.postToCreateTodo(tripId, request)

override suspend fun deleteTodoData(
todoId: Long
): NonDataBaseResponse =
todoService.deleteTodo(todoId)

override suspend fun getTodoDetailData(
todoId: Long
): BaseResponse<TodoDetailResponseDto> =
todoService.getTodoDetail(todoId)

override suspend fun getMyTripInfo(
tripId: Long
): BaseResponse<MyTripInfoResponseDto> =
todoService.getMyTripInfo(tripId)

override suspend fun getOurTripInfo(
tripId: Long
): BaseResponse<OurTripInfoResponseDto> =
todoService.getOurTripInfo(tripId)

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.going.data.dto.request

import com.going.domain.entity.request.EnterTripRequestModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class EnterTripRequestDto(
@SerialName("code")
val code: String,
)

fun EnterTripRequestModel.toEnterTripRequestDto(): EnterTripRequestDto =
EnterTripRequestDto(code)

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.going.data.dto.request

import com.going.domain.entity.request.TodoCreateRequestModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class TodoCreateRequestDto(
@SerialName("title")
val title: String,
@SerialName("endDate")
val endDate: String,
@SerialName("allocators")
val allocators: List<Long>,
@SerialName("memo")
val memo: String?,
@SerialName("secret")
val secret: Boolean
)

fun TodoCreateRequestModel.toTodoCreateRequestDto(): TodoCreateRequestDto =
TodoCreateRequestDto(title, endDate, allocators, memo, secret)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.going.data.dto.response

import com.going.domain.entity.response.DashBoardModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class DashBoardResponseDto(
@SerialName("name")
val name: String,
@SerialName("trips")
val trips: List<TripsResponseDto>

) {
@Serializable
data class TripsResponseDto(
@SerialName("tripId")
val tripId: Long,
@SerialName("title")
val title: String,
@SerialName("startDate")
val startDate: String,
@SerialName("endDate")
val endDate: String,
@SerialName("day")
val day: Int
) {
fun toTripsModel() =
DashBoardModel.DashBoardTripModel(tripId, title, startDate, endDate, day)
}

fun toDashBoardModel() =
DashBoardModel(name, trips.map {
it.toTripsModel()
})
}

Loading

0 comments on commit 8bcda27

Please sign in to comment.