팀 생성
Swit Team 정보 생성
- Swit 의 Team API를 이용하여 팀을 생성 합니다.
Query Parameters
-
name
:string
Team 이름
-
parent_id
:string
상위부서팀 Team Idid
-
reference
:string
참조로 사용할 사용자 정의 텍스트
package io.swit.api.service.eai;
@Service
@Slf4j
@AllArgsConstructor
public class TeamService {
public String createSwitTeam(SwitDeptDto team) throws Exception{
String teamId = "";
JSONObject params = new JSONObject();
try {
params.put("name", team.getTeamName());
params.put("parent_id", team.getParentId());
params.put("reference", team.getReference());
SwitTokenDto tokenDto = authService.getSwitTokenByDb("cts-api");
JsonObject result = httpUtils.post("team.create", params, tokenDto);
JsonElement data = result.getAsJsonObject().get("data");
SwitDeptDto switDept = new SwitDeptDto();
switDept = this.parsingTeamResult(data);
teamId = this.saveSwitDeptBySync(switDept);
} catch (Exception e) {
log.error(e.getMessage());
}
return teamId;
}
}
Query Response
-
depth integer
-
id string
-
name string
-
parent_id string
-
reference string
-
member_cnt integer
-
users string[array]
Example
{
"data": {
"data": {
"depth": 0,
"id": "200103015310ImIqLWZ",
"name": "Design",
"parent_id": "24567231758btrwFTY",
"reference": "145",
"member_cnt": 2,
"users": [
"1902060217048ALFTG",
"1906060217048FQOXY"
]
}
}
}