forked from tom.biard/ScienceQuest
parent
6e27dac780
commit
ae707b0494
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="ModuleClassLoaderOverlays">
|
||||
<paths>
|
||||
<option value="/tmp/overlay18274623989856132394" />
|
||||
</paths>
|
||||
</component>
|
||||
</module>
|
@ -1,22 +0,0 @@
|
||||
package fr.iut.sciencequest.model.buisness.Question
|
||||
|
||||
import android.util.Log
|
||||
import fr.iut.sciencequest.model.buisness.Scientifique.ScientifiqueRequestService
|
||||
import fr.iut.sciencequest.model.buisness.createRequestService
|
||||
import fr.iut.sciencequest.model.dto.question.QuestionListDTO
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
import retrofit2.create
|
||||
import java.lang.IllegalArgumentException
|
||||
|
||||
suspend fun fetchQuestions(index: Int) = flow {
|
||||
val serviceClient = createRequestService().create<QuestionRequestService>()
|
||||
try {
|
||||
val response = serviceClient.getQuestions(index)
|
||||
emit(response)
|
||||
} catch (e: Exception) {
|
||||
Log.e("Requete API Question",e.message.toString())
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package fr.iut.sciencequest.model.metier.reponse
|
||||
|
||||
class SimpleResponse {
|
||||
val id: Int
|
||||
val reponse: String
|
||||
|
||||
constructor(id: Int, reponse: String) {
|
||||
this.id = id
|
||||
this.reponse = reponse
|
||||
}
|
||||
}
|
Loading…
Reference in new issue