feat: EPost 종적추적 API 반영

dev
gitea-관리자 1 year ago
parent 9c7e34143e
commit b0b058bb2f

@ -1,5 +1,6 @@
package kr.xit.ens.kt.service;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
@ -162,18 +163,18 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
public KtTokenResponse requestToken(final KtMnsRequest paramDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(paramDTO.getSignguCode(), paramDTO.getFfnlgCode());
final KtTokenRequest reqDTO = KtTokenRequest.builder()
.clientId(ktMnsInfo.getKtClientId())
//.clientId(ktMnsInfo.getKtSvcClientId())
.clientSecret(ktMnsInfo.getKtSvcClientSecret())
.scope(ktMnsInfo.getKtScope())
//.clientId(ktMnsInfo.getKtClientId())
.clientId(URLEncoder.encode(ktMnsInfo.getKtSvcClientId()))
.clientSecret(URLEncoder.encode(ktMnsInfo.getKtSvcClientSecret()))
.scope(URLEncoder.encode(ktMnsInfo.getKtScope()))
.build();
CmmEnsUtils.validate(reqDTO);
final Map<String,String> headerMap = new HashMap<>();
headerMap.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
// headerMap.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
// headerMap.put("client-id", "client-id");
// headerMap.put("client-tp", "10");
headerMap.put("client-id", ktMnsInfo.getKtClientId());
headerMap.put("client-tp", ktMnsInfo.getKtClientTp());
// headerMap.put(HttpHeaders.AUTHORIZATION, String.format("%s %s", AUTH_TYPE_BEARER, "access-token"));
return webClient.exchange(

@ -40,7 +40,7 @@ contract:
kt:
dummy: true
# vpn 사용
# host: http://172.16.0.13:10210/ONLWeb
#host: http://172.16.0.13:10210/ONLWeb
# 공인 IP
host: http://211.43.10.163:10210/ONLWeb
# 운영

@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import java.io.Serializable;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -54,8 +53,7 @@ public class CmmEnsRequestDTO implements Serializable {
/**
* active profile
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "profile", example = "dev")
@NotEmpty(message = "profile은 필수 입니다.")
@Schema(requiredMode = RequiredMode.AUTO, title = "profile", example = "dev")
@JsonProperty("profile")
private String profile = "prod";
private String profile;
}

@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import java.net.URLEncoder;
import javax.validation.constraints.Size;
import kr.xit.biz.ens.model.kt.KtCommonDTO.KtCommonResponse;
import kr.xit.core.model.IApiResponse;
@ -68,7 +69,7 @@ public class KtTokenDTO {
@Schema(requiredMode = RequiredMode.REQUIRED, title = "권한부여방식", example = "clinet_credentials")
@NotEmpty(message = "권한부여방식은 필수 입니다")
@Size(max = 100)
private String grantType = "clinet_credentials";
private String grantType = URLEncoder.encode("client_credentials");
/**
*
@ -95,7 +96,7 @@ public class KtTokenDTO {
@Schema(requiredMode = RequiredMode.REQUIRED, title = "권한범위", example = "ag.api")
@NotEmpty(message = "권한범위는 필수 입니다")
@Length(max = 100)
private String scope = "ag.api";
private String scope = URLEncoder.encode("ag.api");
}
@Schema(name = "KtTokenResponse", description = "KT MMS 토큰발행 요청 결과 DTO")

Loading…
Cancel
Save