Esempio n. 1
0
  // add team page
  @RequestMapping(value = "/add", method = RequestMethod.GET)
  public String addTeamPage(Map<String, Object> map) {

    Leader leader = leaderService.getLeaderByUserName(userService.getCurrentUserName());
    if (teamService.isTeamByLeaderId(leader.getId()) == false) {
      map.put("username", userService.getCurrentUserName());
      map.put("authority", userService.getCurrentAuthority());
      return "team_add";
    }
    return "index";
  }
Esempio n. 2
0
  // view team by id
  @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  public String teamPage(Map<String, Object> map, @PathVariable("id") int id) {

    String username = userService.getCurrentUserName();
    Team team = teamService.getTeamById(id);
    map.put("needTeam", team);
    List<TeamInCompetition> teamInCompetitionList =
        teamInCompetitionService.getTeamInCompetitionListByTeamIdForCurrentYear(id);
    Map<TeamInCompetition, Boolean> isValidTeamInCompetitionMap =
        teamInCompetitionService.isValidTeamInCompetitionMap(teamInCompetitionList);
    map.put("isValidTeamInCompetitionMap", isValidTeamInCompetitionMap);
    map.put("username", username);
    map.put("authority", userService.getCurrentAuthority());
    return "team";
  }