Skip to content

Instantly share code, notes, and snippets.

@juancho088
Created June 11, 2018 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juancho088/ec11c2557dcda079812a3e81442249e9 to your computer and use it in GitHub Desktop.
Save juancho088/ec11c2557dcda079812a3e81442249e9 to your computer and use it in GitHub Desktop.
MovieController using the service factory
package com.myblockbuster.movies.controllers
import com.myblockbuster.core.Request
import com.myblockbuster.core.User
import com.myblockbuster.core.controllers.Controller
import com.myblockbuster.core.factories.ServiceFactory
import com.myblockbuster.core.services.Service
import com.myblockbuster.movies.Movie
class MovieController: Controller<Movie> {
fun movie(request: Request?) : Any {
val service: Service<Movie, User> = ServiceFactory<Movie>().getService(Movie::class.java)
return defaultRouting(Movie::class.java, request!!, service)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment