|
|
|
@ -46,6 +46,9 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
|
|
|
|
|
private String HOST;
|
|
|
|
|
@Value("${contract.kt.api.generate-token}")
|
|
|
|
|
private String API_GENERATE_TOKEN;
|
|
|
|
|
@Value("${contract.kt.api.before-send}")
|
|
|
|
|
private String API_BEFORE_SEND;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String AUTH_TYPE_BEARER = "Bearer";
|
|
|
|
|
|
|
|
|
@ -53,7 +56,7 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public KtTokenResponse requestToken(final KtMnsRequest paramDTO) {
|
|
|
|
|
CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getKtMnsInfo(paramDTO.getSignguCode(), paramDTO.getFfnlgCode());
|
|
|
|
|
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getKtMnsInfo(paramDTO.getSignguCode(), paramDTO.getFfnlgCode());
|
|
|
|
|
final KtTokenRequest reqDTO = KtTokenRequest.builder()
|
|
|
|
|
.clientId(ktMnsInfo.getKtClientId())
|
|
|
|
|
.clientSecret(ktMnsInfo.getKtClientSecret())
|
|
|
|
@ -91,9 +94,27 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
|
|
|
|
|
* @param reqDTO
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public KtCommonResponse beforeSend(final KtMnsRequest paramDTO, final KtBefSendRequest reqDTO) {
|
|
|
|
|
public KtCommonResponse beforeSend(final KtBefSendRequest reqDTO) {
|
|
|
|
|
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getKtMnsInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
|
|
|
|
|
//reqDTO.setServiceCd(ktMnsInfo.get);
|
|
|
|
|
//reqDTO.setServiceKey(ktMnsInfo.get);
|
|
|
|
|
CmmEnsUtils.validate(reqDTO);
|
|
|
|
|
List<ErrorMsg> errors = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
final Map<String,String> headerMap = new HashMap<>();
|
|
|
|
|
headerMap.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
|
|
|
|
|
headerMap.put(HttpHeaders.AUTHORIZATION, String.format("%s %s", AUTH_TYPE_BEARER, ktMnsInfo.getKtAccessToken()));
|
|
|
|
|
headerMap.put("client-id", ktMnsInfo.getKtClientId());
|
|
|
|
|
headerMap.put("client-tp", "10");
|
|
|
|
|
|
|
|
|
|
return webClient.exchange(
|
|
|
|
|
HOST + API_BEFORE_SEND,
|
|
|
|
|
HttpMethod.POST,
|
|
|
|
|
JsonUtils.toJson(reqDTO),
|
|
|
|
|
KtCommonResponse.class,
|
|
|
|
|
headerMap
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/*List<ErrorMsg> errors = new ArrayList<>();
|
|
|
|
|
errors.add(new ErrorMsg("error1"));
|
|
|
|
|
errors.add(new ErrorMsg("error2"));
|
|
|
|
|
|
|
|
|
@ -101,6 +122,6 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
|
|
|
|
|
.resultCd("00")
|
|
|
|
|
.resultDt(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss"))
|
|
|
|
|
.errors(errors)
|
|
|
|
|
.build();
|
|
|
|
|
.build();*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|