优化代码调用
This commit is contained in:
@@ -5,17 +5,17 @@ apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'android-aspectjx'
|
||||
apply plugin: 'bugly'
|
||||
//apply ByteX宿主
|
||||
apply plugin: 'bytex'
|
||||
ByteX {
|
||||
enable true
|
||||
enableInDebug true
|
||||
logLevel "DEBUG"
|
||||
}
|
||||
//apply plugin: 'bytex'
|
||||
//ByteX {
|
||||
// enable true
|
||||
// enableInDebug true
|
||||
// logLevel "DEBUG"
|
||||
//}
|
||||
|
||||
apply plugin: 'chain.log.hook'
|
||||
hooklog{
|
||||
enableLoggerToServer true
|
||||
}
|
||||
//apply plugin: 'chain.log.hook'
|
||||
//hooklog{
|
||||
// enableLoggerToServer true
|
||||
//}
|
||||
bugly {
|
||||
appId = 'ac71228f85' // 注册时分配的App ID
|
||||
appKey = '3c736249-d6be-4066-b577-b7a6dc975cf7' // 注册时分配的App Key
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.mogo.eagle.core.function.v2x.trafficlight.network
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.mogo.cloud.network.RetrofitFactory
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.constants.HostConst.CITY_HOST
|
||||
import com.mogo.utils.network.apiCall
|
||||
import com.mogo.utils.network.cancel
|
||||
@@ -14,8 +13,9 @@ import com.mogo.utils.network.request
|
||||
class TrafficLightNetWorkModel {
|
||||
|
||||
private fun getNetWorkApi(baseUrl: String = CITY_HOST): TrafficLightApiService {
|
||||
return RetrofitFactory.getInstanceNoCallAdapter(baseUrl)!!
|
||||
.create(TrafficLightApiService::class.java)
|
||||
return MogoApisHandler.getInstance().apis.networkApi.createNoCallAdapter(
|
||||
TrafficLightApiService::class.java, baseUrl
|
||||
)
|
||||
}
|
||||
|
||||
fun requestRoadID(
|
||||
@@ -72,7 +72,7 @@ class TrafficLightNetWorkModel {
|
||||
request<BaseResponse<TrafficLightResult>>("requestTrafficLight") {
|
||||
val map = hashMapOf<String, String>()
|
||||
start {
|
||||
if(roadId == null){
|
||||
if (roadId == null) {
|
||||
return@start
|
||||
}
|
||||
val trafficLightRequestData = TrafficLightRequestData(lat, lon, bearing, roadId)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mogo.eagle.core.function.v2x.vip.network
|
||||
|
||||
import com.mogo.cloud.network.RetrofitFactory
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.constants.HostConst.DATA_SERVICE_HOST
|
||||
import com.mogo.utils.network.apiCall
|
||||
import com.mogo.utils.network.request
|
||||
@@ -10,8 +10,9 @@ import com.mogo.utils.network.request
|
||||
class VipNetWorkModel {
|
||||
|
||||
private fun getNetWorkApi(baseUrl: String = DATA_SERVICE_HOST): VipApiService {
|
||||
return RetrofitFactory.getInstanceNoCallAdapter(baseUrl)!!
|
||||
.create(VipApiService::class.java)
|
||||
return MogoApisHandler.getInstance().apis.networkApi.createNoCallAdapter(
|
||||
VipApiService::class.java, baseUrl
|
||||
)
|
||||
}
|
||||
|
||||
fun requestVip(onSuccess: ((Boolean) -> Unit), onError: ((String) -> Unit)) {
|
||||
|
||||
Reference in New Issue
Block a user