diff --git a/kjb-docs/obp-query-partner/README.md b/kjb-docs/obp-query-partner/README.md new file mode 100644 index 0000000..8a6bcd6 --- /dev/null +++ b/kjb-docs/obp-query-partner/README.md @@ -0,0 +1 @@ +- API Client 그대로 구현 \ No newline at end of file diff --git a/kjb-docs/obp-query-partner/organizationFromObp.http b/kjb-docs/obp-query-partner/organizationFromObp.http new file mode 100644 index 0000000..56ce58a --- /dev/null +++ b/kjb-docs/obp-query-partner/organizationFromObp.http @@ -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 +} \ No newline at end of file diff --git a/kjb-docs/obp-query-partner/organizationFromObp.md b/kjb-docs/obp-query-partner/organizationFromObp.md new file mode 100644 index 0000000..d0bef76 --- /dev/null +++ b/kjb-docs/obp-query-partner/organizationFromObp.md @@ -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 +} +``` \ No newline at end of file diff --git a/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java b/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java index f848d93..7b3459b 100644 --- a/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java +++ b/src/main/java/com/eactive/ext/kjb/common/KjbProperty.java @@ -69,4 +69,82 @@ public class KjbProperty { @KjbPropertyValue(key = "kjb.ums.timeout", defaultValue = "10") @Min(1) @Max(30) 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"; } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/eactive/ext/kjb/obp/KjbObpModule.java b/src/main/java/com/eactive/ext/kjb/obp/KjbObpModule.java new file mode 100644 index 0000000..2cb1340 --- /dev/null +++ b/src/main/java/com/eactive/ext/kjb/obp/KjbObpModule.java @@ -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"); + } +} diff --git a/src/main/java/com/eactive/ext/kjb/obp/ObpUtil.java b/src/main/java/com/eactive/ext/kjb/obp/ObpUtil.java new file mode 100644 index 0000000..e8cefde --- /dev/null +++ b/src/main/java/com/eactive/ext/kjb/obp/ObpUtil.java @@ -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()); + } +} diff --git a/src/main/java/com/eactive/ext/kjb/obp/common/ObpClient.java b/src/main/java/com/eactive/ext/kjb/obp/common/ObpClient.java new file mode 100644 index 0000000..f0b04c3 --- /dev/null +++ b/src/main/java/com/eactive/ext/kjb/obp/common/ObpClient.java @@ -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) { + + } +} diff --git a/src/main/java/com/eactive/ext/kjb/obp/common/ObpResponse.java b/src/main/java/com/eactive/ext/kjb/obp/common/ObpResponse.java new file mode 100644 index 0000000..ab52836 --- /dev/null +++ b/src/main/java/com/eactive/ext/kjb/obp/common/ObpResponse.java @@ -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 headers = new HashMap<>(); + private int status; +}