-
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.
[FEAT/#94] νν°λ§ λ·° / μλ²ν΅μ ꡬν
- Loading branch information
Showing
36 changed files
with
395 additions
and
106 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
8 changes: 8 additions & 0 deletions
8
data/src/main/java/com/terning/data/datasource/FilteringDataSource.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.terning.data.datasource | ||
|
||
import com.terning.data.dto.NonDataBaseResponse | ||
import com.terning.data.dto.request.FilteringRequestDto | ||
|
||
interface FilteringDataSource { | ||
suspend fun postFiltering(userId: Long, request: FilteringRequestDto): NonDataBaseResponse | ||
} |
17 changes: 17 additions & 0 deletions
17
data/src/main/java/com/terning/data/datasourceimpl/FilteringDataSourceImpl.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,17 @@ | ||
package com.terning.data.datasourceimpl | ||
|
||
import com.terning.data.datasource.FilteringDataSource | ||
import com.terning.data.dto.NonDataBaseResponse | ||
import com.terning.data.dto.request.FilteringRequestDto | ||
import com.terning.data.service.FilteringService | ||
import javax.inject.Inject | ||
|
||
class FilteringDataSourceImpl @Inject constructor( | ||
private val filteringService: FilteringService | ||
) : FilteringDataSource { | ||
override suspend fun postFiltering( | ||
userId: Long, | ||
request: FilteringRequestDto | ||
): NonDataBaseResponse = | ||
filteringService.postFilteringService(userId, request) | ||
} |
25 changes: 25 additions & 0 deletions
25
data/src/main/java/com/terning/data/dto/request/FilteringRequestDto.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,25 @@ | ||
package com.terning.data.dto.request | ||
|
||
import com.terning.domain.entity.request.FilteringRequestModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class FilteringRequestDto( | ||
@SerialName("grade") | ||
val grade: Int, | ||
@SerialName("workingPeriod") | ||
val workingPeriod: Int, | ||
@SerialName("startYear") | ||
val startYear: Int, | ||
@SerialName("startMonth") | ||
val startMonth: Int | ||
) | ||
|
||
fun FilteringRequestModel.toFilteringRequestDto(): FilteringRequestDto = | ||
FilteringRequestDto( | ||
grade = grade, | ||
workingPeriod = workingPeriod, | ||
startYear = startYear, | ||
startMonth = startMonth | ||
) |
22 changes: 22 additions & 0 deletions
22
data/src/main/java/com/terning/data/repositoryimpl/FilteringRepositoryImpl.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.terning.data.repositoryimpl | ||
|
||
import com.terning.data.datasource.FilteringDataSource | ||
import com.terning.data.dto.request.toFilteringRequestDto | ||
import com.terning.domain.entity.request.FilteringRequestModel | ||
import com.terning.domain.repository.FilteringRepository | ||
import javax.inject.Inject | ||
|
||
class FilteringRepositoryImpl @Inject constructor( | ||
private val filteringDataSource: FilteringDataSource | ||
) : FilteringRepository { | ||
override suspend fun postFiltering( | ||
userId: Long, | ||
request: FilteringRequestModel | ||
): Result<Unit> = | ||
runCatching { | ||
filteringDataSource.postFiltering( | ||
userId, | ||
request.toFilteringRequestDto() | ||
) | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
data/src/main/java/com/terning/data/service/FilteringService.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.terning.data.service | ||
|
||
import com.terning.data.dto.NonDataBaseResponse | ||
import com.terning.data.dto.request.FilteringRequestDto | ||
import retrofit2.http.Body | ||
import retrofit2.http.Header | ||
import retrofit2.http.POST | ||
|
||
interface FilteringService { | ||
@POST("/api/v1/auth/sign-up/filter") | ||
suspend fun postFilteringService( | ||
@Header("User-Id") userId: Long, | ||
@Body request: FilteringRequestDto | ||
): NonDataBaseResponse | ||
} |
8 changes: 8 additions & 0 deletions
8
domain/src/main/java/com/terning/domain/entity/request/FilteringRequestModel.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.terning.domain.entity.request | ||
|
||
data class FilteringRequestModel( | ||
val grade: Int, | ||
val workingPeriod: Int, | ||
val startYear: Int, | ||
val startMonth: Int | ||
) |
10 changes: 10 additions & 0 deletions
10
domain/src/main/java/com/terning/domain/repository/FilteringRepository.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.terning.domain.repository | ||
|
||
import com.terning.domain.entity.request.FilteringRequestModel | ||
|
||
interface FilteringRepository { | ||
suspend fun postFiltering( | ||
userId: Long, | ||
request: FilteringRequestModel | ||
): Result<Unit> | ||
} |
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 |
---|---|---|
|
@@ -9,5 +9,7 @@ interface TokenRepository { | |
|
||
fun setUserId(userId: Long) | ||
|
||
fun getUserId() : Long | ||
|
||
fun clearInfo() | ||
} |
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
feature/src/main/java/com/terning/feature/filtering/filtering/FilteringSideEffect.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.terning.feature.filtering.filtering | ||
|
||
import androidx.annotation.StringRes | ||
|
||
sealed class FilteringSideEffect { | ||
data object NavigateToStartHome : FilteringSideEffect() | ||
data class ShowToast(@StringRes val message: Int) : FilteringSideEffect() | ||
} |
8 changes: 8 additions & 0 deletions
8
feature/src/main/java/com/terning/feature/filtering/filtering/FilteringState.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.terning.feature.filtering.filtering | ||
|
||
data class FilteringState( | ||
val grade: Int = -1, | ||
val workingPeriod: Int = -1, | ||
val startYear: Int = -1, | ||
val startMonth: Int = -1 | ||
) |
Oops, something went wrong.