package com.gyf.csams.util import com.google.gson.Gson import com.google.gson.GsonBuilder import com.gyf.csams.association.model.Exam import com.gyf.csams.module.ApiResponse import com.gyf.lib.util.HttpCallback import java.lang.reflect.Type /** * http请求回调 * * @param T * @property action * @property onSuccess * @property onFail */ class ExamCallback( private val action: String, private val onSuccess: (res: ApiResponse) -> Unit, private val onFail: (error: String) -> Unit, private val type: Type ) : HttpCallback(action, onSuccess, onFail, type) { override val gson: Gson = GsonBuilder() .registerTypeAdapter(Exam::class.java, ExamDeserializer()) .create() }