Skip to content

Commit bce64a1

Browse files
committed
更新框架文档
1 parent ec8ed4c commit bce64a1

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

HelpDoc.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ public class RequestServer implements IRequestServer {
160160

161161
@NonNull
162162
@Override
163-
public BodyType getBodyType() {
163+
public RequestBodyType getBodyType() {
164164
// 参数以 Json 格式提交(默认是表单)
165-
return BodyType.JSON;
165+
return RequestBodyType.JSON;
166166
}
167167
}
168168
```
@@ -325,9 +325,9 @@ public final class UpdateImageApi implements IRequestApi, IRequestType {
325325

326326
@NonNull
327327
@Override
328-
public BodyType getBodyType() {
328+
public RequestBodyType getBodyType() {
329329
// 上传文件需要使用表单的形式提交
330-
return BodyType.FORM;
330+
return RequestBodyType.FORM;
331331
}
332332

333333
/** 本地图片 */
@@ -870,8 +870,8 @@ public class XxxServer implements IRequestServer {
870870

871871
@NonNull
872872
@Override
873-
public BodyType getBodyType() {
874-
return BodyType.FORM;
873+
public RequestBodyType getBodyType() {
874+
return RequestBodyType.FORM;
875875
}
876876
}
877877
```
@@ -889,8 +889,8 @@ public class XxxServer implements IRequestServer {
889889

890890
@NonNull
891891
@Override
892-
public BodyType getBodyType() {
893-
return BodyType.JSON;
892+
public RequestBodyType getBodyType() {
893+
return RequestBodyType.JSON;
894894
}
895895
}
896896
```
@@ -908,8 +908,8 @@ public final class XxxApi implements IRequestApi, IRequestType {
908908

909909
@NonNull
910910
@Override
911-
public BodyType getBodyType() {
912-
return BodyType.JSON;
911+
public RequestBodyType getBodyType() {
912+
return RequestBodyType.JSON;
913913
}
914914
}
915915
```
@@ -1474,7 +1474,7 @@ EasyHttp.post(this)
14741474
EasyHttp.post(this)
14751475
.api(new XxxApi())
14761476
// 表示回调是在子线程中进行
1477-
.schedulers(ThreadSchedulers.IOThread)
1477+
.schedulers(ThreadSchedulers.IO)
14781478
.request(new HttpCallbackProxy<HttpData<Xxx>>(this) {
14791479

14801480
@Override

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

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

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

99
![](picture/demo_code.png)
1010

@@ -61,7 +61,7 @@ android {
6161
6262
dependencies {
6363
// 网络请求框架:https://github.com/getActivity/EasyHttp
64-
implementation 'com.github.getActivity:EasyHttp:12.2'
64+
implementation 'com.github.getActivity:EasyHttp:12.5'
6565
// OkHttp 框架:https://github.com/square/okhttp
6666
// noinspection GradleDependency
6767
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
@@ -84,9 +84,9 @@ dependencies {
8484

8585
| 功能或细节 | [EasyHttp](https://github.com/getActivity/EasyHttp) | [Retrofit](https://github.com/square/retrofit) | [OkGo](https://github.com/jeasonlzy/okhttp-OkGo) |
8686
| :----: | :------: | :-----: | :-----: |
87-
| 对应版本 | 12.2 | 2.9.0 | 3.0.4 |
87+
| 对应版本 | 12.5 | 2.9.0 | 3.0.4 |
8888
| 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) |
89-
| **aar 包大小** | 90 KB | 123 KB | 131 KB |
89+
| **aar 包大小** | 92 KB | 123 KB | 131 KB |
9090
| minSdk 要求 | API 14+ | API 21+ | API 14+ |
9191
| 配置多域名 ||||
9292
| **动态 Host** ||||

build.gradle

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,25 @@ allprojects {
3232
jcenter()
3333
}
3434

35-
// 将构建文件统一输出到项目根目录下的 build 文件夹
36-
setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}"))
35+
// 读取 local.properties 文件配置
36+
def properties = new Properties()
37+
def localPropertiesFile = rootProject.file("local.properties")
38+
if (localPropertiesFile.exists()) {
39+
localPropertiesFile.withInputStream { inputStream ->
40+
properties.load(inputStream)
41+
}
42+
}
43+
44+
String buildDirPath = properties.getProperty("build.dir")
45+
if (buildDirPath != null && buildDirPath != "") {
46+
// 将构建文件统一输出到指定的目录下
47+
setBuildDir(new File(buildDirPath, rootProject.name + "/build/${path.replaceAll(':', '/')}"))
48+
} else {
49+
// 将构建文件统一输出到项目根目录下的 build 文件夹
50+
setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}"))
51+
}
3752
}
3853

39-
task clean(type: Delete) {
54+
tasks.register('clean', Delete) {
4055
delete rootProject.buildDir
4156
}

0 commit comments

Comments
 (0)