File tree Expand file tree Collapse file tree 11 files changed +253
-5
lines changed
main/java/com/linecorp/bot/module/client
main/java/com/linecorp/bot/shop/client
spring-boot/line-bot-spring-boot-client
src/main/java/com/linecorp/bot/spring/boot/core/configuration Expand file tree Collapse file tree 11 files changed +253
-5
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 LINE Corporation
3+ *
4+ * LINE Corporation licenses this file to you under the Apache License,
5+ * version 2.0 (the "License"); you may not use this file except in compliance
6+ * with the License. You may obtain a copy of the License at:
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+ * License for the specific language governing permissions and limitations
14+ * under the License.
15+ */
16+
17+ plugins {
18+ id(" sdk.openapi" )
19+ id(" sdk.publish" )
20+ }
21+
22+ openApiGenerate {
23+ inputSpec.set(" $rootDir /line-openapi/module.yml" )
24+ apiPackage.set(" com.linecorp.bot.module.client" )
25+ modelPackage.set(" com.linecorp.bot.module.model" )
26+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 LINE Corporation
3+ *
4+ * LINE Corporation licenses this file to you under the Apache License,
5+ * version 2.0 (the "License"); you may not use this file except in compliance
6+ * with the License. You may obtain a copy of the License at:
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+ * License for the specific language governing permissions and limitations
14+ * under the License.
15+ */
16+
17+ package com .linecorp .bot .module .client ;
18+
19+ import com .linecorp .bot .client .base .exception .AbstractLineClientException ;
20+
21+ import okhttp3 .Response ;
22+
23+ /**
24+ * An API call exception for module API.
25+ */
26+ @ SuppressWarnings ("serial" )
27+ public class LineModuleClientException extends AbstractLineClientException {
28+ public LineModuleClientException (Response response ) {
29+ super (response , "An error occurred." );
30+ }
31+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 LINE Corporation
3+ *
4+ * LINE Corporation licenses this file to you under the Apache License,
5+ * version 2.0 (the "License"); you may not use this file except in compliance
6+ * with the License. You may obtain a copy of the License at:
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+ * License for the specific language governing permissions and limitations
14+ * under the License.
15+ */
16+
17+ package com .linecorp .bot .module .client ;
18+
19+ import java .io .IOException ;
20+
21+ import com .linecorp .bot .client .base .AbstractExceptionBuilder ;
22+
23+ import okhttp3 .Response ;
24+
25+ public class LineModuleExceptionBuilder extends AbstractExceptionBuilder <Object > {
26+ public LineModuleExceptionBuilder () {
27+ super (Object .class );
28+ }
29+
30+ @ Override
31+ protected IOException buildException (Response response , Object errorBody ) {
32+ return new LineModuleClientException (response );
33+ }
34+ }
Original file line number Diff line number Diff line change 1+ <configuration >
2+ <appender name =" STDOUT" class =" ch.qos.logback.core.ConsoleAppender" >
3+ <encoder >
4+ <pattern >%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern >
5+ </encoder >
6+ </appender >
7+
8+ <root level =" info" >
9+ <appender-ref ref =" STDOUT" />
10+ </root >
11+ </configuration >
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 LINE Corporation
3+ *
4+ * LINE Corporation licenses this file to you under the Apache License,
5+ * version 2.0 (the "License"); you may not use this file except in compliance
6+ * with the License. You may obtain a copy of the License at:
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+ * License for the specific language governing permissions and limitations
14+ * under the License.
15+ */
16+
17+ plugins {
18+ id(" sdk.openapi" )
19+ id(" sdk.publish" )
20+ }
21+
22+ openApiGenerate {
23+ inputSpec.set(" $rootDir /line-openapi/shop.yml" )
24+ apiPackage.set(" com.linecorp.bot.shop.client" )
25+ modelPackage.set(" com.linecorp.bot.shop.model" )
26+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 LINE Corporation
3+ *
4+ * LINE Corporation licenses this file to you under the Apache License,
5+ * version 2.0 (the "License"); you may not use this file except in compliance
6+ * with the License. You may obtain a copy of the License at:
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+ * License for the specific language governing permissions and limitations
14+ * under the License.
15+ */
16+
17+ package com .linecorp .bot .shop .client ;
18+
19+ import com .linecorp .bot .client .base .exception .AbstractLineClientException ;
20+
21+ import okhttp3 .Response ;
22+
23+ /**
24+ * An API call exception for shop API.
25+ */
26+ @ SuppressWarnings ("serial" )
27+ public class ShopClientException extends AbstractLineClientException {
28+ /**
29+ * An error summary.
30+ */
31+ private final String error ;
32+
33+ public ShopClientException (Response response , String error ) {
34+ super (response , "error='" + error );
35+ this .error = error ;
36+ }
37+
38+ public String getError () {
39+ return error ;
40+ }
41+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 LINE Corporation
3+ *
4+ * LINE Corporation licenses this file to you under the Apache License,
5+ * version 2.0 (the "License"); you may not use this file except in compliance
6+ * with the License. You may obtain a copy of the License at:
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+ * License for the specific language governing permissions and limitations
14+ * under the License.
15+ */
16+
17+ package com .linecorp .bot .shop .client ;
18+
19+ import java .io .IOException ;
20+
21+ import com .linecorp .bot .client .base .AbstractExceptionBuilder ;
22+ import com .linecorp .bot .shop .model .ErrorResponse ;
23+
24+ import okhttp3 .Response ;
25+
26+ public class ShopExceptionBuilder extends AbstractExceptionBuilder <ErrorResponse > {
27+ public ShopExceptionBuilder () {
28+ super (ErrorResponse .class );
29+ }
30+
31+ @ Override
32+ protected IOException buildException (Response response , ErrorResponse errorBody ) {
33+ return new ShopClientException (response , errorBody .message ());
34+ }
35+ }
Original file line number Diff line number Diff line change 1+ <configuration >
2+ <appender name =" STDOUT" class =" ch.qos.logback.core.ConsoleAppender" >
3+ <encoder >
4+ <pattern >%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern >
5+ </encoder >
6+ </appender >
7+
8+ <root level =" info" >
9+ <appender-ref ref =" STDOUT" />
10+ </root >
11+ </configuration >
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ dependencyResolutionManagement {
3939enableFeaturePreview(" TYPESAFE_PROJECT_ACCESSORS" )
4040
4141// core components
42- include(" line-bot-parser" )
4342include(" line-bot-jackson" )
43+ include(" line-bot-parser" )
4444
4545// openapi based webhook
4646include(" line-bot-webhook" )
@@ -51,6 +51,8 @@ include("clients:line-bot-insight-client")
5151include(" clients:line-bot-manage-audience-client" )
5252include(" clients:line-bot-messaging-api-client" )
5353include(" clients:line-bot-module-attach-client" )
54+ include(" clients:line-bot-module-client" )
55+ include(" clients:line-bot-shop-client" )
5456include(" clients:line-channel-access-token-client" )
5557include(" clients:line-liff-client" )
5658
@@ -61,10 +63,10 @@ include("spring-boot:line-bot-spring-boot-web")
6163include(" spring-boot:line-bot-spring-boot-webmvc" )
6264
6365// samples
66+ include(" samples:sample-manage-audience" )
6467include(" samples:sample-spring-boot-echo" )
6568include(" samples:sample-spring-boot-echo-kotlin" )
6669include(" samples:sample-spring-boot-kitchensink" )
67- include(" samples:sample-manage-audience" )
6870
6971// integration test
7072include(" line-bot-integration-test" )
Original file line number Diff line number Diff line change @@ -24,13 +24,14 @@ dependencies {
2424 annotationProcessor(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin .BOM_COORDINATES ))
2525
2626 api(project(" :clients:line-bot-client-base" ))
27- api(project(" :clients:line-liff-client" ))
2827 api(project(" :clients:line-bot-insight-client" ))
29- api(project(" :clients:line-channel-access-token-client" ))
3028 api(project(" :clients:line-bot-manage-audience-client" ))
3129 api(project(" :clients:line-bot-messaging-api-client" ))
3230 api(project(" :clients:line-bot-module-attach-client" ))
33- api(project(" :clients:line-bot-client-base" ))
31+ api(project(" :clients:line-bot-module-client" ))
32+ api(project(" :clients:line-bot-shop-client" ))
33+ api(project(" :clients:line-channel-access-token-client" ))
34+ api(project(" :clients:line-liff-client" ))
3435
3536 implementation(" org.springframework.boot:spring-boot-autoconfigure" )
3637 implementation(" org.springframework.boot:spring-boot-starter" )
You can’t perform that action at this time.
0 commit comments