datagokr-api-b090041-lrsrcldinfoservice-client-spring

a client library for accessing LrSrCldInfoService

License

License

Categories

Categories

Data CLI User Interface
GroupId

GroupId

com.github.jinahya
ArtifactId

ArtifactId

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

Last Version

0.6.0
Release Date

Release Date

Type

Type

jar
Description

Description

datagokr-api-b090041-lrsrcldinfoservice-client-spring
a client library for accessing LrSrCldInfoService
Project URL

Project URL

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

Project Organization

Jinahya, Inc.
Source Code Management

Source Code Management

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

Download datagokr-api-b090041-lrsrcldinfoservice-client-spring

How to add to project

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

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-lrsrcldinfoservice-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/LrsrCldInfoService.

See 음양력정보(data.go.kr) and/or 월별음약력(천문연구원).

Verify

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

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

You may put your service key on src/test/resources/failsafe.system.properties, which is git-ignored, like this,

serviceKey=...

and verify like this.

$ mvn -Pfailsafe clean verify

Injection points

Common

Qualifier Type Notes
@LrsrCldInfoServiceServiceKey java.lang.String Provided by the service provider

For LrsrCldInfoServiceClient with RestTemplate

Qualifier Type Notes
@LrsrCldInfoServiceRestTemplate RestTemplate
@LrsrCldInfoServiceRestTemplateRootUri String Optional

For LrsrCldInfoServiceReactiveClient with WebClient

Qualifier Type Notes
@LrsrCldInfoServiceWebClient 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.

@AbstractLrsrCldInfoServiceClient.LrsrCldInfoServiceServiceKey
@Bean
public String lrsrCldInfoServiceServiceKey(){
    // 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 LrsrCldInfoServiceClient with RestTemplate

Provide an instance of RestTemplate.

@LrsrCldInfoServiceRestTemplate
@Bean
public RestTemplate lrsrCldInfoServiceRestTemplate() {
    return new RestTemplateBuilder()
            ...
            .rootUri(AbstractLrsrCldInfoServiceClient.BASE_URL_PRODUCTION)
            .build();
}

Get @Autowired with an instance of LrsrCldInfoServiceClient which is internally got autowired with the RestTemplate instance.

@Autowired
private LrsrCldInfoServiceClient client;

Using LrsrCldInfoServiceReactiveClient with WebClient

Provide an instance of WebClient.

@LrsrCldInfoServiceWebClient
@Bean
public WebClient lrsrCldInfoServiceWebClient() {
    return WebClient.builder()
            ...
            .baseUrl(AbstractLrsrCldInfoServiceClient.BASE_URL_PRODUCTION)
            .build();
}

Get @Autowired with an instance of LrsrCldInfoServiceReactiveClient which is internally got autowired with the WebClient instance.

@Autowired
private LrsrCldInfoServiceReactiveClient client;

Versions

Version
0.6.0
0.5.0
0.4.2
0.4.0
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.3
0.2.1
0.2.0
0.1.3
0.1.2
0.1.1
0.1.0
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1