增加支付接口相关逻辑
This commit is contained in:
@@ -4,11 +4,14 @@ import com.sw.dualscreen.GlobalData
|
||||
import com.sw.dualscreen.model.request.UserNutritionParam
|
||||
import com.sw.dualscreen.model.response.ApiResponse
|
||||
import com.sw.dualscreen.model.response.DinnerType
|
||||
import com.sw.dualscreen.model.response.FaceData
|
||||
import com.sw.dualscreen.model.response.FoodInfo
|
||||
import com.sw.dualscreen.model.response.FoodSearchReq
|
||||
import com.sw.dualscreen.model.response.FoodOrder
|
||||
import com.sw.dualscreen.model.response.MemberInfo
|
||||
import com.sw.dualscreen.model.response.PayResult
|
||||
import com.sw.dualscreen.model.response.UserFaceModel
|
||||
import com.sw.dualscreen.model.response.UserNutrition
|
||||
import com.sw.dualscreen.model.response.UserNutritionData
|
||||
import com.sw.dualscreen.network.api.ApiService
|
||||
import com.sw.dualscreen.objbox.CollectedFoodInfo
|
||||
@@ -73,6 +76,18 @@ class RemoteRepository constructor(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getUserFaceCache2(
|
||||
pageNum: Int,
|
||||
pageSize: Int = 160,
|
||||
): ApiResponse<FaceData> {
|
||||
return safeApiCall {
|
||||
apiService.getUserFaceCache2(
|
||||
pageNum = pageNum,
|
||||
pageSize = pageSize
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人脸数据
|
||||
*/
|
||||
@@ -107,16 +122,38 @@ class RemoteRepository constructor(
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 通过用户信息获取就餐数据
|
||||
// */
|
||||
// suspend fun getUserNutritionData(
|
||||
// restId: String = GlobalData.restId,
|
||||
// userId: String,
|
||||
// foodId: String,
|
||||
// ): ApiResponse<UserNutritionData> {
|
||||
// return safeApiCall {
|
||||
// apiService.getUserNutritionData(restId = restId, userId = userId, foodId = foodId)
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 通过用户信息获取就餐数据
|
||||
*/
|
||||
suspend fun getUserNutritionData(
|
||||
restId: String = GlobalData.restId,
|
||||
userId: String,
|
||||
foodId: String,
|
||||
): ApiResponse<UserNutritionData> {
|
||||
suspend fun getUserNutritionData(userId: String): ApiResponse<UserNutrition> {
|
||||
return safeApiCall {
|
||||
apiService.getUserNutritionData(restId = restId, userId = userId, foodId = foodId)
|
||||
apiService.getUserNutritionData(userId = userId)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付二维码
|
||||
*/
|
||||
suspend fun getQrCodeImg(
|
||||
orderNo: String,
|
||||
memberId: String? = null,
|
||||
totalFee: String? = null
|
||||
): ApiResponse<String?> {
|
||||
return safeApiCall {
|
||||
apiService.getQrCodeImg(orderNo = orderNo, memberId = memberId, totalFee = totalFee)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,12 +187,42 @@ class RemoteRepository constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
*/
|
||||
suspend fun createOrder(order: FoodOrder): ApiResponse<Any?> {
|
||||
return safeApiCall {
|
||||
apiService.createOrder(order = order)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 现金支付
|
||||
*/
|
||||
suspend fun cashPay(param: HashMap<String, String>): ApiResponse<Boolean?> {
|
||||
return safeApiCall {
|
||||
apiService.cashPay(param = param)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单状态
|
||||
*/
|
||||
suspend fun queryOrderState(param: HashMap<String, String>): ApiResponse<PayResult?> {
|
||||
return safeApiCall {
|
||||
apiService.queryOrderState(param = param)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员支付
|
||||
*/
|
||||
suspend fun memberPay(param: HashMap<String, String>): ApiResponse<Any?> {
|
||||
return safeApiCall {
|
||||
apiService.memberPay(param = param)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun bindOrder(userId: String, orderId: String): ApiResponse<Any?> {
|
||||
return safeApiCall {
|
||||
apiService.bindOrder(userId = userId, orderId = orderId)
|
||||
|
||||
Reference in New Issue
Block a user