Skip to content
Permalink
Browse files
Started working on the repository structure and injection
  • Loading branch information
manuelkiessling committed Jan 18, 2016
1 parent 0fa30e4 commit d58d681
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
@@ -1,9 +1,11 @@
package controllers package controllers


import models.ProductModel
import play.api._ import play.api._
import play.api.mvc._ import play.api.mvc._
import repositories.Repository


class Application extends Controller { class Application(productsRepository: Repository[ProductModel, Int]) extends Controller {


def index = Action { def index = Action {
Ok(views.html.index("Your new application is ready.")) Ok(views.html.index("Your new application is ready."))
@@ -0,0 +1,3 @@
package models

case class ProductModel(id: Int, name: String)
@@ -0,0 +1,5 @@
package repositories

abstract trait Repository[M, I] {
def getOneById(id: I): M
}

0 comments on commit d58d681

Please sign in to comment.