Commit bde6fc86 authored by p x's avatar p x
Browse files

對通車輛詳情

parent 066a88e4
...@@ -4,11 +4,11 @@ package com.sd.cavphmi.bean ...@@ -4,11 +4,11 @@ package com.sd.cavphmi.bean
data class VehDetailBean( data class VehDetailBean(
val code: Int, val code: Int,
val msg: String, val msg: String,
val result: Result, val result: VResult,
val success: Boolean val success: Boolean
) )
data class Result( data class VResult(
val offlineCount: Int, val offlineCount: Int,
val onlineCount: Int, val onlineCount: Int,
val vehicleInfos: List<VehicleInfo> val vehicleInfos: List<VehicleInfo>
......
...@@ -21,6 +21,7 @@ class HeadParamsInterceptor @Inject constructor() : Interceptor { ...@@ -21,6 +21,7 @@ class HeadParamsInterceptor @Inject constructor() : Interceptor {
request.header("token", MyContants.HTTP_TOKEN) request.header("token", MyContants.HTTP_TOKEN)
request.header("Authorization", MyContants.HTTP_TOKEN) request.header("Authorization", MyContants.HTTP_TOKEN)
} }
request.header("Referer", "${MyContants.HOST}/itdts-portal-v5/intelligence-parking")
return chain.proceed(request.build()) return chain.proceed(request.build())
} }
......
...@@ -12,9 +12,9 @@ import javax.inject.Inject ...@@ -12,9 +12,9 @@ import javax.inject.Inject
class AvpDataRepo @Inject constructor(private var clientRetrofitMethod: ClientRetrofitMethod) { class AvpDataRepo @Inject constructor(private var clientRetrofitMethod: ClientRetrofitMethod) {
/***获取车辆详情 /***获取车辆详情
* @param id 车辆id * @param id 正常应该是传场地ID,但是亦庄这个和太和桥车是一样的
* **/ * **/
suspend fun getVehDetail(id: String="1"): MyResult<VehDetailBean> { suspend fun getVehDetail(id: String=""): MyResult<VehDetailBean> {
if (id.isNullOrEmpty()) { if (id.isNullOrEmpty()) {
return MyResult.Error(MyContants.HTTP_ERROR, "error") return MyResult.Error(MyContants.HTTP_ERROR, "error")
} }
......
...@@ -122,7 +122,7 @@ class MainVm @Inject constructor( ...@@ -122,7 +122,7 @@ class MainVm @Inject constructor(
} }
//获取车辆详情 //获取车辆详情
fun getVehDetail(id: String="1") { fun getVehDetail(id: String="") {
viewModelScope.launch { viewModelScope.launch {
var result = avpDataRepo.getVehDetail(id) var result = avpDataRepo.getVehDetail(id)
when (result) { when (result) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment