-
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.
[LH-112] Link board api to the fragment #16
- Loading branch information
1 parent
34d95d3
commit 82c95ce
Showing
10 changed files
with
88 additions
and
9 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
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
6 changes: 5 additions & 1 deletion
6
domain/src/main/java/com/lighthouse/domain/response/vo/BoardQuestionVO.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,13 @@ | ||
package com.lighthouse.domain.response.vo | ||
|
||
|
||
data class BoardQuestionVO( | ||
val questionId: Int, | ||
val userId: Int, | ||
val memberId: Int, | ||
val categoryId: Int, | ||
val profileImage: String, | ||
val name: String, | ||
val region: String, | ||
val contents: String, | ||
val like: 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
10 changes: 10 additions & 0 deletions
10
domain/src/main/java/com/lighthouse/domain/usecase/GetQuestionUseCase.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,11 +1,21 @@ | ||
package com.lighthouse.domain.usecase | ||
|
||
import com.lighthouse.domain.constriant.Resource | ||
import com.lighthouse.domain.repository.BoardRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class GetQuestionUseCase @Inject constructor( | ||
private val repository: BoardRepository, | ||
) { | ||
fun invoke(category: Int, order: String, page: Int) = | ||
repository.getBoardQuestions(category, order, page) | ||
|
||
|
||
fun uploadQuestion(userId: Int, categoryId: Int, content: String): Flow<Resource<String>> = | ||
repository.uploadQuestion(userId, categoryId, content) | ||
|
||
fun updateLike(questionId: Int, memberId: Int): Flow<Resource<String>> = | ||
repository.updateLike(questionId, memberId) | ||
|
||
} |