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 {
39
39
enableFeaturePreview(" TYPESAFE_PROJECT_ACCESSORS" )
40
40
41
41
// core components
42
- include(" line-bot-parser" )
43
42
include(" line-bot-jackson" )
43
+ include(" line-bot-parser" )
44
44
45
45
// openapi based webhook
46
46
include(" line-bot-webhook" )
@@ -51,6 +51,8 @@ include("clients:line-bot-insight-client")
51
51
include(" clients:line-bot-manage-audience-client" )
52
52
include(" clients:line-bot-messaging-api-client" )
53
53
include(" clients:line-bot-module-attach-client" )
54
+ include(" clients:line-bot-module-client" )
55
+ include(" clients:line-bot-shop-client" )
54
56
include(" clients:line-channel-access-token-client" )
55
57
include(" clients:line-liff-client" )
56
58
@@ -61,10 +63,10 @@ include("spring-boot:line-bot-spring-boot-web")
61
63
include(" spring-boot:line-bot-spring-boot-webmvc" )
62
64
63
65
// samples
66
+ include(" samples:sample-manage-audience" )
64
67
include(" samples:sample-spring-boot-echo" )
65
68
include(" samples:sample-spring-boot-echo-kotlin" )
66
69
include(" samples:sample-spring-boot-kitchensink" )
67
- include(" samples:sample-manage-audience" )
68
70
69
71
// integration test
70
72
include(" line-bot-integration-test" )
Original file line number Diff line number Diff line change @@ -24,13 +24,14 @@ dependencies {
24
24
annotationProcessor(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin .BOM_COORDINATES ))
25
25
26
26
api(project(" :clients:line-bot-client-base" ))
27
- api(project(" :clients:line-liff-client" ))
28
27
api(project(" :clients:line-bot-insight-client" ))
29
- api(project(" :clients:line-channel-access-token-client" ))
30
28
api(project(" :clients:line-bot-manage-audience-client" ))
31
29
api(project(" :clients:line-bot-messaging-api-client" ))
32
30
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" ))
34
35
35
36
implementation(" org.springframework.boot:spring-boot-autoconfigure" )
36
37
implementation(" org.springframework.boot:spring-boot-starter" )
You can’t perform that action at this time.
0 commit comments