This commit is contained in:
2026-01-26 15:53:43 +08:00
parent 50d12de534
commit 6e7eb80715
2 changed files with 25 additions and 11 deletions
@@ -91,19 +91,29 @@ interface ApiService {
): ApiResponse<List<CollectedFoodInfo>> ): ApiResponse<List<CollectedFoodInfo>>
// /**
// * 获取档口菜品信息
// */
// @GET
// suspend fun getRestInfoFoodsByType(
//// @Url url: String = "${GlobalData.appBaseUrl}/zhstapi/zhst/getRestInfoFoodsByType/stall",
//// @Url url: String = "${GlobalData.appBaseUrl}/terminal/neglect/boothMachine/app/getFoodsByFoodNamePage",
// @Url url: String = "${GlobalData.appBaseUrl}/terminal/neglect/boothMachine/app/getFoodsByFoodNameList",
// @Query("name") foodName: String,
//// @Query("appVersion") appVersion: String = GlobalData.appVersion,
//// @Query("restId") restId: String,
//// @Query("type") type: Int,
//// @Query("foodName") foodName: String,
// ): ApiResponse<List<FoodInfo>>
/** /**
* 获取档口菜品信息 * 获取档口菜品信息
*/ */
@GET @POST
suspend fun getRestInfoFoodsByType( suspend fun getRestInfoFoodsByType(
// @Url url: String = "${GlobalData.appBaseUrl}/zhstapi/zhst/getRestInfoFoodsByType/stall",
// @Url url: String = "${GlobalData.appBaseUrl}/terminal/neglect/boothMachine/app/getFoodsByFoodNamePage",
@Url url: String = "${GlobalData.appBaseUrl}/terminal/neglect/boothMachine/app/getFoodsByFoodNameList", @Url url: String = "${GlobalData.appBaseUrl}/terminal/neglect/boothMachine/app/getFoodsByFoodNameList",
@Query("name") foodName: String, @Body param: HashMap<String, String>
// @Query("appVersion") appVersion: String = GlobalData.appVersion,
// @Query("restId") restId: String,
// @Query("type") type: Int,
// @Query("foodName") foodName: String,
): ApiResponse<List<FoodInfo>> ): ApiResponse<List<FoodInfo>>
// /** // /**
@@ -131,12 +131,16 @@ class RemoteRepository constructor(
* @param type 0全部 1餐次 * @param type 0全部 1餐次
*/ */
suspend fun getRestInfoFoodsByType( suspend fun getRestInfoFoodsByType(
restId: String = GlobalData.restId,
type: Int = 0,
foodName: String, foodName: String,
pageNum: Int = 1,
pageSize:Int = 100
): ApiResponse<List<FoodInfo>> { ): ApiResponse<List<FoodInfo>> {
return safeApiCall { return safeApiCall {
apiService.getRestInfoFoodsByType(foodName = foodName) apiService.getRestInfoFoodsByType(param = hashMapOf(
"name" to foodName,
"pageNum" to "$pageNum",
"pageSize" to "$pageSize"
))
} }
} }