class UserApi @Inject() (db: play.api.db.DBApi ) {
val dababase = db.database("name")
def login(email: String, password: String): Option[User] = {
dababase.withConnection { implicit c =>
// TODO
}
}
}
//controller
class MyController @Inject() (userApi: UserApi ) extends Conroller {
//your code
}