|
|
@ -45,18 +45,9 @@ public class NiceCiGenerator {
|
|
|
|
@Value("${contract.nice.ci.rest.api.ci}")
|
|
|
|
@Value("${contract.nice.ci.rest.api.ci}")
|
|
|
|
private String API_CI;
|
|
|
|
private String API_CI;
|
|
|
|
|
|
|
|
|
|
|
|
public ResponseVO<String> getCI(String jid, String clientIp) {
|
|
|
|
public ResponseVO initialKey(){
|
|
|
|
|
|
|
|
|
|
|
|
NiceCiApiExecutor executor = NiceCiApiExecutor.builder()
|
|
|
|
NiceCiApiExecutor executor = buildExecutor();
|
|
|
|
.HOST(this.HOST)
|
|
|
|
|
|
|
|
.CLIENT_ID(this.CLIENT_ID)
|
|
|
|
|
|
|
|
.CLIENT_SECRET(this.CLIENT_SECRET)
|
|
|
|
|
|
|
|
.API_GENERATE_TOKEN(this.API_GENERATE_TOKEN)
|
|
|
|
|
|
|
|
.API_REVOKE_TOKEN(this.API_REVOKE_TOKEN)
|
|
|
|
|
|
|
|
.API_PUBLICKEY(this.API_PUBLICKEY)
|
|
|
|
|
|
|
|
.API_SYMMETRICKEY(this.API_SYMMETRICKEY)
|
|
|
|
|
|
|
|
.API_CI(this.API_CI)
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
/* ==========================================================================
|
|
|
|
/* ==========================================================================
|
|
|
@ -80,7 +71,7 @@ public class NiceCiGenerator {
|
|
|
|
========================================================================== */
|
|
|
|
========================================================================== */
|
|
|
|
// NiceCiRespVO<DataBodySymkeyResp> symkeyResponseVO = executor.symkey();
|
|
|
|
// NiceCiRespVO<DataBodySymkeyResp> symkeyResponseVO = executor.symkey();
|
|
|
|
// if (!NiceCiApiCd.OK.equals(symkeyResponseVO.getErrCode()))
|
|
|
|
// if (!NiceCiApiCd.OK.equals(symkeyResponseVO.getErrCode()))
|
|
|
|
// return ResponseVO.<String>builder().errCode(ErrCd.ERR600).errMsg(symkeyResponseVO.getErrCode().getCode() + " " + symkeyResponseVO.getErrMsg()).build();
|
|
|
|
// return ResponseVO.<String>errRsltBuilder().errCode(ErrCd.ERR600).errMsg(symkeyResponseVO.getErrCode().getCode() + " " + symkeyResponseVO.getErrMsg()).build();
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
DataBodySymkeyResp dataBodySymkeyResp = null;
|
|
|
|
DataBodySymkeyResp dataBodySymkeyResp = null;
|
|
|
|
if (SymmetricKey.isValidStat()) {
|
|
|
|
if (SymmetricKey.isValidStat()) {
|
|
|
@ -114,11 +105,23 @@ public class NiceCiGenerator {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseVO.<String>builder().errCode(ErrCd.OK).errMsg(ErrCd.OK.getCodeNm()).build();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ResponseVO.<String>builder().errCode(ErrCd.ERR699).errMsg(e.getMessage()).build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ResponseVO<String> getCI(String jid, String clientIp) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NiceCiApiExecutor executor = this.buildExecutor();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
/* ==========================================================================
|
|
|
|
/* ==========================================================================
|
|
|
|
* 4. 아이핀 CI 요청
|
|
|
|
* 4. 아이핀 CI 요청
|
|
|
|
========================================================================== */
|
|
|
|
========================================================================== */
|
|
|
|
NiceCiRespVO<DataBodyCiResp> ciResponseVO = executor.ci(jid, clientIp);
|
|
|
|
NiceCiRespVO<DataBodyCiResp> ciResponseVO = executor.ci(jid, clientIp);
|
|
|
|
if (!NiceCiApiCd.OK.equals(pubkeyResponseVO.getErrCode()))
|
|
|
|
if (!NiceCiApiCd.OK.equals(ciResponseVO.getErrCode()))
|
|
|
|
return ResponseVO.<String>builder().errCode(ErrCd.ERR600).errMsg(ciResponseVO.getErrCode().getCode() + " " + ciResponseVO.getErrMsg()).build();
|
|
|
|
return ResponseVO.<String>builder().errCode(ErrCd.ERR600).errMsg(ciResponseVO.getErrCode().getCode() + " " + ciResponseVO.getErrMsg()).build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -127,4 +130,17 @@ public class NiceCiGenerator {
|
|
|
|
return ResponseVO.<String>builder().errCode(ErrCd.ERR699).errMsg(e.getMessage()).build();
|
|
|
|
return ResponseVO.<String>builder().errCode(ErrCd.ERR699).errMsg(e.getMessage()).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private NiceCiApiExecutor buildExecutor(){
|
|
|
|
|
|
|
|
return NiceCiApiExecutor.builder()
|
|
|
|
|
|
|
|
.HOST(this.HOST)
|
|
|
|
|
|
|
|
.CLIENT_ID(this.CLIENT_ID)
|
|
|
|
|
|
|
|
.CLIENT_SECRET(this.CLIENT_SECRET)
|
|
|
|
|
|
|
|
.API_GENERATE_TOKEN(this.API_GENERATE_TOKEN)
|
|
|
|
|
|
|
|
.API_REVOKE_TOKEN(this.API_REVOKE_TOKEN)
|
|
|
|
|
|
|
|
.API_PUBLICKEY(this.API_PUBLICKEY)
|
|
|
|
|
|
|
|
.API_SYMMETRICKEY(this.API_SYMMETRICKEY)
|
|
|
|
|
|
|
|
.API_CI(this.API_CI)
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|