コード例 #1
0
  @RequestMapping(value = "/linkinvitation")
  public String viewLinkInvitation(
      @RequestParam("competitionId") Long competitionId,
      @RequestParam(value = "alternativeId", defaultValue = "0", required = false)
          Long alternativeId,
      @RequestParam(value = "betValue", defaultValue = "0", required = false) BigDecimal betValue,
      Model model,
      HttpSession session) {

    Competition competition = competitionService.getCompetitionById(competitionId);
    Invitation invitation = new Invitation(competition, getUserId());

    for (Event e : competition.getEvents()) {
      e.setAlternatives(sortAlternativeSet(e.getSortedAlternatives()));
    }

    model.addAttribute("invitation", invitation);
    model.addAttribute("competition", competition);

    model.addAttribute("alternativeId", alternativeId);
    model.addAttribute("betValue", betValue.toString());

    setLeftRightPaneContents(model, session);

    return "invitationView";
  }
コード例 #2
0
 @RequestMapping(value = "/invitation")
 public String viewInvitation(@RequestParam("invitationId") Long invitationId, Model model) {
   Invitation invitation = competitionService.getInvitationById(invitationId);
   Competition competition = competitionService.getCompetitionById(invitation.getCompetitionId());
   for (Event e : competition.getEvents()) {
     e.setAlternatives(sortAlternativeSet(e.getSortedAlternatives()));
   }
   model.addAttribute("invitation", invitation);
   model.addAttribute("competition", competition);
   return "invitationView";
 }