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

import * as API from './types';

/** 修改用户优惠券关联 PUT /xjpmj/userCoupon */
export async function xjpmjUserCouponPut({
  body,
  options,
}: {
  body: API.UserCouponBoEditGroup;
  options?: CustomRequestOptions;
}) {
  return request<API.RVoid>('/xjpmj/userCoupon', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增用户优惠券关联 POST /xjpmj/userCoupon */
export async function xjpmjUserCouponPost({
  body,
  options,
}: {
  body: API.UserCouponBoAddGroup;
  options?: CustomRequestOptions;
}) {
  return request<API.RVoid>('/xjpmj/userCoupon', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取用户优惠券关联详细信息 GET /xjpmj/userCoupon/${param0} */
export async function xjpmjUserCouponIdGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjUserCouponidGetParams;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

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

/** 删除用户优惠券关联 DELETE /xjpmj/userCoupon/${param0} */
export async function xjpmjUserCouponIdsDelete({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjUserCouponidsDeleteParams;
  options?: CustomRequestOptions;
}) {
  const { ids: param0, ...queryParams } = params;

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

/** 导出用户优惠券关联列表 POST /xjpmj/userCoupon/export */
export async function xjpmjUserCouponExportPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjUserCouponExportPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.XjpmjUserCouponExportPostResponse>(
    '/xjpmj/userCoupon/export',
    {
      method: 'POST',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询用户优惠券关联列表 POST /xjpmj/userCoupon/list */
export async function xjpmjUserCouponListPost({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjUserCouponListPostParams;
  body: API.UserCouponBo;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfoUserCouponVo>('/xjpmj/userCoupon/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}
