//package com.sw.platecabinet.viewmodel // //import com.sw.platecabinet.model.response.UserFaceModel //import kotlinx.coroutines.Dispatchers //import kotlinx.coroutines.withContext //import java.io.File // ///** // * 管理员操作viewmodel // */ //class SettingViewModel : BaseViewModel() { // // companion object { // const val PAGE_SIZE = 100 // } // // /** // * 获取人脸数据 // */ // fun getFaceIncrementList( // pageNo: Int = 1, // pageSize: Int = PAGE_SIZE, // timestamp: Long, // block: (List) -> Unit // ) { // launch { // val response = repository.getFaceIncrementList( // pageNum = pageNo.toLong(), // pageSize = pageSize.toLong(), // timestamp = timestamp // ) // if (parseResponse(response)) { // withContext(Dispatchers.Default) { // val list: List = response.data ?: emptyList() // block(list) // } // } // } // } // // /** // * 添加人脸数据 // */ // fun addUserFace(faceData: String, imageFile: File, block: (Boolean, UserFaceModel?) -> Unit) { // launch { // val imageResp = repository.uploadImage(imageFile) // val imageUrl = imageResp.data ?: "" // if (imageUrl.isBlank()) { // block(false, null) // return@launch // } // val faceResp = repository.addUserFace(faceData, imageUrl) // val status = parseResponse(faceResp) // if (status.not()) { // block(false, null) // return@launch // } // block(true, faceResp.data) // } // } // //}