Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -27,8 +27,6 @@ import io.reactivex.schedulers.Schedulers;
|
||||
public class NetworkActivity extends AppCompatActivity {
|
||||
private Button btn;
|
||||
private TextView tvResult;
|
||||
|
||||
|
||||
private ApiService apiService;
|
||||
|
||||
|
||||
@@ -44,8 +42,8 @@ public class NetworkActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
tvResult.setText("结果显示");
|
||||
// queryRoadData("ZD802C1938L10797");
|
||||
queryHelpSignal("ZD802C1938L10797");
|
||||
queryRoadData("ZD802C1938L10797");
|
||||
// queryHelpSignal("ZD802C1938L10797");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -55,9 +55,9 @@ ext {
|
||||
// 公司服务 - 埋点
|
||||
analytics : "com.elegant.analytics:analytics:1.1.28",
|
||||
|
||||
retrofit : "com.squareup.retrofit2:retrofit:2.1.0",
|
||||
retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.1.0",
|
||||
retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.1.0",
|
||||
retrofit : "com.squareup.retrofit2:retrofit:2.6.0",
|
||||
retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.6.0",
|
||||
retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.6.0",
|
||||
retrofitconverterscalars : "com.squareup.retrofit2:converter-scalars:2.1.0",
|
||||
|
||||
|
||||
|
||||
@@ -60,6 +60,6 @@ dependencies {
|
||||
api rootProject.ext.dependencies.retrofitconverterscalars
|
||||
implementation project(path: ':foudations:mogo-httpdns')
|
||||
implementation project(path: ':foudations:mogo-passport')
|
||||
|
||||
|
||||
// api 'com.mogo.cloud:passport:1.0.0'
|
||||
// api 'com.mogo.cloud:httpdns:1.0.0'
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
GROUP=com.mogo.cloud
|
||||
POM_ARTIFACT_ID=commons
|
||||
VERSION_CODE=1
|
||||
VERSION_NAME=1.0.0
|
||||
VERSION_NAME=1.0.1-snapshots
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.mogo.cloud.commons
|
||||
|
||||
class Sample {
|
||||
|
||||
}
|
||||
@@ -5,14 +5,7 @@ package com.mogo.cloud.commons.network
|
||||
* describe:
|
||||
*/
|
||||
class NetConstants {
|
||||
|
||||
companion object {
|
||||
/** 无数据 */
|
||||
const val NO_DATA = -800
|
||||
|
||||
/** 数据返回正常 */
|
||||
const val OK = 0
|
||||
|
||||
const val READ_TIMEOUT = 20000L
|
||||
const val WRITE_TIMEOUT = 20000L
|
||||
const val CONNECT_TIMEOUT = 15000L
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.concurrent.TimeUnit
|
||||
*
|
||||
* @Author: wujifei
|
||||
* @CreateDate: 1/20/21 12:16 AM
|
||||
* @Description: 描述
|
||||
* @Description: 获取OkHttpClient
|
||||
*/
|
||||
class OkHttpFactory private constructor() {
|
||||
companion object {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.cloud.commons.network
|
||||
|
||||
import androidx.collection.ArrayMap
|
||||
import okhttp3.OkHttpClient
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
|
||||
import retrofit2.converter.gson.GsonConverterFactory
|
||||
@@ -10,7 +9,7 @@ import retrofit2.converter.gson.GsonConverterFactory
|
||||
*
|
||||
* @Author: wujifei
|
||||
* @CreateDate: 1/19/21 11:21 PM
|
||||
* @Description: 描述
|
||||
* @Description: 获取Retrofit实例
|
||||
*/
|
||||
object RetrofitFactory {
|
||||
private val sRpcServiceMap: MutableMap<String, Retrofit?> = ArrayMap()
|
||||
@@ -46,6 +45,4 @@ object RetrofitFactory {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import okhttp3.Response
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/1/20 15:18
|
||||
* describe:
|
||||
* describe:header携带信息
|
||||
*/
|
||||
class HeaderNetworkInterceptor : Interceptor {
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
|
||||
@@ -9,7 +9,11 @@ import java.util.*
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/1/20 12:51
|
||||
* describe:
|
||||
* describe:网络工具
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据host获取InetAddress
|
||||
*/
|
||||
@Throws(UnknownHostException::class)
|
||||
fun lookup(hostname: String?): List<InetAddress?>? {
|
||||
|
||||
Reference in New Issue
Block a user