/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';

import * as API from './types';

/** 新增菜品 POST /app/merchantDish/addDish */
export async function appMerchantDishAddDishPost({
  body,
  options,
}: {
  body: API.MerchantDishBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantDish/addDish', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 增加菜品浏览量 POST /app/merchantDish/addViewCount */
export async function appMerchantDishAddViewCountPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantDishAddViewCountPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantDish/addViewCount', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 菜品详情 GET /app/merchantDish/detail */
export async function appMerchantDishDetailGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantDishDetailGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.RMerchantDishVo>('/app/merchantDish/detail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 编辑菜品 POST /app/merchantDish/editDish */
export async function appMerchantDishEditDishPost({
  body,
  options,
}: {
  body: API.MerchantDishBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantDish/editDish', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改排序 POST /app/merchantDish/editSort */
export async function appMerchantDishEditSortPost({
  body,
  options,
}: {
  body: API.AppMerchantDishEditSortPostBody;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantDish/editSort', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 商家查询自己的菜品列表 POST /app/merchantDish/list */
export async function appMerchantDishListPost({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantDishListPostParams;
  body: API.MerchantDishBo;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfoMerchantDishVo>('/app/merchantDish/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询附近菜品列表 POST /app/merchantDish/nearbyList */
export async function appMerchantDishNearbyListPost({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantDishNearbyListPostParams;
  body: API.LatLogBo;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfoMerchantDishVo>(
    '/app/merchantDish/nearbyList',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      params: {
        ...params,
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 批量删除菜品 POST /app/merchantDish/remove */
export async function appMerchantDishRemovePost({
  body,
  options,
}: {
  body: API.AppMerchantDishRemovePostBody;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantDish/remove', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询菜品销售记录 POST /app/merchantDish/saleRecord */
export async function appMerchantDishSaleRecordPost({
  body,
  options,
}: {
  body: API.TimeSearchBo;
  options?: CustomRequestOptions;
}) {
  return request<API.RSaleRecordVo>('/app/merchantDish/saleRecord', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取商家菜品详细信息 GET /xjpmj/merchantDish/${param0} */
export async function xjpmjMerchantDishIdGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMerchantDishidGetParams;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

  return request<API.RMerchantDishVo>(`/xjpmj/merchantDish/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 删除商家菜品 DELETE /xjpmj/merchantDish/${param0} */
export async function xjpmjMerchantDishIdsDelete({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMerchantDishidsDeleteParams;
  options?: CustomRequestOptions;
}) {
  const { ids: param0, ...queryParams } = params;

  return request<API.RVoid>(`/xjpmj/merchantDish/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 导出商家菜品列表 POST /xjpmj/merchantDish/export */
export async function xjpmjMerchantDishExportPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMerchantDishExportPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.XjpmjMerchantDishExportPostResponse>(
    '/xjpmj/merchantDish/export',
    {
      method: 'POST',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询商家菜品列表 POST /xjpmj/merchantDish/list */
export async function xjpmjMerchantDishListPost({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMerchantDishListPostParams;
  body: API.MerchantDishBo;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfoMerchantDishVo>('/xjpmj/merchantDish/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}
