Ejemplo n.º 1
0
  @RequestMapping(value = "/saveTeam", method = RequestMethod.POST)
  public @ResponseBody Map<String, Object> addTeam(Team team) {

    if (team.getId() == null) {
      teamService.insertTeamSelective(team);
      return getMessageMap(true, "Add team success!");
    } else {
      teamService.updateTeamSelective(team);
      return getMessageMap(true, "Add team success!");
    }
  }
Ejemplo n.º 2
0
  @RequestMapping(value = "/getAll", method = RequestMethod.GET)
  public @ResponseBody Map<String, Object> getTeam(String name, String isOwn) {
    Map<String, Object> map = new HashMap<String, Object>();
    Map<String, Object> whereMap = new HashMap<String, Object>();

    if (!StringUtil.isEmpty(isOwn)) {
      whereMap.put("userId", this.getCurrentUser().getId());
    }

    if (!StringUtil.isEmpty(name)) {
      whereMap.put("name", name);
    }

    map.put("recordlist", teamService.getAll(whereMap));

    return map;
  }
Ejemplo n.º 3
0
 @RequestMapping(value = "/deleteTeam")
 public @ResponseBody Map<String, Object> deleteTeam(Integer id) {
   teamService.deleteTeamById(id);
   return getMessageMap(true, "Delete team success!");
 }