-
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.
Browse files
Browse the repository at this point in the history
Refactor/#68 allview dto
- Loading branch information
Showing
27 changed files
with
188 additions
and
168 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
9 changes: 8 additions & 1 deletion
9
...ta/model/request/RequestInvitationCode.kt → .../data/model/request/RequestJoinProject.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 |
---|---|---|
@@ -1,14 +1,21 @@ | ||
package com.puzzling.puzzlingaos.data.model.request | ||
|
||
import com.puzzling.puzzlingaos.domain.entity.JoinProjectInfo | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class RequestInvitationCode( | ||
data class RequestJoinProject( | ||
@SerialName("projectId") | ||
val projectId: Int, | ||
@SerialName("memberProjectNickname") | ||
val memberProjectNickname: String, | ||
@SerialName("memberProjectRole") | ||
val memberProjectRole: String, | ||
) | ||
|
||
fun JoinProjectInfo.toRequestJoinProjectDto() = RequestJoinProject( | ||
projectId, | ||
memberProjectNickname, | ||
memberProjectRole, | ||
) |
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
23 changes: 16 additions & 7 deletions
23
app/src/main/java/com/puzzling/puzzlingaos/data/repository/MyPageRepositoryImpl.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 |
---|---|---|
@@ -1,23 +1,32 @@ | ||
package com.puzzling.puzzlingaos.data.repository | ||
|
||
import com.puzzling.puzzlingaos.data.datasource.remote.MyPageDataSource | ||
import com.puzzling.puzzlingaos.data.model.response.ResponseDetailRetroDto | ||
import com.puzzling.puzzlingaos.data.model.response.ResponseMyRetroListDto | ||
import com.puzzling.puzzlingaos.domain.entity.DetailRetro | ||
import com.puzzling.puzzlingaos.domain.entity.ProjectReview | ||
import com.puzzling.puzzlingaos.domain.repository.MyPageRepository | ||
import javax.inject.Inject | ||
|
||
class MyPageRepositoryImpl @Inject constructor(private val myPageDataSource: MyPageDataSource) : | ||
MyPageRepository { | ||
override suspend fun getMyProjectReview(memberId: Int, projectId: Int): ResponseMyRetroListDto { | ||
return myPageDataSource.getMyProjectReview(memberId, projectId) | ||
} | ||
override suspend fun getMyProjectReview( | ||
memberId: Int, | ||
projectId: Int, | ||
): Result<List<ProjectReview>> = | ||
runCatching { | ||
myPageDataSource.getMyProjectReview(memberId, projectId).toProjectReview() | ||
} | ||
|
||
override suspend fun getMyDetailReview( | ||
memberId: Int, | ||
projectId: Int, | ||
startDate: String, | ||
endDate: String, | ||
): ResponseDetailRetroDto { | ||
return myPageDataSource.getMyDetailReview(memberId, projectId, startDate, endDate) | ||
): Result<List<DetailRetro>> = runCatching { | ||
myPageDataSource.getMyDetailReview( | ||
memberId, | ||
projectId, | ||
startDate, | ||
endDate, | ||
).data.toDetailRetro() | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/puzzling/puzzlingaos/domain/entity/DetailRetro.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.puzzling.puzzlingaos.domain.entity | ||
|
||
data class DetailRetro( | ||
val reviewId: Int?, | ||
val reviewDay: String, | ||
val reviewDate: String, | ||
val reviewTemplateId: Int?, | ||
val content: List<Content>?, | ||
) { | ||
data class Content( | ||
val title: String, | ||
val content: String, | ||
) | ||
} |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/puzzling/puzzlingaos/domain/entity/InvitationCode.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.puzzling.puzzlingaos.domain.entity | ||
|
||
data class InvitationCode( | ||
val projectId: Int, | ||
val projectName: String, | ||
) |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/puzzling/puzzlingaos/domain/entity/JoinProjectInfo.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.puzzling.puzzlingaos.domain.entity | ||
|
||
data class JoinProjectInfo( | ||
val projectId: Int, | ||
val memberProjectNickname: String, | ||
val memberProjectRole: String, | ||
) |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/puzzling/puzzlingaos/domain/entity/ProjectReview.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.puzzling.puzzlingaos.domain.entity | ||
|
||
data class ProjectReview( | ||
val reviewId: Int, | ||
val reviewDate: String, | ||
val contents: String, | ||
) |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/puzzling/puzzlingaos/domain/entity/ReviewCycle.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.puzzling.puzzlingaos.domain.entity | ||
|
||
data class ReviewCycle( | ||
val projectName: String, | ||
val projectReviewCycle: String, | ||
) |
8 changes: 4 additions & 4 deletions
8
app/src/main/java/com/puzzling/puzzlingaos/domain/repository/MyPageRepository.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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
package com.puzzling.puzzlingaos.domain.repository | ||
|
||
import com.puzzling.puzzlingaos.data.model.response.ResponseDetailRetroDto | ||
import com.puzzling.puzzlingaos.data.model.response.ResponseMyRetroListDto | ||
import com.puzzling.puzzlingaos.domain.entity.DetailRetro | ||
import com.puzzling.puzzlingaos.domain.entity.ProjectReview | ||
|
||
interface MyPageRepository { | ||
|
||
suspend fun getMyProjectReview( | ||
memberId: Int, | ||
projectId: Int, | ||
): ResponseMyRetroListDto | ||
): Result<List<ProjectReview>> | ||
|
||
suspend fun getMyDetailReview( | ||
memberId: Int, | ||
projectId: Int, | ||
startDate: String, | ||
endDate: String, | ||
): ResponseDetailRetroDto | ||
): Result<List<DetailRetro>> | ||
} |
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.