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

import * as API from './types';

/** 加入购物车 POST /app/merchantCart/addCart */
export async function appMerchantCartAddCartPost({
  body,
  options,
}: {
  body: API.MerchantCartBo;
  options?: CustomRequestOptions;
}) {
  return request<API.RLong>('/app/merchantCart/addCart', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 加入购物车 POST /app/merchantCart/addCartById */
export async function appMerchantCartAddCartByIdPost({
  body,
  options,
}: {
  body: API.MerchantCartBo;
  options?: CustomRequestOptions;
}) {
  return request<API.RLong>('/app/merchantCart/addCartById', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 计算购物车内会员可以节省多少费用 POST /app/merchantCart/calculateSavings */
export async function appMerchantCartCalculateSavingsPost({
  body,
  options,
}: {
  body: API.AppMerchantCartCalculateSavingsPostBody;
  options?: CustomRequestOptions;
}) {
  return request<API.RCalculateSavingsVo>(
    '/app/merchantCart/calculateSavings',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 删除某个商户的购物车 POST /app/merchantCart/deleteByMerchantId */
export async function appMerchantCartDeleteByMerchantIdPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantCartDeleteByMerchantIdPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantCart/deleteByMerchantId', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 删除购物车 POST /app/merchantCart/deleteCart */
export async function appMerchantCartDeleteCartPost({
  body,
  options,
}: {
  body: API.DeleteCartBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/merchantCart/deleteCart', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询某个商户下的购物车列表 POST /app/merchantCart/listByMerchantId */
export async function appMerchantCartListByMerchantIdPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppMerchantCartListByMerchantIdPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.RListMerchantCartVo>(
    '/app/merchantCart/listByMerchantId',
    {
      method: 'POST',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询购物车的商户列表 根据最新的一个购物车加入时间来排序 POST /app/merchantCart/listMerchant */
export async function appMerchantCartListMerchantPost({
  options,
}: {
  options?: CustomRequestOptions;
}) {
  return request<API.RListMerchantVo>('/app/merchantCart/listMerchant', {
    method: 'POST',
    ...(options || {}),
  });
}
