diff --git a/docs/content/getting-started/get-started.md b/docs/content/getting-started/get-started.md index 800d7b9..68622a1 100644 --- a/docs/content/getting-started/get-started.md +++ b/docs/content/getting-started/get-started.md @@ -41,7 +41,7 @@ public interface PostService --- ```java -private final LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com"); +private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org"); private final PostService service = LightCall.create(PostService.class, config); List posts = service.getPosts(); diff --git a/docs/content/getting-started/processor.md b/docs/content/getting-started/processor.md index 562ec38..d78b8c5 100644 --- a/docs/content/getting-started/processor.md +++ b/docs/content/getting-started/processor.md @@ -97,6 +97,6 @@ public class OptionsProcessor ### 注册处理器 ```java -LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com") +LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org") .addProcessor(OptionsProcessor.class); ``` \ No newline at end of file diff --git a/docs/content/usage/error.md b/docs/content/usage/error.md index c1d6711..c505d3f 100644 --- a/docs/content/usage/error.md +++ b/docs/content/usage/error.md @@ -21,7 +21,7 @@ LightCall 支持错误处理。 !!! ```java -LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com") +LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org") .addErrorHandler(new DefaultErrorHandler()); ``` diff --git a/docs/content/usage/interceptor.md b/docs/content/usage/interceptor.md index 7505f14..988d98c 100644 --- a/docs/content/usage/interceptor.md +++ b/docs/content/usage/interceptor.md @@ -21,7 +21,7 @@ LightCall 支持拦截器,可以在请求和响应之前做一些操作 !!! ```java -LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com") +LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org") .addInterceptor(new LoggingInterceptor()); ``` diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/PostModel.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/PostModel.java index bcf1ba8..1daefc6 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/PostModel.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/PostModel.java @@ -1,5 +1,6 @@ package org.devlive.lightcall.example; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; @@ -7,6 +8,7 @@ @Data @JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) public class PostModel implements Serializable { diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/delete/DeleteServiceTest.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/delete/DeleteServiceTest.java index 3e14adf..fb03f70 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/delete/DeleteServiceTest.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/delete/DeleteServiceTest.java @@ -7,7 +7,7 @@ class DeleteServiceTest { - private final LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com"); + private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org"); private final DeleteService service = LightCall.create(DeleteService.class, config); @Test diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/get/GetServiceTest.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/get/GetServiceTest.java index fd7818e..90ae69c 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/get/GetServiceTest.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/get/GetServiceTest.java @@ -7,7 +7,7 @@ class GetServiceTest { - private final LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com"); + private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org"); private final GetService service = LightCall.create(GetService.class, config); @Test diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/head/HeadServiceTest.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/head/HeadServiceTest.java index 2210d36..b47c1e9 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/head/HeadServiceTest.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/head/HeadServiceTest.java @@ -7,7 +7,7 @@ class HeadServiceTest { - private final LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com"); + private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org"); private final HeadService service = LightCall.create(HeadService.class, config); @Test diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/interceptor/LightCallInterceptorTest.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/interceptor/LightCallInterceptorTest.java index 3a17a57..6c2ce66 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/interceptor/LightCallInterceptorTest.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/interceptor/LightCallInterceptorTest.java @@ -8,7 +8,7 @@ class LightCallInterceptorTest { - private final LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com") + private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org") .addInterceptor(new LoggingInterceptor()); private final GetService service = LightCall.create(GetService.class, config); diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/options/OptionsServiceTest.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/options/OptionsServiceTest.java index 08103cb..50db433 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/options/OptionsServiceTest.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/options/OptionsServiceTest.java @@ -7,7 +7,7 @@ class OptionsServiceTest { - private final LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com"); + private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org"); private final OptionsService service = LightCall.create(OptionsService.class, config); @Test diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/part/PartService.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/part/PartService.java index 4f6e359..5ba2b11 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/part/PartService.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/part/PartService.java @@ -8,5 +8,5 @@ public interface PartService { @Post("/upload") - String apply(@Part("file") File file); + Object apply(@Part("file") File file); } diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/part/PartServiceTest.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/part/PartServiceTest.java index a6667f0..c120862 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/part/PartServiceTest.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/part/PartServiceTest.java @@ -12,7 +12,7 @@ class PartServiceTest { // 使用一个支持文件上传的测试服务 - private final LightCallConfig config = LightCallConfig.create("https://httpbin.org"); + private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org"); private final PartService service = LightCall.create(PartService.class, config); @Test @@ -24,7 +24,7 @@ void testFileUpload(@TempDir Path tempDir) testFile.createNewFile(); // 测试文件上传 - String response = service.apply(testFile); + Object response = service.apply(testFile); Assertions.assertNotNull(response); } } \ No newline at end of file diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/patch/PatchServiceTest.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/patch/PatchServiceTest.java index a4ec226..b04c9af 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/patch/PatchServiceTest.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/patch/PatchServiceTest.java @@ -8,7 +8,7 @@ class PatchServiceTest { - private final LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com"); + private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org"); private final PatchService service = LightCall.create(PatchService.class, config); @Test diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/post/PostServiceTest.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/post/PostServiceTest.java index 699f6dc..6ccbd7d 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/post/PostServiceTest.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/post/PostServiceTest.java @@ -8,7 +8,7 @@ class PostServiceTest { - private final LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com"); + private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org"); private final PostService service = LightCall.create(PostService.class, config); @Test diff --git a/lightcall-core/src/test/java/org/devlive/lightcall/example/put/PutServiceTest.java b/lightcall-core/src/test/java/org/devlive/lightcall/example/put/PutServiceTest.java index 2a51c8a..4475083 100644 --- a/lightcall-core/src/test/java/org/devlive/lightcall/example/put/PutServiceTest.java +++ b/lightcall-core/src/test/java/org/devlive/lightcall/example/put/PutServiceTest.java @@ -8,7 +8,7 @@ class PutServiceTest { - private final LightCallConfig config = LightCallConfig.create("https://jsonplaceholder.typicode.com"); + private final LightCallConfig config = LightCallConfig.create("http://mockaroo.devlive.org"); private final PutService service = LightCall.create(PutService.class, config); @Test