class GroupController {

    @RequestMapping(value = "/member/tree")
    public ServiceResult<List<DasGroup>> getMemberGroups(@CurrentUser LoginUser loginUser) throws Exception {
        if (permissionService.isManagerById(Long.valueOf(loginUser.getId()))) {
            return ServiceResult.success(groupDao.getAllGroups());
        }
        return ServiceResult.success(groupDao.getGroupsByUserId(loginUser.getId()));
    }

}