사용자 팀 설정

Swit User 팀 등록



public SwitDeptDto addUserToSwitTeam(String teamId, List<String> userIds) throws Exception{
    SwitDeptDto retVal = new SwitDeptDto();
    JSONObject params = new JSONObject();
    try {
        JSONArray userList = new JSONArray();
        for(String id : userIds)
            userList.add(id);
        params.put("user_ids", userList);
        params.put("id", teamId);
        SwitTokenDto tokenDto = authService.getSwitTokenByDb("cts-api");

        JsonObject result = httpUtils.post("team.user.add", params, tokenDto);
        JsonElement data = result.getAsJsonObject().get("data").getAsJsonObject().get("data");
        retVal = this.parsingTeamResult(data);
    } catch (Exception e) {
        log.error(e.getMessage());
        throw new Exception(e);
    }
    return retVal;
}

Revision #4
Created 10 October 2023 04:16:52 by Johnny Kim
Updated 15 October 2023 19:25:00 by Jade Lee