-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae61120
commit 5a09ea1
Showing
85 changed files
with
921 additions
and
927 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# Routes | ||
# This file defines all module routes (Higher priority routes first) | ||
# ~~~~ | ||
GET /products shopping.controllers.ShoppingController.get | ||
GET / shopping.controllers.ShoppingController.get | ||
POST /product/:productID shopping.controllers.ShoppingController.passProductID(productID: reactivemongo.bson.BSONObjectID) | ||
GET /product/selected shopping.controllers.ProductController.get |
47 changes: 47 additions & 0 deletions
47
app-shopping/src/main/scala/shopping/controllers/ProductController.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package shopping.controllers | ||
|
||
import core.controllers.ApiController | ||
import core.models.{ Item, Size } | ||
import core.utils.DefaultEnv | ||
import core.utils.json.APIFormats._ | ||
import shopping.models.services.ProductService | ||
|
||
import javax.inject.Inject | ||
|
||
import org.joda.time.DateTime | ||
|
||
import play.api.i18n.{ Messages, MessagesProvider } | ||
import play.api.libs.json._ | ||
import play.api.mvc._ | ||
|
||
import reactivemongo.bson.BSONObjectID | ||
|
||
import scala.concurrent.duration._ | ||
import scala.concurrent.{ ExecutionContext, Future } | ||
|
||
/** | ||
* The `Shopping` controller. | ||
* | ||
* @param controllerComponents The Play controller components. | ||
* @param productService The products service. | ||
* @param ex The execution context. | ||
*/ | ||
class ProductController @Inject() ( | ||
val controllerComponents: ControllerComponents, | ||
val productService: ProductService | ||
)( | ||
implicit | ||
ex: ExecutionContext | ||
) extends ApiController { | ||
|
||
/** | ||
* Gets a selected product from the Kafka topic. | ||
* | ||
* @return The products. | ||
*/ | ||
def get: Action[AnyContent] = Action.async { implicit request => | ||
|
||
Future.successful(Ok(ApiResponse("shopping.products", Messages("request.ok")))) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.