Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS

 Conflicts:
	app/src/main/java/com/navinfo/omqs/ui/activity/map/MainActivity.kt
	app/src/main/java/com/navinfo/omqs/ui/activity/map/MainViewModel.kt
	app/src/main/java/com/navinfo/omqs/ui/fragment/evaluationresult/EvaluationResultViewModel.kt
	collect-library/src/main/java/com/navinfo/collect/library/map/handler/MarkHandler.kt
This commit is contained in:
squallzhjch
2023-07-21 15:30:20 +08:00
22 changed files with 1518 additions and 306 deletions

View File

@@ -6,8 +6,7 @@ import com.navinfo.omqs.bean.IndoorConnectionInfoBean
import com.navinfo.omqs.bean.LoginUserBean
import com.navinfo.omqs.bean.QRCodeBean
import com.navinfo.omqs.bean.SysUserBean
import okhttp3.ResponseBody
import retrofit2.Response
import com.navinfo.omqs.bean.TraceVideoBean
/**
@@ -38,4 +37,9 @@ interface NetworkService {
* 更新用户信息
*/
suspend fun updateServerInfo(url: String,indoorConnectionInfoBean: IndoorConnectionInfoBean): NetResult<QRCodeBean>
/**
* 设置轨迹对应的视频
*/
suspend fun sendServerCommand(url: String,traceVideoBean: TraceVideoBean): NetResult<QRCodeBean>
}

View File

@@ -6,6 +6,7 @@ import com.navinfo.omqs.bean.IndoorConnectionInfoBean
import com.navinfo.omqs.bean.LoginUserBean
import com.navinfo.omqs.bean.QRCodeBean
import com.navinfo.omqs.bean.SysUserBean
import com.navinfo.omqs.bean.TraceVideoBean
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import okhttp3.ResponseBody
@@ -110,6 +111,33 @@ class NetworkServiceImpl @Inject constructor(
map["baseurl"] = indoorConnectionInfoBean.baseurl
map["platform"] = indoorConnectionInfoBean.platform
val result = netApi.retrofitUpdateServerInfo(url,map)
if (result.isSuccessful) {
if (result.code() == 200) {
NetResult.Success(result.body())
} else {
NetResult.Failure<Any>(result.code(), result.message())
}
} else {
NetResult.Failure<Any>(result.code(), result.message())
}
} catch (e: Exception) {
NetResult.Error<Any>(e)
}
}
override suspend fun sendServerCommand(
url: String,
traceVideoBean: TraceVideoBean
): NetResult<QRCodeBean> =
//在IO线程中运行
withContext(Dispatchers.IO) {
return@withContext try {
val map: MutableMap<String, String> = HashMap()
map["userid"] = traceVideoBean.userid
map["playMode"] = traceVideoBean.playMode
map["time"] = traceVideoBean.time
val result = netApi.retrofitUpdateServerInfo(url,map)
if (result.isSuccessful) {
if (result.code() == 200) {