|
@@ -3,6 +3,7 @@ package com.grkj.iscs.util
|
|
|
import android.content.Context
|
|
import android.content.Context
|
|
|
import android.os.Environment
|
|
import android.os.Environment
|
|
|
import cn.zhxu.data.TypeRef
|
|
import cn.zhxu.data.TypeRef
|
|
|
|
|
+import cn.zhxu.okhttps.HttpResult
|
|
|
import com.google.gson.Gson
|
|
import com.google.gson.Gson
|
|
|
import com.grkj.iscs.model.vo.BaseVO
|
|
import com.grkj.iscs.model.vo.BaseVO
|
|
|
import com.grkj.iscs.model.vo.SopPageVO
|
|
import com.grkj.iscs.model.vo.SopPageVO
|
|
@@ -59,4 +60,8 @@ fun px2dp(context: Context, pxValue: Float): Int {
|
|
|
|
|
|
|
|
inline fun <reified T> getRef(): TypeRef<BaseVO<T>> {
|
|
inline fun <reified T> getRef(): TypeRef<BaseVO<T>> {
|
|
|
return object : TypeRef<BaseVO<T>>() {}
|
|
return object : TypeRef<BaseVO<T>>() {}
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+inline fun <reified T> getRefBean(rst: HttpResult.Body): T? {
|
|
|
|
|
+ return rst.toBean(getRef<T>()).data
|
|
|
}
|
|
}
|