StubRefontFavori #47
Merged
leni.beaulaton
merged 2 commits from StubRefontFavori
into master
1 month ago
@ -1,27 +1,21 @@
|
||||
package com.example.what_the_fantasy.data.local
|
||||
|
||||
import com.example.what_the_fantasy.data.local.QuoteStub.quotes
|
||||
import com.example.what_the_fantasy.data.local.UserStub.users
|
||||
import com.example.what_the_fantasy.data.model.Favorite
|
||||
import com.example.what_the_fantasy.data.model.Quote
|
||||
|
||||
object FavoriteStub {
|
||||
val favorites: MutableList<Favorite> = mutableListOf(
|
||||
Favorite(UserStub.users[0], QuoteStub.quote1),
|
||||
Favorite(UserStub.users[1], QuoteStub.quote12),
|
||||
Favorite(UserStub.users[2], QuoteStub.quote13),
|
||||
Favorite(UserStub.users[3], QuoteStub.quote6),
|
||||
Favorite(UserStub.users[4], QuoteStub.quote5),
|
||||
Favorite(UserStub.users[5], QuoteStub.quote3),
|
||||
Favorite(UserStub.users[6], QuoteStub.quote17),
|
||||
Favorite(UserStub.users[7], QuoteStub.quote7),
|
||||
Favorite(UserStub.users[8], QuoteStub.quote19),
|
||||
Favorite(UserStub.users[9], QuoteStub.quote20),
|
||||
Favorite(UserStub.users[10], QuoteStub.quote11)
|
||||
Favorite(users[0], mutableListOf(quotes[0], quotes[0], quotes[0])), // Aragorn123 aime ces citations
|
||||
Favorite(users[1], mutableListOf(quotes[5], quotes[6], quotes[7])), // Legolas456 aime ces citations
|
||||
Favorite(users[2], mutableListOf(quotes[8], quotes[9], quotes[10])), // Gandalf789 aime ces citations
|
||||
Favorite(users[3], mutableListOf(quotes[11], quotes[12], quotes[13])), // FrodoBaggins aime ces citations
|
||||
Favorite(users[4], mutableListOf(quotes[14], quotes[15], quotes[16])), // Gimli999 aime ces citations
|
||||
Favorite(users[5], mutableListOf(quotes[17], quotes[18], quotes[19])), // Galadriel321 aime ces citations
|
||||
Favorite(users[6], mutableListOf(quotes[17], quotes[2], quotes[7])), // Boromir654 aime ces citations
|
||||
Favorite(users[7], mutableListOf(quotes[3], quotes[4], quotes[10])), // Eowyn777 aime ces citations
|
||||
Favorite(users[8], mutableListOf(quotes[6], quotes[8], quotes[9])), // Saruman888 aime ces citations
|
||||
Favorite(users[9], mutableListOf(quotes[5], quotes[13], quotes[15])), // Faramir222 aime ces citations
|
||||
Favorite(users[10], mutableListOf(quotes[12], quotes[17], quotes[16])) // dev aime ces citations
|
||||
)
|
||||
|
||||
fun getFavoritesByUser(userId: Int): List<Quote> {
|
||||
return favorites
|
||||
.filter { it.user.id == userId }
|
||||
.map { it.quote }
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.example.what_the_fantasy.data.model
|
||||
|
||||
enum class SrcLanguage {
|
||||
fr,
|
||||
vf,
|
||||
vo
|
||||
}
|
@ -1,54 +1,64 @@
|
||||
package com.example.what_the_fantasy.data.services
|
||||
|
||||
import com.example.what_the_fantasy.data.model.Favorite
|
||||
import com.example.what_the_fantasy.data.model.Quote
|
||||
import com.example.what_the_fantasy.data.model.User
|
||||
|
||||
class ServicesAPI : IServices {
|
||||
override fun EditUsername(username: String, index : Int) : Boolean {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
//class ServicesAPI : IServices {
|
||||
// override fun EditUsername(username: String, index : Int) : Boolean {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun EditEmail(email: String, index : Int) : Boolean {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun EditPasswd(passwd: String, index : Int) {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun EditImage(imageURL: String, index : Int) {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun ChangeLangage(user: User) {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun CreateUser(username: String, email: String, passwd: String, services: IServices) : Boolean {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun SearchQuote(quote: String) {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun getQuote(id: Int): Quote? {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun isFavorite(id: Int): Boolean {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun getAllFavorite(): List<Favorite> {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
|
||||
override fun EditEmail(email: String, index : Int) : Boolean {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun EditPasswd(passwd: String, index : Int) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun EditImage(imageURL: String, index : Int) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun ChangeLangage(user: User) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun CreateUser(username: String, email: String, passwd: String, services: IServices) : Boolean {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun SearchQuote(quote: String) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun getQuote(id: Int): Quote? {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun isFavorite(id: Int): Boolean {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun getFavorite(username: String) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun getAllUsers(): List<User> {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun getUserById(id: Int): User? {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
// override fun getAllQuote(): List<Quote> {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun getFavorite(user: User): Favorite {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun getAllUsers(): List<User> {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
// override fun getUserById(id: Int): User? {
|
||||
// TODO("Not yet implemented")
|
||||
// }
|
||||
//
|
||||
//}
|
Loading…
Reference in new issue