From 4448f98cd3cfac11e15389c9e7d6f397b61f7ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Android=20=E8=BD=AE=E5=AD=90=E5=93=A5?= Date: Mon, 8 Nov 2021 17:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Json=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=20Bean=20=E7=B1=BB=E5=8F=82=E6=95=B0=E8=A2=AB=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E6=88=90=20String=20=E7=B1=BB=E5=9E=8B=E7=9A=84=20Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- app/build.gradle | 4 ++-- library/build.gradle | 4 ++-- library/src/main/java/com/hjq/http/EasyUtils.java | 5 ++++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 39ed744..147f1ae 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * 博客地址:[网络请求,如斯优雅](https://www.jianshu.com/p/93cd59dec002) -* [点击此处下载Demo](https://github.com/getActivity/EasyHttp/releases/download/10.5/EasyHttp.apk) +* * 可以扫码下载 Demo 进行演示或者测试,如果扫码下载不了的,[点击此处下载Demo](https://github.com/getActivity/EasyHttp/releases/download/10.6/EasyHttp.apk) ![](picture/demo_code.png) @@ -54,7 +54,7 @@ android { dependencies { // 网络请求框架:https://github.com/getActivity/EasyHttp - implementation 'com.github.getActivity:EasyHttp:10.5' + implementation 'com.github.getActivity:EasyHttp:10.6' // OkHttp 框架:https://github.com/square/okhttp // noinspection GradleDependency implementation 'com.squareup.okhttp3:okhttp:3.12.13' @@ -67,7 +67,7 @@ dependencies { | 功能或细节 | [EasyHttp](https://github.com/getActivity/EasyHttp) | [Retrofit](https://github.com/square/retrofit) | [OkGo](https://github.com/jeasonlzy/okhttp-OkGo) | | :----: | :------: | :-----: | :-----: | -| 对应版本 | 10.5 | 2.9.0 | 3.0.4 | +| 对应版本 | 10.6 | 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 包大小** | 78 KB | 123 KB | 131 KB | | minSdk 要求 | API 14+ | API 21+ | API 14+ | diff --git a/app/build.gradle b/app/build.gradle index 2664f97..3ee5bc8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { applicationId 'com.hjq.easy.demo' minSdkVersion 16 targetSdkVersion 31 - versionCode 1050 - versionName '10.5' + versionCode 1060 + versionName '10.6' } // 支持 JDK 1.8 diff --git a/library/build.gradle b/library/build.gradle index e853f4d..4b73cb8 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -5,8 +5,8 @@ android { defaultConfig { minSdkVersion 14 - versionCode 1050 - versionName "10.5" + versionCode 1060 + versionName "10.6" } // 使用 JDK 1.8 diff --git a/library/src/main/java/com/hjq/http/EasyUtils.java b/library/src/main/java/com/hjq/http/EasyUtils.java index 3c8170e..2cce84a 100644 --- a/library/src/main/java/com/hjq/http/EasyUtils.java +++ b/library/src/main/java/com/hjq/http/EasyUtils.java @@ -276,6 +276,9 @@ public static HashMap beanToHashMap(Object object) { return data; } + /** + * 对象转换 + */ public static Object convertObject(Object object) { if (object instanceof List) { // 如果这是一个 List 参数 @@ -288,7 +291,7 @@ public static Object convertObject(Object object) { return String.valueOf(object); } else if (isBeanType(object)) { // 如果这是一个 Bean 参数 - return beanToHashMap(object); + return mapToJsonObject(beanToHashMap(object)); } else { // 如果这是一个普通的参数 return object;