Skip to content

Commit

Permalink
feat(内核): 换模拟数据端点
Browse files Browse the repository at this point in the history
  • Loading branch information
qianmoQ committed Feb 4, 2025
1 parent 3d39525 commit edde5f2
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/content/getting-started/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Post> posts = service.getPosts();
Expand Down
2 changes: 1 addition & 1 deletion docs/content/getting-started/processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```
2 changes: 1 addition & 1 deletion docs/content/usage/error.md
Original file line number Diff line number Diff line change
Expand Up @@ -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());
```

Expand Down
2 changes: 1 addition & 1 deletion docs/content/usage/interceptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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());
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package org.devlive.lightcall.example;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class PostModel
implements Serializable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
public interface PartService
{
@Post("/upload")
String apply(@Part("file") File file);
Object apply(@Part("file") File file);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,7 +24,7 @@ void testFileUpload(@TempDir Path tempDir)
testFile.createNewFile();

// 测试文件上传
String response = service.apply(testFile);
Object response = service.apply(testFile);
Assertions.assertNotNull(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit edde5f2

Please sign in to comment.