PortfolioController.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:springBootTrader-aos 作者:
@RequestMapping(value = "/portfolio", method = RequestMethod.GET)
public String portfolio(Model model) {
    logger.debug("/portfolio");
    model.addAttribute("marketSummary", marketService.getMarketSummary());

    //check if user is logged in!
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if (!(authentication instanceof AnonymousAuthenticationToken)) {
        String currentUserName = authentication.getName();
        logger.debug("portfolio: User logged in: " + currentUserName);

        //TODO: add account summary.
        try {
            model.addAttribute("portfolio",marketService.getPortfolio(currentUserName));
        } catch (HttpServerErrorException e) {
            logger.debug("error retrieving portfolfio: " + e.getMessage());
            model.addAttribute("portfolioRetrievalError",e.getMessage());
        }
        model.addAttribute("order", new Order());
    }

    return "portfolio";
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号