Skip to content

Commit 3e2a457

Browse files
authored
Merge pull request #580 from Team-WSS/feat/578
feat: 약관동의 api 연결
2 parents 57396ea + 9ffa193 commit 3e2a457

10 files changed

Lines changed: 465 additions & 295 deletions

File tree

app/src/main/java/com/into/websoso/data/mapper/UserMapper.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.into.websoso.data.model.GenrePreferenceEntity
66
import com.into.websoso.data.model.MyProfileEntity
77
import com.into.websoso.data.model.NovelPreferenceEntity
88
import com.into.websoso.data.model.OtherUserProfileEntity
9+
import com.into.websoso.data.model.TermsAgreementEntity
910
import com.into.websoso.data.model.UserFeedsEntity
1011
import com.into.websoso.data.model.UserFeedsEntity.UserFeedEntity
1112
import com.into.websoso.data.model.UserInfoDetailEntity
@@ -19,6 +20,7 @@ import com.into.websoso.data.remote.response.GenrePreferenceResponseDto
1920
import com.into.websoso.data.remote.response.MyProfileResponseDto
2021
import com.into.websoso.data.remote.response.NovelPreferenceResponseDto
2122
import com.into.websoso.data.remote.response.OtherUserProfileResponseDto
23+
import com.into.websoso.data.remote.response.TermsAgreementResponseDto
2224
import com.into.websoso.data.remote.response.UserFeedsResponseDto
2325
import com.into.websoso.data.remote.response.UserFeedsResponseDto.UserFeedResponseDto
2426
import com.into.websoso.data.remote.response.UserInfoDetailResponseDto
@@ -156,4 +158,12 @@ fun UserFeedResponseDto.toData(): UserFeedEntity {
156158
novelRating = this.novelRating,
157159
relevantCategories = this.relevantCategories,
158160
)
159-
}
161+
}
162+
163+
fun TermsAgreementResponseDto.toData(): TermsAgreementEntity {
164+
return TermsAgreementEntity(
165+
serviceAgreed = this.serviceAgreed,
166+
privacyAgreed = this.privacyAgreed,
167+
marketingAgreed = this.marketingAgreed,
168+
)
169+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.into.websoso.data.model
2+
3+
data class TermsAgreementEntity(
4+
val serviceAgreed: Boolean,
5+
val privacyAgreed: Boolean,
6+
val marketingAgreed: Boolean,
7+
)

app/src/main/java/com/into/websoso/data/remote/api/UserApi.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.into.websoso.data.remote.api
22

3+
import com.into.websoso.data.remote.request.TermsAgreementRequestDto
34
import com.into.websoso.data.remote.request.UserInfoRequestDto
45
import com.into.websoso.data.remote.request.UserProfileEditRequestDto
56
import com.into.websoso.data.remote.request.UserProfileStatusRequestDto
@@ -8,6 +9,7 @@ import com.into.websoso.data.remote.response.GenrePreferenceResponseDto
89
import com.into.websoso.data.remote.response.MyProfileResponseDto
910
import com.into.websoso.data.remote.response.NovelPreferenceResponseDto
1011
import com.into.websoso.data.remote.response.OtherUserProfileResponseDto
12+
import com.into.websoso.data.remote.response.TermsAgreementResponseDto
1113
import com.into.websoso.data.remote.response.UserFeedsResponseDto
1214
import com.into.websoso.data.remote.response.UserInfoDetailResponseDto
1315
import com.into.websoso.data.remote.response.UserInfoResponseDto
@@ -106,4 +108,12 @@ interface UserApi {
106108
@Query("lastFeedId") lastFeedId: Long,
107109
@Query("size") size: Int,
108110
): UserFeedsResponseDto
111+
112+
@PATCH("users/terms-settings")
113+
suspend fun patchTermsAgreement(
114+
@Body termsAgreementRequestDto: TermsAgreementRequestDto,
115+
)
116+
117+
@GET("users/terms-settings")
118+
suspend fun getTermsAgreement(): TermsAgreementResponseDto
109119
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.into.websoso.data.remote.request
2+
3+
import kotlinx.serialization.SerialName
4+
import kotlinx.serialization.Serializable
5+
6+
@Serializable
7+
data class TermsAgreementRequestDto(
8+
@SerialName("serviceAgreed")
9+
val serviceAgreed: Boolean,
10+
@SerialName("privacyAgreed")
11+
val privacyAgreed: Boolean,
12+
@SerialName("marketingAgreed")
13+
val marketingAgreed: Boolean,
14+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.into.websoso.data.remote.response
2+
3+
import kotlinx.serialization.SerialName
4+
import kotlinx.serialization.Serializable
5+
6+
@Serializable
7+
data class TermsAgreementResponseDto(
8+
@SerialName("serviceAgreed")
9+
val serviceAgreed: Boolean,
10+
@SerialName("privacyAgreed")
11+
val privacyAgreed: Boolean,
12+
@SerialName("marketingAgreed")
13+
val marketingAgreed: Boolean,
14+
)

0 commit comments

Comments
 (0)