Пример #1
0
  @RequestMapping(
      value = "orgs/{orgId}/orgUnits/{orgUnitId}/members/{memberId}",
      method = RequestMethod.GET)
  @ResponseBody
  public EmlUserOrgVo getOrgUnitMember(
      HttpServletRequest request,
      @PathVariable String orgId,
      @PathVariable String orgUnitId,
      @PathVariable String memberId) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    logger.debug(
        "조직의 단위의 사용자 정보를 취득합니다.: orgId="
            + orgId
            + ", orgUnitId="
            + orgUnitId
            + ", memberId="
            + memberId);
    try {
      return emlOrgService.getSystemUnitUser(orgId, orgUnitId, memberId);
    } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException();
    }
  }
Пример #2
0
  @RequestMapping(value = "orgs/{orgId}/orgUnits/listSubSystemUnits", method = RequestMethod.GET)
  @ResponseBody
  public List<EmlOrgUnitVo> listSubSystemUnits(HttpServletRequest request, String orgUnitId) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    return emlOrgService.listSubSystemUnits(orgUnitId);
  }
Пример #3
0
  @RequestMapping(value = "orgs/{orgId}/orgUnits", method = RequestMethod.GET)
  @ResponseBody
  public List<EmlOrgUnitVo> listOrgUnits(HttpServletRequest request, @PathVariable String orgId) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    logger.debug("조직의 단위를 검색합니다.: orgId=" + orgId);

    return emlOrgService.listSystemUnits(groupVo.getId(), orgId);
  }
Пример #4
0
  @RequestMapping(value = "orgs/{orgId}", method = RequestMethod.DELETE)
  @ResponseBody
  public void removeOrg(HttpServletRequest request, @PathVariable String orgId) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    logger.debug("조직을 삭제합니다.: orgId=" + orgId);

    emlOrgService.removeSystem(groupVo.getId(), orgId);
  }
Пример #5
0
  @RequestMapping(value = "orgs/{orgId}", method = RequestMethod.GET)
  @ResponseBody
  public EmlOrgVo getOrg(HttpServletRequest request, @PathVariable String orgId) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    logger.debug("조직 정보를 취득합니다.: orgId=" + orgId);

    return emlOrgService.getSystem(groupVo.getId(), orgId);
  }
Пример #6
0
  @RequestMapping(value = "orgs", method = RequestMethod.POST)
  @ResponseBody
  public EmlOrgVo addOrg(HttpServletRequest request, @RequestBody EmlOrgVo orgVo) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    logger.debug("조직을 추가합니다.: orgName=" + orgVo.getDisplayName());

    return emlOrgService.addSystem(groupVo.getId(), orgVo.getDisplayName());
  }
Пример #7
0
  @RequestMapping(value = "orgs", method = RequestMethod.GET)
  @ResponseBody
  public List<EmlOrgVo> listOrgs(HttpServletRequest request) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    logger.debug("조직을 검색합니다.");

    return emlOrgService.listSystems(groupVo.getId());
  }
Пример #8
0
  @RequestMapping(value = "orgs/{orgId}/orgUnits", method = RequestMethod.POST)
  @ResponseBody
  public EmlOrgUnitVo addOrgUnit(
      HttpServletRequest request,
      @PathVariable String orgId,
      @RequestBody EmlOrgUnitVo orgSystemUnitVo) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    logger.debug(
        "조직의 단위를 추가합니다.: orgId="
            + orgId
            + ", orgUnitName="
            + orgSystemUnitVo.getDisplayName()
            + ", parentOrgUnitId="
            + orgSystemUnitVo.getParentOrgUnitId());
    return emlOrgService.addSystemUnit(
        orgId, orgSystemUnitVo.getDisplayName(), orgSystemUnitVo.getParentOrgUnitId());
  }
Пример #9
0
  @RequestMapping(value = "orgs/{orgId}/orgUnits/{orgUnitId}/members", method = RequestMethod.POST)
  @ResponseBody
  public EmlUserOrgVo addOrgUnitMember(
      HttpServletRequest request,
      @PathVariable String orgId,
      @PathVariable String orgUnitId,
      @RequestBody EmlUserOrgVo userOrgVo) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    logger.debug(
        "조직의 단위의 사용자를 추가합니다.: orgId="
            + orgId
            + ", orgUnitId="
            + orgUnitId
            + ", userId="
            + userOrgVo.getUserId());
    return emlOrgService.addSystemUnitUser(orgId, orgUnitId, userOrgVo.getUserId());
  }
Пример #10
0
  @RequestMapping(
      value = "orgs/{orgId}/orgUnits/{orgUnitId}/members/{memberId}",
      method = RequestMethod.DELETE)
  @ResponseBody
  public void removeOrgUnitMember(
      HttpServletRequest request,
      @PathVariable String orgId,
      @PathVariable String orgUnitId,
      @PathVariable String memberId) {
    EmlGroupVo groupVo = groupService.getByName(request.getUserPrincipal().getName());

    logger.debug(
        "조직의 단위의 사용자를 삭제합니다.: orgId="
            + orgId
            + ", orgUnitId="
            + orgUnitId
            + ", memberId="
            + memberId);
    emlOrgService.removeSystemUnitUser(orgId, orgUnitId, memberId);
  }