-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from THT-Team/feature/TOP-94_my_page
TOP-94 마이페이지
- Loading branch information
Showing
43 changed files
with
1,383 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,6 @@ fun ThtToolbar( | |
) | ||
} | ||
} | ||
Spacer(modifier = Modifier.width(16.dp)) | ||
content() | ||
} | ||
} | ||
|
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
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
7 changes: 7 additions & 0 deletions
7
data/src/main/java/com/tht/tht/data/remote/datasource/setting/UserSettingDataSource.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,7 @@ | ||
package com.tht.tht.data.remote.datasource.setting | ||
|
||
import com.tht.tht.data.remote.response.setting.MyPageUserInfoResponse | ||
|
||
interface UserSettingDataSource { | ||
suspend fun fetchMyPageUserInfo(): MyPageUserInfoResponse | ||
} |
15 changes: 15 additions & 0 deletions
15
data/src/main/java/com/tht/tht/data/remote/datasource/setting/UserSettingDataSourceImpl.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.tht.tht.data.remote.datasource.setting | ||
|
||
import com.tht.tht.data.remote.mapper.toUnwrap | ||
import com.tht.tht.data.remote.response.setting.MyPageUserInfoResponse | ||
import com.tht.tht.data.remote.service.setting.MyPageUserInfoService | ||
import javax.inject.Inject | ||
|
||
class UserSettingDataSourceImpl @Inject constructor( | ||
private val service: MyPageUserInfoService | ||
) : UserSettingDataSource { | ||
|
||
override suspend fun fetchMyPageUserInfo(): MyPageUserInfoResponse { | ||
return service.fetchMyPageUserInfo().toUnwrap() | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
data/src/main/java/com/tht/tht/data/remote/mapper/MyPageUserSettingMapper.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,45 @@ | ||
package com.tht.tht.data.remote.mapper | ||
|
||
import com.tht.tht.data.remote.response.setting.MyPageUserInfoResponse | ||
import com.tht.tht.domain.setting.model.MyPageUserInfoModel | ||
|
||
fun MyPageUserInfoResponse.toModel(): MyPageUserInfoModel { | ||
return MyPageUserInfoModel( | ||
userUuid = userUuid, | ||
username = username, | ||
birth = "UnKnown", | ||
gender = gender, | ||
introduction = introduction, | ||
preferredGender = preferGender, | ||
height = tall, | ||
smoke = smoking, | ||
drink = drinking, | ||
religion = religion, | ||
userProfilePhotos = userProfilePhotos.map { it.toModel() }, | ||
idealTypeList = idealTypeList.map { it.toModel() }, | ||
interestsList = interestsList.map { it.toModel() } | ||
) | ||
} | ||
|
||
fun MyPageUserInfoResponse.IdealType.toModel(): MyPageUserInfoModel.IdealType { | ||
return MyPageUserInfoModel.IdealType( | ||
emojiCode = emojiCode, | ||
idx = idx, | ||
name = name | ||
) | ||
} | ||
|
||
fun MyPageUserInfoResponse.Interests.toModel(): MyPageUserInfoModel.Interests { | ||
return MyPageUserInfoModel.Interests( | ||
emojiCode = emojiCode, | ||
idx = idx, | ||
name = name | ||
) | ||
} | ||
|
||
fun MyPageUserInfoResponse.UserProfilePhoto.toModel(): MyPageUserInfoModel.UserProfilePhoto { | ||
return MyPageUserInfoModel.UserProfilePhoto( | ||
priority = priority, | ||
url = url | ||
) | ||
} |
63 changes: 63 additions & 0 deletions
63
data/src/main/java/com/tht/tht/data/remote/response/setting/MyPageUserInfoResponse.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,63 @@ | ||
package com.tht.tht.data.remote.response.setting | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class MyPageUserInfoResponse( | ||
@SerializedName("address") | ||
val address: String, | ||
@SerializedName("age") | ||
val age: Int, | ||
@SerializedName("drinking") | ||
val drinking: String, | ||
@SerializedName("email") | ||
val email: String, | ||
@SerializedName("gender") | ||
val gender: String, | ||
@SerializedName("idealTypeList") | ||
val idealTypeList: List<IdealType>, | ||
@SerializedName("interestsList") | ||
val interestsList: List<Interests>, | ||
@SerializedName("introduction") | ||
val introduction: String, | ||
@SerializedName("phoneNumber") | ||
val phoneNumber: String, | ||
@SerializedName("prefer_gender") | ||
val preferGender: String, | ||
@SerializedName("religion") | ||
val religion: String, | ||
@SerializedName("smoking") | ||
val smoking: String, | ||
@SerializedName("tall") | ||
val tall: Int, | ||
@SerializedName("userProfilePhotos") | ||
val userProfilePhotos: List<UserProfilePhoto>, | ||
@SerializedName("userUuid") | ||
val userUuid: String, | ||
@SerializedName("username") | ||
val username: String | ||
) { | ||
data class IdealType( | ||
@SerializedName("emojiCode") | ||
val emojiCode: String, | ||
@SerializedName("idx") | ||
val idx: Int, | ||
@SerializedName("name") | ||
val name: String | ||
) | ||
|
||
data class Interests( | ||
@SerializedName("emojiCode") | ||
val emojiCode: String, | ||
@SerializedName("idx") | ||
val idx: Int, | ||
@SerializedName("name") | ||
val name: String | ||
) | ||
|
||
data class UserProfilePhoto( | ||
@SerializedName("priority") | ||
val priority: Int, | ||
@SerializedName("url") | ||
val url: String | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
data/src/main/java/com/tht/tht/data/remote/service/setting/MyPageUserInfoService.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.tht.tht.data.remote.service.setting | ||
|
||
import com.tht.tht.data.constant.THTApiConstant | ||
import com.tht.tht.data.remote.response.base.ThtResponse | ||
import com.tht.tht.data.remote.response.setting.MyPageUserInfoResponse | ||
import retrofit2.http.GET | ||
|
||
interface MyPageUserInfoService { | ||
@GET(THTApiConstant.Setting.MY_PAGE) | ||
suspend fun fetchMyPageUserInfo(): ThtResponse<MyPageUserInfoResponse> | ||
} |
Oops, something went wrong.