package com.develop.food.base.api.request

import com.blankj.utilcode.util.AppUtils
import com.develop.food.base.http.generateMultipartBody
import com.develop.food.base.repo.FoodDataProvider
import com.develop.food.base.utils.getSN
import okhttp3.RequestBody

object DeviceInfoBody {
    fun genDeviceInfoBody(
    ): RequestBody {
        val v = FoodDataProvider.getUserDatabase().devConfigDao().recipeVersion()
        var recipeUpdateTime = 0L
        if(v != null) recipeUpdateTime = v?.recipeUpdateTime!!
        val map = HashMap<String, String>()
        map["apkVersin"] = AppUtils.getAppVersionName()
        map["sn"] = getSN()
        map["recipeUpdateTime"] = recipeUpdateTime.toString()
        return map.generateMultipartBody()
    }
}