datagokr-api-b090041-spcdeinfoservice-client-spring

a client library for accessing http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService

License

License

Categories

Categories

Data CLI User Interface
GroupId

GroupId

com.github.jinahya
ArtifactId

ArtifactId

datagokr-api-b090041-spcdeinfoservice-client-spring
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

datagokr-api-b090041-spcdeinfoservice-client-spring
a client library for accessing http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService
Project URL

Project URL

https://github.com/jinahya/datagokr-api-b090041-spcdeinfoservice-client-spring
Project Organization

Project Organization

Jinahya, Inc.
Source Code Management

Source Code Management

https://github.com/jinahya/datagokr-api-b090041-spcdeinfoservice-client-spring

Download datagokr-api-b090041-spcdeinfoservice-client-spring

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jinahya/datagokr-api-b090041-spcdeinfoservice-client-spring/ -->
<dependency>
    <groupId>com.github.jinahya</groupId>
    <artifactId>datagokr-api-b090041-spcdeinfoservice-client-spring</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.jinahya/datagokr-api-b090041-spcdeinfoservice-client-spring/
implementation 'com.github.jinahya:datagokr-api-b090041-spcdeinfoservice-client-spring:0.0.1'
// https://jarcasting.com/artifacts/com.github.jinahya/datagokr-api-b090041-spcdeinfoservice-client-spring/
implementation ("com.github.jinahya:datagokr-api-b090041-spcdeinfoservice-client-spring:0.0.1")
'com.github.jinahya:datagokr-api-b090041-spcdeinfoservice-client-spring:jar:0.0.1'
<dependency org="com.github.jinahya" name="datagokr-api-b090041-spcdeinfoservice-client-spring" rev="0.0.1">
  <artifact name="datagokr-api-b090041-spcdeinfoservice-client-spring" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.jinahya', module='datagokr-api-b090041-spcdeinfoservice-client-spring', version='0.0.1')
)
libraryDependencies += "com.github.jinahya" % "datagokr-api-b090041-spcdeinfoservice-client-spring" % "0.0.1"
[com.github.jinahya/datagokr-api-b090041-spcdeinfoservice-client-spring "0.0.1"]

Dependencies

provided (8)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.11.4
jakarta.annotation : jakarta.annotation-api jar 1.3.5
jakarta.xml.bind : jakarta.xml.bind-api jar 2.3.3
jakarta.validation : jakarta.validation-api jar 2.0.2
org.projectlombok : lombok jar 1.18.16
org.slf4j : slf4j-api jar 1.7.30
org.springframework : spring-context jar 5.3.3
org.springframework : spring-webflux jar 5.3.3

test (5)

Group / Artifact Type Version
org.glassfish.jaxb : jaxb-runtime jar 2.3.3
org.springframework.boot : spring-boot-starter-test jar 2.4.2
org.springframework.boot : spring-boot-starter-webflux jar 2.4.2
org.springframework.boot : spring-boot-starter-validation jar 2.4.2
org.xerial : sqlite-jdbc jar 3.34.0

Project Modules

There are no modules declared in this project.

b090041-spcdeinfoservice-client-spring

Java CI with Maven Quality Gate Status Maven Central javadoc

A client library for accessing http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService.

See 특일정보(공공데이터포털) and/or 달력자료(한국천문연구원).

Verify

Verify with your own service key assigned by the service provider.

$ mvn -Pfailsafe -DservcieKey=... clean verify

Injection points

Common

Qualifier Type Notes
@SpcdeInfoServiceServiceKey String Provided by the service provider

For SpcdeInfoServiceClient with RestTemplate

Qualifier Type Notes
@SpcdeInfoServiceRestTemplate RestTemplate
@SpcdeInfoServiceRestTemplateRootUri String Optional

For SpcdeInfoServiceReactiveClient with WebClient

Qualifier Type Notes
@SpcdeInfoServiceWebClient WebClient

Usages

Expand the component-scanning path.

@SpringBootApplication(
        scanBasePackageClasses = {
                com.github.jinahya.datagokr.....client.NoOp.class,
                MyApplication.class
        }
)
class MyApplication {

}

Provide the service key assigned by the service provider. Note that the service provider may give you a URL-encoded value. You should use a URL-decoded value.

@SpcdeInfoServiceServiceKey
@Bean
String spcdeInfoServiceServiceKey(){
        // The service key assigned by data.go.kr
        // Might be already URL-encoded
        // Use a URL-decoded value    
        // return "...%3D%3D"; (X)
        // return "...==";     (O)
        }

Using SpcdeInfoServiceClient with RestTeamplate

Provide an instance of RestTemplate qualified with @SpcdeInfoServiceRestTemplate.

@SpcdeInfoServiceRestTemplate
@Bean
RestTemplate spcdeInfoServiceRestTemplate(){
        return new RestTemplateBuilder()
        ...
        .rootUri(AbstractSpcdeInfoServiceClient.BASE_URL_PRODUCTION)
        .defaultHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML_VALUE)
        .build();
        }

Get @Autowired with an instance of SpcdeInfoServiceClient which is internally get autowired with the RestTemplate instance.

@Autowired
private SpcdeInfoServiceClient client;

Using SpcdeInfoServiceReactiveClient with WebClient

Provide an instance of WebClient qualified with @SpcdeInfoServiceWebClient.

@SpcdeInfoServiceWebClient
@Bean
WebClient spcdeInfoServiceWebClient(){
        return WebClient.builder()
        ...
        .baseUrl(AbstractSpcdeInfoServiceClient.BASE_URL_PRODUCTION)
        .defaultHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML_VALUE)
        .build();
        }

Get @Autowired with an instance of SpcdeInfoServiceReactiveClient which is internally get autowired with the WebClient instance.

@Autowired
private SpcdeInfoServiceReactiveClient client;

Versions

Version
0.0.1