Skip to content

Commit

Permalink
更新框架文档
Browse files Browse the repository at this point in the history
  • Loading branch information
getActivity committed Oct 5, 2023
1 parent ec8ed4c commit bce64a1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
22 changes: 11 additions & 11 deletions HelpDoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ public class RequestServer implements IRequestServer {

@NonNull
@Override
public BodyType getBodyType() {
public RequestBodyType getBodyType() {
// 参数以 Json 格式提交(默认是表单)
return BodyType.JSON;
return RequestBodyType.JSON;
}
}
```
Expand Down Expand Up @@ -325,9 +325,9 @@ public final class UpdateImageApi implements IRequestApi, IRequestType {

@NonNull
@Override
public BodyType getBodyType() {
public RequestBodyType getBodyType() {
// 上传文件需要使用表单的形式提交
return BodyType.FORM;
return RequestBodyType.FORM;
}

/** 本地图片 */
Expand Down Expand Up @@ -870,8 +870,8 @@ public class XxxServer implements IRequestServer {

@NonNull
@Override
public BodyType getBodyType() {
return BodyType.FORM;
public RequestBodyType getBodyType() {
return RequestBodyType.FORM;
}
}
```
Expand All @@ -889,8 +889,8 @@ public class XxxServer implements IRequestServer {

@NonNull
@Override
public BodyType getBodyType() {
return BodyType.JSON;
public RequestBodyType getBodyType() {
return RequestBodyType.JSON;
}
}
```
Expand All @@ -908,8 +908,8 @@ public final class XxxApi implements IRequestApi, IRequestType {

@NonNull
@Override
public BodyType getBodyType() {
return BodyType.JSON;
public RequestBodyType getBodyType() {
return RequestBodyType.JSON;
}
}
```
Expand Down Expand Up @@ -1474,7 +1474,7 @@ EasyHttp.post(this)
EasyHttp.post(this)
.api(new XxxApi())
// 表示回调是在子线程中进行
.schedulers(ThreadSchedulers.IOThread)
.schedulers(ThreadSchedulers.IO)
.request(new HttpCallbackProxy<HttpData<Xxx>>(this) {

@Override
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

* 博客地址:[网络请求,如斯优雅](https://www.jianshu.com/p/93cd59dec002)

* 可以扫码下载 Demo 进行演示或者测试,如果扫码下载不了的,[点击此处下载Demo](https://github.com/getActivity/EasyHttp/releases/download/12.2/EasyHttp.apk)
* 可以扫码下载 Demo 进行演示或者测试,如果扫码下载不了的,[点击此处下载Demo](https://github.com/getActivity/EasyHttp/releases/download/12.5/EasyHttp.apk)

![](picture/demo_code.png)

Expand Down Expand Up @@ -61,7 +61,7 @@ android {
dependencies {
// 网络请求框架:https://github.com/getActivity/EasyHttp
implementation 'com.github.getActivity:EasyHttp:12.2'
implementation 'com.github.getActivity:EasyHttp:12.5'
// OkHttp 框架:https://github.com/square/okhttp
// noinspection GradleDependency
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
Expand All @@ -84,9 +84,9 @@ dependencies {

| 功能或细节 | [EasyHttp](https://github.com/getActivity/EasyHttp) | [Retrofit](https://github.com/square/retrofit) | [OkGo](https://github.com/jeasonlzy/okhttp-OkGo) |
| :----: | :------: | :-----: | :-----: |
| 对应版本 | 12.2 | 2.9.0 | 3.0.4 |
| 对应版本 | 12.5 | 2.9.0 | 3.0.4 |
| issues 数 | [![](https://img.shields.io/github/issues/getActivity/EasyHttp.svg)](https://github.com/getActivity/EasyHttp/issues) | [![](https://img.shields.io/github/issues/square/retrofit.svg)](https://github.com/square/retrofit/issues) | [![](https://img.shields.io/github/issues/jeasonlzy/okhttp-OkGo.svg)](https://github.com/jeasonlzy/okhttp-OkGo/issues) |
| **aar 包大小** | 90 KB | 123 KB | 131 KB |
| **aar 包大小** | 92 KB | 123 KB | 131 KB |
| minSdk 要求 | API 14+ | API 21+ | API 14+ |
| 配置多域名 ||||
| **动态 Host** ||||
Expand Down
21 changes: 18 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,25 @@ allprojects {
jcenter()
}

// 将构建文件统一输出到项目根目录下的 build 文件夹
setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}"))
// 读取 local.properties 文件配置
def properties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withInputStream { inputStream ->
properties.load(inputStream)
}
}

String buildDirPath = properties.getProperty("build.dir")
if (buildDirPath != null && buildDirPath != "") {
// 将构建文件统一输出到指定的目录下
setBuildDir(new File(buildDirPath, rootProject.name + "/build/${path.replaceAll(':', '/')}"))
} else {
// 将构建文件统一输出到项目根目录下的 build 文件夹
setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}"))
}
}

task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}

0 comments on commit bce64a1

Please sign in to comment.