-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT/#94] 필터링 뷰 / 서버통신 구현 #100
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
76a2ed0
[FEAT/#94] Filtering state, side effect
leeeyubin 7e3eea6
[FEAT/#94] navigate with data class args
leeeyubin fdc433c
[FEAT/#94] navigate with data class args
leeeyubin 3b86518
[MOVE/#94] move and add Filtering file
leeeyubin d626b1d
[CHORE/#94] 코드 수정
leeeyubin b98b083
[CHORE/#88] 로그인, 회원가입 파라미터 수정
leeeyubin 4776e78
[FEAT/#94] solving conflict
leeeyubin 5fe1bc9
[FEAT/#94] 필터링 서버통신 로직 구현
leeeyubin 1381a74
[FEAT/#94] 네비게이션 수정
leeeyubin cc32f7e
[FEAT/#94] 전체 연결 구현
leeeyubin 16f7003
[FEAT/#94] 필요 없는 코드 삭제
leeeyubin daa52d2
[FEAT/#94] solving conflict
leeeyubin 81257c4
[DEL/#94] delete Log
leeeyubin 68059c3
[FIX/#94] solving conflict
leeeyubin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 사용 안하는거면 지워주세요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TEMP_TOKEN
이라는 변수에 액세스 토큰 넣을 수 있도록 임시 주석처리 해놓은 거에요!! 저기에 넣고 쓰시면 됩니당