Examples of buyStock()


Examples of models.data.GamePlayer.buyStock()

        Form<BuyStock> buyStockForm = Form.form(BuyStock.class).bindFromRequest();
        response().setContentType("application/json");
        if (buyStockForm.hasGlobalErrors()) {
            return badRequest(buyStockForm.errorsAsJson());
        } else {
            if (me.buyStock(buyStockForm.get().ticker, buyStockForm.get().quantity, buyStockForm.get().price)) {
                return ok(GameStateJSONFormatter.getGameStateJson(gameId));
            } else {
                return badRequest("{error: \"could not make purchase\"}");
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.