obp 클라이언트 작업

This commit is contained in:
Rinjae
2025-11-25 22:00:03 +09:00
parent e894d59154
commit 1e3dee5f8f
8 changed files with 324 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
- API Client 그대로 구현
@@ -0,0 +1,94 @@
GET /api/organizations/organizationFromObp?cacheBuster=1764073311139&licenseNumber=1838700854&organizationId=15 HTTP/1.1
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate
Accept-Language: ko,en;q=0.9,en-US;q=0.8
Connection: keep-alive
Cookie: XSRF-TOKEN=0e8e6398-9231-4b2b-859a-a0ace85c9f12; NG_TRANSLATE_LANG_KEY=%22ko%22; JSESSIONID_APIPORTAL=DE09F0098148634E05D434D3D8D9EFE5; loginStatus=success; showNotice=
Host: 192.168.246.16:8080
Referer: http://192.168.246.16:8080/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.62
X-XSRF-TOKEN: 0e8e6398-9231-4b2b-859a-a0ace85c9f12
HTTP/1.1 200
X-Application-Context: portalApplication:swagger,dev:8085
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Content-Type: application/json;charset=UTF-8
Content-Length: 2126
Date: Tue, 25 Nov 2025 12:21:51 GMT
Keep-Alive: timeout=20
Connection: keep-alive
{
"id" : "001-90010001-000001-6000009",
"registeredOn" : "2021-07-19T07:25:53.000+0000",
"registeredBy" : "001-90010009-000000-0000001",
"modifiedOn" : null,
"modifiedBy" : null,
"name" : "재팬리미트파이낸스㈜",
"state" : "01",
"englishName" : null,
"description" : "기업회원-재팬리미트파이낸스㈜",
"type" : {
"id" : "001-90010001-000001-0000001",
"registeredOn" : "2016-09-06T01:51:18.000+0000",
"registeredBy" : "001-20160721-163701-0000001",
"modifiedOn" : null,
"modifiedBy" : null,
"name" : "제휴 기업",
"alias" : null,
"description" : "제휴 기업",
"parent" : {
"id" : "001-90010001-000000-0000011",
"registeredOn" : "2016-09-06T01:51:18.000+0000",
"registeredBy" : "001-20160721-163701-0000001",
"modifiedOn" : null,
"modifiedBy" : null,
"name" : "고객 타입",
"alias" : null,
"description" : "고객 타입",
"parent" : {
"id" : "001-90010001-000000-0000010",
"registeredOn" : "2016-09-06T01:51:18.000+0000",
"registeredBy" : "001-20160721-163701-0000001",
"modifiedOn" : null,
"modifiedBy" : null,
"name" : "파티",
"alias" : null,
"description" : "파티 최상위 타입 자체",
"parent" : null
}
}
},
"partnerId" : null,
"status" : "01",
"individualCorporateDivision" : "02",
"informationOfferLevel" : "10",
"signedOnDay" : "20170726",
"signedPath" : "31",
"statusReason" : null,
"addresses" : [ ],
"contacts" : [ ],
"communityInfo" : null,
"individualAgreements" : [ ],
"signup" : null,
"accountabilities" : null,
"businessManRegistrationNo" : "1838700854",
"corporateRegistrationNo" : "1101116464905",
"closeDivision" : "09",
"incorporatedOnDay" : "20170726",
"industryClassification" : null,
"representativeName" : "호세인사로와",
"representativeBirthday" : null,
"typeOfBusiness" : null,
"businessCondition" : null,
"partnerCode" : "000014-01",
"corporateEmployee" : [ ],
"defaultAddress" : null,
"defaultContact" : null
}
@@ -0,0 +1,70 @@
```json
{
"id" : "001-90010001-000001-6000009",
"registeredOn" : "2021-07-19T07:25:53.000+0000",
"registeredBy" : "001-90010009-000000-0000001",
"modifiedOn" : null,
"modifiedBy" : null,
"name" : "재팬리미트파이낸스㈜",
"state" : "01",
"englishName" : null,
"description" : "기업회원-재팬리미트파이낸스㈜",
"type" : {
"id" : "001-90010001-000001-0000001",
"registeredOn" : "2016-09-06T01:51:18.000+0000",
"registeredBy" : "001-20160721-163701-0000001",
"modifiedOn" : null,
"modifiedBy" : null,
"name" : "제휴 기업",
"alias" : null,
"description" : "제휴 기업",
"parent" : {
"id" : "001-90010001-000000-0000011",
"registeredOn" : "2016-09-06T01:51:18.000+0000",
"registeredBy" : "001-20160721-163701-0000001",
"modifiedOn" : null,
"modifiedBy" : null,
"name" : "고객 타입",
"alias" : null,
"description" : "고객 타입",
"parent" : {
"id" : "001-90010001-000000-0000010",
"registeredOn" : "2016-09-06T01:51:18.000+0000",
"registeredBy" : "001-20160721-163701-0000001",
"modifiedOn" : null,
"modifiedBy" : null,
"name" : "파티",
"alias" : null,
"description" : "파티 최상위 타입 자체",
"parent" : null
}
}
},
"partnerId" : null,
"status" : "01",
"individualCorporateDivision" : "02",
"informationOfferLevel" : "10",
"signedOnDay" : "20170726",
"signedPath" : "31",
"statusReason" : null,
"addresses" : [ ],
"contacts" : [ ],
"communityInfo" : null,
"individualAgreements" : [ ],
"signup" : null,
"accountabilities" : null,
"businessManRegistrationNo" : "1838700854",
"corporateRegistrationNo" : "1101116464905",
"closeDivision" : "09",
"incorporatedOnDay" : "20170726",
"industryClassification" : null,
"representativeName" : "호세인사로와",
"representativeBirthday" : null,
"typeOfBusiness" : null,
"businessCondition" : null,
"partnerCode" : "000014-01",
"corporateEmployee" : [ ],
"defaultAddress" : null,
"defaultContact" : null
}
```
@@ -69,4 +69,82 @@ public class KjbProperty {
@KjbPropertyValue(key = "kjb.ums.timeout", defaultValue = "10") @KjbPropertyValue(key = "kjb.ums.timeout", defaultValue = "10")
@Min(1) @Max(30) @Min(1) @Max(30)
private int umsTimeout = 10; private int umsTimeout = 10;
@KjbPropertyValue(key = "kjb.obp.url")
@Pattern(regexp = "^(https?://[^\\s/$.?#][^\\s]*)|\\s*$", message = "kjb.obp.url 는 유효한 URL 형식이거나 공백이어야 합니다. 예: http://example.com/api")
private int obpUrl;
@KjbPropertyValue(key = "kjb.obp.trust_system.key", defaultValue = "x-obp-trust-system")
@NotEmpty
private String obpTrustSystemKey = "x-obp-trust-system";
@KjbPropertyValue(key = "kjb.obp.trust_system.value", defaultValue = "APIMPT-0002-QVBJTVBULTAwMDI=")
@NotEmpty
private String obpTrustSystemValue = "APIMPT-0002-QVBJTVBULTAwMDI=";
@KjbPropertyValue(key = "kjb.obp.partner_code.key", defaultValue = "x-obp-partnercode")
@NotEmpty
private String obpPartnerCodeKey = "x-obp-partnercode";
@KjbPropertyValue(key = "kjb.obp.partner_code.value", defaultValue = "100001-01")
@NotEmpty
private String obpPartnerCodeValue = "100001-01";
@KjbPropertyValue(key = "kjb.obp.url.commission", defaultValue = "/api/billing/billing/findBillingForCondition")
@NotEmpty
private String obpUrlCommission = "/api/billing/billing/findBillingForCondition";
@KjbPropertyValue(key = "kjb.obp.url.commission_print", defaultValue = "/api/billing/billing/findBillingForCondition/print")
@NotEmpty
private String obpUrlCommissionPrint = "/api/billing/billing/findBillingForCondition/print";
@KjbPropertyValue(key = "kjb.obp.url.organization_fmt", defaultValue = "/api/customer/findCustomerByBusinessManRegistrationNo/%s")
@NotEmpty
private String obpUrlOrganizationFmt = "/api/customer/findCustomerByBusinessManRegistrationNo/%s";
} }
@@ -0,0 +1,36 @@
package com.eactive.ext.kjb.obp;
import com.google.gson.JsonObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.stream.Collectors;
@Slf4j
public class KjbObpModule {
/**
* Trim, 숫자이외 자동 치환
* @param bizNo
* @return
*/
public static JsonObject queryOrganization(String bizNo) {
bizNo = ObpUtil.onlyDigit(bizNo);
if (StringUtils.isEmpty(bizNo)) {
throw new IllegalArgumentException("BizNo is not empty.");
}
if (bizNo.length() != 10) {
throw new IllegalArgumentException("BizNo is not valid.");
}
return null;
}
public static void main(String[] args) {
log.info("queryOrganization Test");
queryOrganization("123asd123asd123");
}
}
@@ -0,0 +1,10 @@
package com.eactive.ext.kjb.obp;
import java.util.stream.Collectors;
class ObpUtil {
static String onlyDigit(String str) {
return str == null ? "" :
str.chars().filter(Character::isDigit).mapToObj(c -> String.valueOf((char)c)).collect(Collectors.joining());
}
}
@@ -0,0 +1,22 @@
package com.eactive.ext.kjb.obp.common;
import com.eactive.ext.kjb.common.KjbProperty;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ObpClient {
private static ObpClient _instance;
public synchronized static ObpClient getInstance(KjbProperty kjbProperty) {
if (_instance == null) {
_instance = new ObpClient(kjbProperty);
}
return _instance;
}
private ObpClient(KjbProperty kjbProperty) {
}
}
@@ -0,0 +1,13 @@
package com.eactive.ext.kjb.obp.common;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
@Data
public class ObpResponse {
private String body;
private Map<String, String> headers = new HashMap<>();
private int status;
}