优化
This commit is contained in:
@@ -91,19 +91,29 @@ interface ApiService {
|
||||
): 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(
|
||||
// @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,
|
||||
@Body param: HashMap<String, String>
|
||||
): ApiResponse<List<FoodInfo>>
|
||||
|
||||
// /**
|
||||
|
||||
@@ -131,12 +131,16 @@ class RemoteRepository constructor(
|
||||
* @param type 0全部 1餐次
|
||||
*/
|
||||
suspend fun getRestInfoFoodsByType(
|
||||
restId: String = GlobalData.restId,
|
||||
type: Int = 0,
|
||||
foodName: String,
|
||||
pageNum: Int = 1,
|
||||
pageSize:Int = 100
|
||||
): ApiResponse<List<FoodInfo>> {
|
||||
return safeApiCall {
|
||||
apiService.getRestInfoFoodsByType(foodName = foodName)
|
||||
apiService.getRestInfoFoodsByType(param = hashMapOf(
|
||||
"name" to foodName,
|
||||
"pageNum" to "$pageNum",
|
||||
"pageSize" to "$pageSize"
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user