-
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: 데이터 패키지 설정 #13 #35
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
72510a6
build: 서버 base url의 local.properties 사용 설정 및 BuildConfig 설정
Junyoung-WON 63dc806
feat: Retrofit Client 작성
Junyoung-WON 46ebf41
fix: Merge Conflict 해결
Junyoung-WON 57e4d85
feat: DTO 클래스 작성
Junyoung-WON 6a2e17a
style: ktlint check
Junyoung-WON fa9b39f
feat: SerialName 어노테이션의 값을 camelCase로 수정
Junyoung-WON ad3d9d6
refactor: DTO 클래스의 이름 수정
Junyoung-WON 95a2ee0
feat: 누락된 Dto 클래스 추가
Junyoung-WON 6b865ea
style: ktlint check
Junyoung-WON a5c7d84
Merge branch 'develop-an' into feature/#13_set_up_data_package
hxeyexn 88a60c4
Merge branch 'develop-an' into feature/#13_set_up_data_package
hxeyexn cbb2554
Merge branch 'develop-an' into feature/#13_set_up_data_package
hxeyexn 3978f1d
Merge branch 'develop-an' into feature/#13_set_up_data_package
hxeyexn 5e94bbd
Merge branch 'develop-an' into feature/#13_set_up_data_package
Junyoung-WON 0d01688
fix: const 키워드 제거
Junyoung-WON 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
38 changes: 38 additions & 0 deletions
38
android/Staccato_AN/app/src/main/java/com/woowacourse/staccato/data/StaccatoClient.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,38 @@ | ||
package com.woowacourse.staccato.data | ||
|
||
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory | ||
import com.woowacourse.staccato.BuildConfig | ||
import kotlinx.serialization.json.Json | ||
import okhttp3.MediaType.Companion.toMediaType | ||
import okhttp3.OkHttpClient | ||
import okhttp3.logging.HttpLoggingInterceptor | ||
import retrofit2.Retrofit | ||
|
||
object StaccatoClient { | ||
private val BASE_URL = BuildConfig.BASE_URL | ||
|
||
private val provideLoggingInterceptor = | ||
HttpLoggingInterceptor().apply { | ||
level = HttpLoggingInterceptor.Level.BODY | ||
} | ||
|
||
private val provideHttpClient = | ||
OkHttpClient.Builder() | ||
.addInterceptor(provideLoggingInterceptor) | ||
.build() | ||
|
||
private val jsonBuilder = Json { coerceInputValues = true } | ||
|
||
private val provideRetrofit = | ||
Retrofit.Builder() | ||
.baseUrl(BASE_URL) | ||
.client(provideHttpClient) | ||
.addConverterFactory( | ||
jsonBuilder.asConverterFactory("application/json".toMediaType()), | ||
) | ||
.build() | ||
|
||
fun <T> create(service: Class<T>): T { | ||
return provideRetrofit.create(service) | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
android/Staccato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/MemberDto.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,11 @@ | ||
package com.woowacourse.staccato.data.dto | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class MemberDto( | ||
@SerialName("memberId") val memberId: Long, | ||
@SerialName("nickName") val nickName: String, | ||
@SerialName("memberImage") val memberImage: String, | ||
) |
10 changes: 10 additions & 0 deletions
10
...cato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/timeline/TimelineMemberDto.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.woowacourse.staccato.data.dto.timeline | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TimelineMemberDto( | ||
@SerialName("memberId") val memberId: Long, | ||
@SerialName("memberImage") val memberImage: String, | ||
) |
9 changes: 9 additions & 0 deletions
9
...ccato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/timeline/TimelineResponse.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,9 @@ | ||
package com.woowacourse.staccato.data.dto.timeline | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TimelineResponse( | ||
@SerialName("travels") val travels: List<TimelineTravelDto>, | ||
) |
14 changes: 14 additions & 0 deletions
14
...cato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/timeline/TimelineTravelDto.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,14 @@ | ||
package com.woowacourse.staccato.data.dto.timeline | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TimelineTravelDto( | ||
@SerialName("travelId") val travelId: Long, | ||
@SerialName("travelTitle") val travelTitle: String, | ||
@SerialName("travelThumbnail") val travelThumbnail: String, | ||
@SerialName("startAt") val startAt: String, | ||
@SerialName("endAt") val endAt: String, | ||
@SerialName("mates") val mates: List<TimelineMemberDto>, | ||
) |
13 changes: 13 additions & 0 deletions
13
...d/Staccato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/travel/TravelRequest.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.woowacourse.staccato.data.dto.travel | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TravelRequest( | ||
@SerialName("travelThumbnail") val travelThumbnail: String? = null, | ||
@SerialName("travelTitle") val travelTitle: String, | ||
@SerialName("description") val description: String? = null, | ||
@SerialName("startAt") val startAt: String, | ||
@SerialName("endAt") val endAt: String, | ||
) |
17 changes: 17 additions & 0 deletions
17
.../Staccato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/travel/TravelResponse.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.woowacourse.staccato.data.dto.travel | ||
|
||
import com.woowacourse.staccato.data.dto.MemberDto | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TravelResponse( | ||
@SerialName("travelId") val travelId: Long, | ||
@SerialName("travelThumbnail") val travelThumbnail: String, | ||
@SerialName("travelTitle") val travelTitle: String, | ||
@SerialName("startAt") val startAt: String, | ||
@SerialName("endAt") val endAt: String, | ||
@SerialName("description") val description: String, | ||
@SerialName("mates") val mates: List<MemberDto>, | ||
@SerialName("visits") val visits: List<TravelVisitDto>, | ||
) |
12 changes: 12 additions & 0 deletions
12
.../Staccato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/travel/TravelVisitDto.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.woowacourse.staccato.data.dto.travel | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TravelVisitDto( | ||
@SerialName("visitId") val visitId: Long, | ||
@SerialName("placeName") val placeName: String, | ||
@SerialName("visitImage") val visitImage: String, | ||
@SerialName("visitedAt") val visitedAt: String, | ||
) |
12 changes: 12 additions & 0 deletions
12
...cato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/visit/VisitCreationRequest.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.woowacourse.staccato.data.dto.visit | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class VisitCreationRequest( | ||
@SerialName("pinId") val pinId: Long, | ||
@SerialName("visitedImages") val visitedImages: List<String>, | ||
@SerialName("visitedAt") val visitedAt: String, | ||
@SerialName("travelId") val travelId: Long, | ||
) |
13 changes: 13 additions & 0 deletions
13
android/Staccato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/visit/VisitLogDto.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.woowacourse.staccato.data.dto.visit | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class VisitLogDto( | ||
@SerialName("visitLogId") val visitLogId: Long, | ||
@SerialName("memberId") val memberId: Long, | ||
@SerialName("nickName") val nickName: String, | ||
@SerialName("memberImage") val memberImage: String, | ||
@SerialName("content") val content: String, | ||
) |
15 changes: 15 additions & 0 deletions
15
...id/Staccato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/visit/VisitResponse.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.woowacourse.staccato.data.dto.visit | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class VisitResponse( | ||
@SerialName("visitId") val visitId: Long, | ||
@SerialName("placeName") val placeName: String, | ||
@SerialName("visitedImages") val visitedImages: List<String>, | ||
@SerialName("address") val address: String, | ||
@SerialName("visitedAt") val visitedAt: String, | ||
@SerialName("visitedCount") val visitedCount: Long, | ||
@SerialName("visitLogs") val visitLogs: List<VisitLogDto>, | ||
) |
10 changes: 10 additions & 0 deletions
10
...accato_AN/app/src/main/java/com/woowacourse/staccato/data/dto/visit/VisitUpdateRequest.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.woowacourse.staccato.data.dto.visit | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class VisitUpdateRequest( | ||
@SerialName("visitedImages") val visitedImages: List<String>, | ||
@SerialName("visitedAt") val visitedAt: String, | ||
) |
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.
dto를 미리 다 만들어주셔서 편하게 잘 쓸 것 같아요!! 감사합니다~