新接口调试

This commit is contained in:
2026-01-30 18:01:07 +08:00
parent a4905e7226
commit eaa1b1eb00
10 changed files with 74 additions and 181 deletions
@@ -13,14 +13,6 @@ import retrofit2.http.Url
interface ApiService {
// @GET("/food/stFoodInfoMatching/list")
// suspend fun getFoodList(
// @Query("dinnerType") dinnerType: String,
// @Query("canteenId") canteenId: String = BaseApp.canteenId,
// @Query("pageNo") pageNo: Int,
// @Query("pageSize") pageSize: Int
// ): ApiResponse<FoodRecordBean?>
/**
* 查询菜品详情
*/
@@ -67,8 +59,8 @@ interface ApiService {
@Body param: MutableMap<String, Any>
): ApiResponse<MutableList<CookFoodGoodsEntity>?>
/**
* 物品信息
/**
* 调料信息
*/
@POST
suspend fun querySeasoningList(
@@ -1,68 +0,0 @@
//package com.shuwei.dish.match.net
//
//import com.shuwei.dish.match.base.BaseApp
//import com.shuwei.dish.match.base.BaseReq
//import com.shuwei.dish.match.entity.FoodRecordBean
//import com.shuwei.dish.match.http.UrlConfig
//import retrofit2.http.Body
//import retrofit2.http.GET
//import retrofit2.http.POST
//import retrofit2.http.Query
//import retrofit2.http.Url
//
//interface ApiService2 {
//
// @GET("food/stFoodInfoMatching/list")
// suspend fun getDishList(
// @Query("dinnerType") dinnerType: String,
// @Query("canteenId") canteenId: String = BaseApp.canteenId,
// @Query("pageNo") pageNo: Int,
// @Query("pageSize") pageSize: Int
// ): BaseReq<FoodRecordBean?>
//
//// /**
//// * device获取token
//// */
//// @GET("/sys/getEquipmentToken")
//// suspend fun getDeviceToken(
//// @Query("qrcodeId") qrcodeId: String,
//// @Query("appVersion") appVersion: String = App.appVersion
//// ): ApiResponse<String>
////
//// /**
//// *获取配置信息
//// */
//// @GET("/equipment/stEquipment/queryByEquipmentCode")
//// suspend fun getDeviceInfo(
//// @Query("equipmentCode") equipmentCode: String,
//// @Query("appVersion") appVersion: String = App.appVersion
//// ): ApiResponse<DeviceConfigInfo>
////
//// @GET
//// suspend fun getAccessToken(
//// @Url url: String = UrlConfig.GET_ACCESS_TOKEN,
//// @Query("qrcodeId") qrcodeId: String
//// ): ApiResponse<String?>
////
//// @GET
//// suspend fun getShelfList(
//// @Url url: String = UrlConfig.GET_SHELF_LIST,
//// @Query("deviceId") deviceId: String
//// ): ApiResponse<ShelfResult>
////
//// @GET
//// suspend fun getGoodsList(
//// @Url url: String = UrlConfig.GET_GOODS_LIST,
//// @Query("canteenId") canteenId: String = "0",
//// @Query("goodsName") goodsName: String? = null,
//// @Query("pageNo") pageNo: Int = 1,
//// @Query("pageSize") pageSize: Int = 50
//// ): ApiResponse<MutableList<GoodsModel>?>
////
//// @POST
//// suspend fun saveShelfGoodsList(
//// @Url url: String = UrlConfig.SAVE_SHELF_GOODS_LIST,
//// @Body body: ShelfBody
//// ): ApiResponse<Any?>
//
//}
@@ -10,36 +10,6 @@ import kotlinx.coroutines.launch
class NetViewModel : ViewModel() {
// fun getFoodList(
// dinnerType: String,
// pageNo: Int,
// pageSize: Int,
// onSuccess: (FoodRecordBean?) -> Unit,
// onFailure: (String, String) -> Unit
// ) {
// viewModelScope.launch {
// apiRequest(
// onRequest = {
// apiService2.getDishList(
// dinnerType = dinnerType,
// pageNo = pageNo,
// pageSize = pageSize
// )
// },
// onSuccess = {
// if (it.code == 200) {
// onSuccess(it.data)
// return@apiRequest
// }
// onFailure("${it.code}", it.msg ?: "")
// },
// onFailure = {
// onFailure("-1", it.errorMsg)
// }
// )
// }
// }
fun submitCookFood(
entity: CookFoodEntity,
onSuccess: (Any?) -> Unit,