-
Notifications
You must be signed in to change notification settings - Fork 3
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 #58 from ttoklip/faet/#2_마이페이지_구현
Faet/#2 마이페이지 구현
- Loading branch information
Showing
26 changed files
with
418 additions
and
132 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/umc/ttoklip/data/api/MyAccountRestrictApi.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.umc.ttoklip.data.api | ||
|
||
import com.umc.ttoklip.data.model.ResponseBody | ||
import com.umc.ttoklip.data.model.mypage.RestrictedResponse | ||
import retrofit2.Response | ||
import retrofit2.http.GET | ||
|
||
interface MyAccountRestrictApi { | ||
@GET("/api/v1/my-page/restricted") | ||
suspend fun getRestrictedReason(): Response<ResponseBody<RestrictedResponse>> | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/umc/ttoklip/data/api/MyBlockUserApi.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.umc.ttoklip.data.api | ||
|
||
import com.umc.ttoklip.data.model.ResponseBody | ||
import com.umc.ttoklip.data.model.mypage.MyBlockUserResponse | ||
import retrofit2.Response | ||
import retrofit2.http.DELETE | ||
import retrofit2.http.GET | ||
import retrofit2.http.Path | ||
|
||
interface MyBlockUserApi { | ||
@GET("/api/v1/my-page/blocked") | ||
suspend fun getMyBlockedUser(): Response<ResponseBody<MyBlockUserResponse>> | ||
|
||
@DELETE("/api/v1/my-page/unblock/{targetId}") | ||
suspend fun deleteBlockUser(@Path("targetId") userId: Long): Response<ResponseBody<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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.umc.ttoklip.data.api | ||
|
||
import com.umc.ttoklip.data.model.ResponseBody | ||
import com.umc.ttoklip.data.model.mypage.MyCommunitiesResponse | ||
import com.umc.ttoklip.data.model.mypage.MyHoneyTipsResponse | ||
import com.umc.ttoklip.data.model.mypage.MyQuestionResponse | ||
import com.umc.ttoklip.data.model.mypage.MyTogetherResponse | ||
import retrofit2.Response | ||
import retrofit2.http.GET | ||
|
||
interface MyPostApi { | ||
@GET("/api/v1/my-page/question") | ||
suspend fun getMyQuestions(): Response<ResponseBody<MyQuestionResponse>> | ||
|
||
@GET("/api/v1/my-page/participate-deals") | ||
suspend fun getMyTogethers(): Response<ResponseBody<MyTogetherResponse>> | ||
|
||
@GET("/api/v1/my-page/honeytip") | ||
suspend fun getMyHoneyTips(): Response<ResponseBody<MyHoneyTipsResponse>> | ||
|
||
@GET("/api/v1/my-page/community") | ||
suspend fun getMyCommunications(): Response<ResponseBody<MyCommunitiesResponse>> | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/umc/ttoklip/data/model/mypage/BlockedUser.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,6 @@ | ||
package com.umc.ttoklip.data.model.mypage | ||
|
||
data class BlockedUser( | ||
val reason: String, | ||
val userId: String | ||
) |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/umc/ttoklip/data/model/mypage/Community.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.umc.ttoklip.data.model.mypage | ||
|
||
data class Community( | ||
val content: String, | ||
val questionId: Long, | ||
val title: String | ||
) |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/umc/ttoklip/data/model/mypage/CommunityX.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.umc.ttoklip.data.model.mypage | ||
|
||
data class CommunityX( | ||
val communityId: Long, | ||
val content: String, | ||
val title: String | ||
) |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/umc/ttoklip/data/model/mypage/HoneyTip.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.umc.ttoklip.data.model.mypage | ||
|
||
data class HoneyTip( | ||
val content: String, | ||
val honeyTipId: Long, | ||
val title: String | ||
) |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/umc/ttoklip/data/model/mypage/MyBlockUserResponse.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,5 @@ | ||
package com.umc.ttoklip.data.model.mypage | ||
|
||
data class MyBlockUserResponse( | ||
val blockedUsers: List<BlockedUser> | ||
) |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/umc/ttoklip/data/model/mypage/MyCommunitiesResponse.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.umc.ttoklip.data.model.mypage | ||
|
||
data class MyCommunitiesResponse( | ||
val communities: List<CommunityX>, | ||
val isFirst: Boolean, | ||
val isLast: Boolean, | ||
val totalElements: Int, | ||
val totalPage: Int | ||
) |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/umc/ttoklip/data/model/mypage/MyHoneyTipsResponse.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.umc.ttoklip.data.model.mypage | ||
|
||
data class MyHoneyTipsResponse( | ||
val honeyTips: List<HoneyTip>, | ||
val isFirst: Boolean, | ||
val isLast: Boolean, | ||
val totalElements: Int, | ||
val totalPage: Int | ||
) |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/umc/ttoklip/data/model/mypage/MyQuestionResponse.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.umc.ttoklip.data.model.mypage | ||
|
||
data class MyQuestionResponse( | ||
val communities: List<Community>, | ||
val isFirst: Boolean, | ||
val isLast: Boolean, | ||
val totalElements: Int, | ||
val totalPage: Int | ||
) |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/umc/ttoklip/data/model/mypage/MyTogetherResponse.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,5 @@ | ||
package com.umc.ttoklip.data.model.mypage | ||
|
||
data class MyTogetherResponse( | ||
val participatedDeals: List<ParticipatedDeal> | ||
) |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/umc/ttoklip/data/model/mypage/ParticipatedDeal.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.umc.ttoklip.data.model.mypage | ||
|
||
data class ParticipatedDeal( | ||
val comments: Int, | ||
val dealId: Long, | ||
val description: String, | ||
val participantsCount: Long, | ||
val participationTime: String, | ||
val price: Long, | ||
val seller: String, | ||
val status: String, | ||
val title: String | ||
) |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/umc/ttoklip/data/model/mypage/RestrictedResponse.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.umc.ttoklip.data.model.mypage | ||
|
||
data class RestrictedResponse( | ||
val duration: String, | ||
val reason: String, | ||
val type: String | ||
) |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/umc/ttoklip/data/repository/mypage/MyAccountRestrictRepository.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.umc.ttoklip.data.repository.mypage | ||
|
||
import com.umc.ttoklip.data.model.mypage.RestrictedResponse | ||
import com.umc.ttoklip.module.NetworkResult | ||
|
||
interface MyAccountRestrictRepository { | ||
suspend fun getRestrictedReason(): NetworkResult<RestrictedResponse> | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/umc/ttoklip/data/repository/mypage/MyAccountRestrictRepositoryImpl.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.umc.ttoklip.data.repository.mypage | ||
|
||
import com.umc.ttoklip.data.api.MyAccountRestrictApi | ||
import com.umc.ttoklip.data.model.ResponseBody | ||
import com.umc.ttoklip.data.model.mypage.RestrictedResponse | ||
import com.umc.ttoklip.module.NetworkResult | ||
import com.umc.ttoklip.module.handleApi | ||
import javax.inject.Inject | ||
|
||
class MyAccountRestrictRepositoryImpl @Inject constructor(private val api: MyAccountRestrictApi) : | ||
MyAccountRestrictRepository { | ||
override suspend fun getRestrictedReason(): NetworkResult<RestrictedResponse> { | ||
return handleApi({ api.getRestrictedReason() }) { response: ResponseBody<RestrictedResponse> -> response.result } | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/umc/ttoklip/data/repository/mypage/MyBlockUserRepository.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.umc.ttoklip.data.repository.mypage | ||
|
||
import com.umc.ttoklip.data.model.mypage.MyBlockUserResponse | ||
import com.umc.ttoklip.module.NetworkResult | ||
|
||
interface MyBlockUserRepository { | ||
suspend fun getBlockedUser(): NetworkResult<MyBlockUserResponse> | ||
suspend fun deleteBlockUser(userId: Long): NetworkResult<Unit> | ||
} |
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/umc/ttoklip/data/repository/mypage/MyBlockUserRepositoryImpl.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.umc.ttoklip.data.repository.mypage | ||
|
||
import com.umc.ttoklip.data.api.MyBlockUserApi | ||
import com.umc.ttoklip.data.model.ResponseBody | ||
import com.umc.ttoklip.data.model.mypage.MyBlockUserResponse | ||
import com.umc.ttoklip.module.NetworkResult | ||
import com.umc.ttoklip.module.handleApi | ||
import javax.inject.Inject | ||
|
||
class MyBlockUserRepositoryImpl @Inject constructor(private val api: MyBlockUserApi) : | ||
MyBlockUserRepository { | ||
override suspend fun getBlockedUser(): NetworkResult<MyBlockUserResponse> { | ||
return handleApi({ api.getMyBlockedUser() }) { response: ResponseBody<MyBlockUserResponse> -> response.result } | ||
} | ||
|
||
override suspend fun deleteBlockUser(userId: Long): NetworkResult<Unit> { | ||
return handleApi({ api.deleteBlockUser(userId) }) { response: ResponseBody<Unit> -> response.result } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/umc/ttoklip/data/repository/mypage/MyPostRepository.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.umc.ttoklip.data.repository.mypage | ||
|
||
import com.umc.ttoklip.data.model.mypage.MyCommunitiesResponse | ||
import com.umc.ttoklip.data.model.mypage.MyHoneyTipsResponse | ||
import com.umc.ttoklip.data.model.mypage.MyQuestionResponse | ||
import com.umc.ttoklip.data.model.mypage.MyTogetherResponse | ||
import com.umc.ttoklip.module.NetworkResult | ||
|
||
interface MyPostRepository { | ||
suspend fun getBMyQuestions(): NetworkResult<MyQuestionResponse> | ||
suspend fun getMyTogethers(): NetworkResult<MyTogetherResponse> | ||
suspend fun getMyHoneyTips(): NetworkResult<MyHoneyTipsResponse> | ||
suspend fun getMyCommunications(): NetworkResult<MyCommunitiesResponse> | ||
} |
29 changes: 29 additions & 0 deletions
29
app/src/main/java/com/umc/ttoklip/data/repository/mypage/MyPostRepositoryImpl.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,29 @@ | ||
package com.umc.ttoklip.data.repository.mypage | ||
|
||
import com.umc.ttoklip.data.api.MyPostApi | ||
import com.umc.ttoklip.data.model.ResponseBody | ||
import com.umc.ttoklip.data.model.mypage.MyCommunitiesResponse | ||
import com.umc.ttoklip.data.model.mypage.MyHoneyTipsResponse | ||
import com.umc.ttoklip.data.model.mypage.MyQuestionResponse | ||
import com.umc.ttoklip.data.model.mypage.MyTogetherResponse | ||
import com.umc.ttoklip.module.NetworkResult | ||
import com.umc.ttoklip.module.handleApi | ||
import javax.inject.Inject | ||
|
||
class MyPostRepositoryImpl @Inject constructor(private val api: MyPostApi) : MyPostRepository { | ||
override suspend fun getBMyQuestions(): NetworkResult<MyQuestionResponse> { | ||
return handleApi({ api.getMyQuestions() }) { response: ResponseBody<MyQuestionResponse> -> response.result } | ||
} | ||
|
||
override suspend fun getMyTogethers(): NetworkResult<MyTogetherResponse> { | ||
return handleApi({ api.getMyTogethers() }) { response: ResponseBody<MyTogetherResponse> -> response.result } | ||
} | ||
|
||
override suspend fun getMyHoneyTips(): NetworkResult<MyHoneyTipsResponse> { | ||
return handleApi({ api.getMyHoneyTips() }) { response: ResponseBody<MyHoneyTipsResponse> -> response.result } | ||
} | ||
|
||
override suspend fun getMyCommunications(): NetworkResult<MyCommunitiesResponse> { | ||
return handleApi({ api.getMyCommunications() }) { response: ResponseBody<MyCommunitiesResponse> -> response.result } | ||
} | ||
} |
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
Oops, something went wrong.