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

import * as API from './types';

/** 新增优惠券 POST /app/coupon/addCoupon */
export async function appCouponAddCouponPost({
                                                 body,
                                                 options,
                                             }: {
    body: API.CouponBo;
    options?: CustomRequestOptions;
}) {
    return request<API.R>('/app/coupon/addCoupon', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** 复制兑换码(指定数量) POST /app/coupon/copyCouponCode */
export async function appCouponCopyCouponCodePost({
                                                      body,
                                                      options,
                                                  }: {
    body: API.CouponBo;
    options?: CustomRequestOptions;
}) {
    return request<API.RListString>('/app/coupon/copyCouponCode', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** 创建优惠券需付款金额 如果为0 则免费添加 POST /app/coupon/couponCost */
export async function appCouponCouponCostPost({
                                                  options,
                                              }: {
    options?: CustomRequestOptions;
}) {
    return request<API.RBigDecimal>('/app/coupon/couponCost', {
        method: 'POST',
        ...(options || {}),
    });
}

/** 删除优惠券 DELETE /app/coupon/deleteCoupon/${param0} */
export async function appCouponDeleteCouponIdDelete({
                                                        params,
                                                        options,
                                                    }: {
    // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
    params: API.AppCouponDeleteCouponidDeleteParams;
    options?: CustomRequestOptions;
}) {
    const {id: param0, ...queryParams} = params;

    return request<API.R>(`/app/coupon/deleteCoupon/${param0}`, {
        method: 'DELETE',
        params: {...queryParams},
        ...(options || {}),
    });
}

/** 兑换码生成优惠券 POST /app/coupon/exchangeCoupon */
export async function appCouponExchangeCouponPost({
                                                      body,
                                                      options,
                                                  }: {
    body: API.CouponCodeBo;
    options?: CustomRequestOptions;
}) {
    return request<API.R>('/app/coupon/exchangeCoupon', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** 商家优惠券列表 POST /app/coupon/merchantCouponList */
export async function appCouponMerchantCouponListPost({
                                                          params,
                                                          options,
                                                      }: {
    // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
    params: API.AppCouponMerchantCouponListPostParams;
    options?: CustomRequestOptions;
}) {
    return request<API.TableDataInfoCouponVo>('/app/coupon/merchantCouponList', {
        method: 'POST',
        params: {
            ...params,
        },
        ...(options || {}),
    });
}

/** 用户优惠券列表 POST /app/coupon/userCouponList */
export async function appCouponUserCouponListPost({
                                                      params,
                                                      options,
                                                  }: {
    // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
    params: API.AppCouponUserCouponListPostParams;
    options?: CustomRequestOptions;
}) {
    return request<API.TableDataInfoUserCouponVo>('/app/coupon/userCouponList', {
        method: 'POST',
        params: {
            ...params,
        },
        ...(options || {}),
    });
}

/** 新增优惠券主 POST /xjpmj/coupon */
export async function xjpmjCouponPost({
                                          body,
                                          options,
                                      }: {
    body: API.CouponBoAddGroup;
    options?: CustomRequestOptions;
}) {
    return request<API.RVoid>('/xjpmj/coupon', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

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

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

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

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

/** 复制兑换码(指定数量) POST /xjpmj/coupon/copyCouponCode */
export async function xjpmjCouponCopyCouponCodePost({
                                                        body,
                                                        options,
                                                    }: {
    body: API.CouponBo;
    options?: CustomRequestOptions;
}) {
    return request<API.RListString>('/xjpmj/coupon/copyCouponCode', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

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