-
Notifications
You must be signed in to change notification settings - Fork 2
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/#96] 여행 생성 뷰 / 서버 통신 구현 #108
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
79f6516
[DEL/#96] 불필요한 파일 삭제
leeeyubin dc234b9
[FEAT/#96] 여행 생성 서버통신
leeeyubin b51536a
[FEAT/#96] 여행 생성 서버통신 구현
leeeyubin 12d14c2
Merge branch 'develop' of https://github.com/Team-Going/Going-Android…
leeeyubin 15aef1f
[FEAT/#96] 여행 생성 서버통신 구현
leeeyubin 7356d67
[FEAT/#96] 화면 연결
leeeyubin ebf2824
[FIX/#96] 코드 최적화
leeeyubin d2c8ce2
[FIX/#96] 컨플릭 수정
leeeyubin b39d305
[FIX/#96] 컨플릭 수정
leeeyubin b6f079b
[FEAT/#96] 액티비티 연결
leeeyubin 3fb0746
[FIX/#96] 코드리뷰 반영
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,4 +157,4 @@ | |
|
||
</application> | ||
|
||
</manifest> | ||
</manifest> |
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
13 changes: 13 additions & 0 deletions
13
data/src/main/java/com/going/data/datasource/EnterPreferenceDataSource.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,13 @@ | ||
package com.going.data.datasource | ||
|
||
import com.going.data.dto.BaseResponse | ||
import com.going.data.dto.request.EnterPreferenceRequestDto | ||
import com.going.data.dto.response.EnterPreferenceResponseDto | ||
import retrofit2.http.Body | ||
|
||
interface EnterPreferenceDataSource { | ||
suspend fun postTripInfo( | ||
@Body request: EnterPreferenceRequestDto | ||
): BaseResponse<EnterPreferenceResponseDto> | ||
|
||
} |
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
19 changes: 19 additions & 0 deletions
19
data/src/main/java/com/going/data/datasourceImpl/EnterPreferenceDataSourceImpl.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,19 @@ | ||
package com.going.data.datasourceImpl | ||
|
||
import com.going.data.datasource.EnterPreferenceDataSource | ||
import com.going.data.dto.BaseResponse | ||
import com.going.data.dto.request.EnterPreferenceRequestDto | ||
import com.going.data.dto.response.EnterPreferenceResponseDto | ||
import com.going.data.service.EnterPreferenceService | ||
import javax.inject.Inject | ||
|
||
class EnterPreferenceDataSourceImpl @Inject constructor( | ||
private val enterPreferenceService: EnterPreferenceService | ||
) : EnterPreferenceDataSource { | ||
|
||
override suspend fun postTripInfo( | ||
request: EnterPreferenceRequestDto | ||
): BaseResponse<EnterPreferenceResponseDto> = | ||
enterPreferenceService.postTripInfoFromServer(request) | ||
|
||
} |
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
28 changes: 28 additions & 0 deletions
28
data/src/main/java/com/going/data/dto/request/EnterPreferenceRequestDto.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,28 @@ | ||
package com.going.data.dto.request | ||
|
||
import com.going.domain.entity.request.EnterPreferenceRequestModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class EnterPreferenceRequestDto( | ||
@SerialName("title") | ||
val title: String, | ||
@SerialName("startDate") | ||
val startDate: String, | ||
@SerialName("endDate") | ||
val endDate: String, | ||
@SerialName("styleA") | ||
val styleA: Int, | ||
@SerialName("styleB") | ||
val styleB: Int, | ||
@SerialName("styleC") | ||
val styleC: Int, | ||
@SerialName("styleD") | ||
val styleD: Int, | ||
@SerialName("styleE") | ||
val styleE: Int | ||
) | ||
|
||
fun EnterPreferenceRequestModel.toEnterPreferenceRequestDto(): EnterPreferenceRequestDto = | ||
EnterPreferenceRequestDto(title, startDate, endDate, styleA, styleB, styleC, styleD, styleE) |
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
24 changes: 24 additions & 0 deletions
24
data/src/main/java/com/going/data/dto/response/EnterPreferenceResponseDto.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,24 @@ | ||
package com.going.data.dto.response | ||
|
||
import com.going.domain.entity.response.EnterPreferenceModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class EnterPreferenceResponseDto( | ||
@SerialName("tripId") | ||
val tripId: Long, | ||
@SerialName("title") | ||
val title: String, | ||
@SerialName("startDate") | ||
val startDate: String, | ||
@SerialName("endDate") | ||
val endDate: String, | ||
@SerialName("code") | ||
val code: String, | ||
@SerialName("day") | ||
val day: Int, | ||
) { | ||
fun toEnterPreferenceModel() = | ||
EnterPreferenceModel(tripId, title, startDate, endDate, code, day) | ||
} |
23 changes: 23 additions & 0 deletions
23
data/src/main/java/com/going/data/repositoryImpl/EnterPreferenceRepositoryImpl.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,23 @@ | ||
package com.going.data.repositoryImpl | ||
|
||
import com.going.data.datasource.EnterPreferenceDataSource | ||
import com.going.data.dto.request.toEnterPreferenceRequestDto | ||
import com.going.domain.entity.request.EnterPreferenceRequestModel | ||
import com.going.domain.entity.response.EnterPreferenceModel | ||
import com.going.domain.repository.EnterPreferenceRepository | ||
import javax.inject.Inject | ||
|
||
class EnterPreferenceRepositoryImpl @Inject constructor( | ||
private val enterPreferenceDataSource: EnterPreferenceDataSource | ||
) : EnterPreferenceRepository { | ||
|
||
override suspend fun postTripInfo( | ||
request: EnterPreferenceRequestModel | ||
): Result<EnterPreferenceModel> = | ||
runCatching { | ||
enterPreferenceDataSource.postTripInfo( | ||
request.toEnterPreferenceRequestDto(), | ||
).data.toEnterPreferenceModel() | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
data/src/main/java/com/going/data/service/EnterPreferenceService.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,16 @@ | ||
package com.going.data.service | ||
|
||
import com.going.data.dto.BaseResponse | ||
import com.going.data.dto.request.EnterPreferenceRequestDto | ||
import com.going.data.dto.response.EnterPreferenceResponseDto | ||
import retrofit2.http.Body | ||
import retrofit2.http.POST | ||
|
||
interface EnterPreferenceService { | ||
|
||
@POST("api/trips") | ||
suspend fun postTripInfoFromServer( | ||
@Body request: EnterPreferenceRequestDto, | ||
): BaseResponse<EnterPreferenceResponseDto> | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
domain/src/main/kotlin/com/going/domain/entity/request/EnterPreferenceRequestModel.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,12 @@ | ||
package com.going.domain.entity.request | ||
|
||
data class EnterPreferenceRequestModel( | ||
val title: String, | ||
val startDate: String, | ||
val endDate: String, | ||
val styleA: Int, | ||
val styleB: Int, | ||
val styleC: Int, | ||
val styleD: Int, | ||
val styleE: Int | ||
) |
10 changes: 10 additions & 0 deletions
10
domain/src/main/kotlin/com/going/domain/entity/response/EnterPreferenceModel.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.going.domain.entity.response | ||
|
||
data class EnterPreferenceModel( | ||
val tripId: Long, | ||
val title: String, | ||
val startDate: String, | ||
val endDate: String, | ||
val code: String, | ||
val day: Int | ||
) |
12 changes: 12 additions & 0 deletions
12
domain/src/main/kotlin/com/going/domain/repository/EnterPreferenceRepository.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,12 @@ | ||
package com.going.domain.repository | ||
|
||
import com.going.domain.entity.request.EnterPreferenceRequestModel | ||
import com.going.domain.entity.response.EnterPreferenceModel | ||
|
||
interface EnterPreferenceRepository { | ||
|
||
suspend fun postTripInfo( | ||
request: EnterPreferenceRequestModel | ||
): Result<EnterPreferenceModel> | ||
|
||
} |
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
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.
컨s 부탁tv해욥