generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 1
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 GSM-MSG/feature/#122_set_up_get_detail_club
🔀 :: (#122) Set Up Get Detail Club
- Loading branch information
Showing
7 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
core/data/src/main/java/com/msg/data/repository/club/ClubRepository.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,9 +1,11 @@ | ||
package com.msg.data.repository.club | ||
|
||
import com.msg.model.remote.enumdatatype.HighSchool | ||
import com.msg.model.remote.response.club.ClubDetailResponse | ||
import com.msg.model.remote.response.club.ClubListResponse | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface ClubRepository { | ||
suspend fun getClubList(highSchool: HighSchool): Flow<List<ClubListResponse>> | ||
suspend fun getClubDetail(id: Long): Flow<ClubDetailResponse> | ||
} |
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
12 changes: 12 additions & 0 deletions
12
core/domain/src/main/java/com/msg/domain/club/GetClubDetailUseCase.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.msg.domain.club | ||
|
||
import com.msg.data.repository.club.ClubRepository | ||
import javax.inject.Inject | ||
|
||
class GetClubDetailUseCase @Inject constructor( | ||
private val clubRepository: ClubRepository | ||
) { | ||
suspend operator fun invoke(id: Long) = runCatching { | ||
clubRepository.getClubDetail(id = id) | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
core/model/src/main/java/com/msg/model/remote/response/club/ClubDetailResponse.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.msg.model.remote.response.club | ||
|
||
data class ClubDetailResponse( | ||
val clubName: String, | ||
val highSchoolName: String, | ||
val studentHeadCount: Int, | ||
) |
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,13 +1,20 @@ | ||
package com.msg.network.api | ||
|
||
import com.msg.model.remote.enumdatatype.HighSchool | ||
import com.msg.model.remote.response.club.ClubDetailResponse | ||
import com.msg.model.remote.response.club.ClubListResponse | ||
import retrofit2.http.GET | ||
import retrofit2.http.Path | ||
import retrofit2.http.Query | ||
|
||
interface ClubAPI { | ||
@GET("club") | ||
suspend fun getClubList( | ||
@Query("highschool") highSchool: HighSchool, | ||
): List<ClubListResponse> | ||
|
||
@GET("club/{id}") | ||
suspend fun getClubDetail( | ||
@Path("id") id: Long, | ||
): ClubDetailResponse | ||
} |
2 changes: 2 additions & 0 deletions
2
core/network/src/main/java/com/msg/network/datasource/club/ClubDataSource.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,9 +1,11 @@ | ||
package com.msg.network.datasource.club | ||
|
||
import com.msg.model.remote.enumdatatype.HighSchool | ||
import com.msg.model.remote.response.club.ClubDetailResponse | ||
import com.msg.model.remote.response.club.ClubListResponse | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface ClubDataSource { | ||
suspend fun getClubList(highSchool: HighSchool): Flow<List<ClubListResponse>> | ||
suspend fun getClubDetail(id: Long): Flow<ClubDetailResponse> | ||
} |
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