Search in sources :

Example 1 with WatchlistForm

use of com.cassandrawebtrader.dto.WatchlistForm in project microservices by pwillhan.

the class WatchlistMapper method map.

public WatchlistForm map(Watchlist domain) {
    WatchlistForm model = new WatchlistForm();
    model.setWatchlistcode(domain.getWatchlistcode());
    model.setSymbol(domain.getSymbol());
    model.setActive(domain.getActive());
    return model;
}
Also used : WatchlistForm(com.cassandrawebtrader.dto.WatchlistForm)

Example 2 with WatchlistForm

use of com.cassandrawebtrader.dto.WatchlistForm in project microservices by pwillhan.

the class WatchlistController method showWatchlistPage.

@RequestMapping(method = RequestMethod.GET)
public String showWatchlistPage(Model model) {
    List<Watchlist> watchlists = (List<Watchlist>) watchlistRepository.findAll();
    model.addAttribute("watchlists", watchlists);
    WatchlistForm watchlistForm = new WatchlistForm();
    model.addAttribute("watchlistForm", watchlistForm);
    return "watchlist";
}
Also used : List(java.util.List) WatchlistForm(com.cassandrawebtrader.dto.WatchlistForm) Watchlist(com.cassandrawebtrader.domain.Watchlist) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with WatchlistForm

use of com.cassandrawebtrader.dto.WatchlistForm in project microservices by pwillhan.

the class WatchlistController method editWatchlistPage.

@RequestMapping(value = "/edit", method = RequestMethod.GET)
public ModelAndView editWatchlistPage(@RequestParam(value = "symbol", required = true) String symbol) {
    ModelAndView modelAndView = new ModelAndView("watchlist-edit");
    Watchlist watchlist = watchlistRepository.findBySymbol(symbol);
    WatchlistForm watchlistForm = mapper.map(watchlist);
    modelAndView.addObject(watchlistForm);
    return modelAndView;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) WatchlistForm(com.cassandrawebtrader.dto.WatchlistForm) Watchlist(com.cassandrawebtrader.domain.Watchlist) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

WatchlistForm (com.cassandrawebtrader.dto.WatchlistForm)3 Watchlist (com.cassandrawebtrader.domain.Watchlist)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 List (java.util.List)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1