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

import * as API from './types';

/** 修改营销活动 PUT /xjpmj/marketingActivity */
export async function xjpmjMarketingActivityPut({
  body,
  options,
}: {
  body: API.MarketingActivityBoEditGroup;
  options?: CustomRequestOptions;
}) {
  return request<API.RVoid>('/xjpmj/marketingActivity', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增营销活动 POST /xjpmj/marketingActivity */
export async function xjpmjMarketingActivityPost({
  body,
  options,
}: {
  body: API.MarketingActivityBoAddGroup;
  options?: CustomRequestOptions;
}) {
  return request<API.RVoid>('/xjpmj/marketingActivity', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取营销活动详细信息 GET /xjpmj/marketingActivity/${param0} */
export async function xjpmjMarketingActivityIdGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMarketingActivityidGetParams;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

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

/** 删除营销活动 DELETE /xjpmj/marketingActivity/${param0} */
export async function xjpmjMarketingActivityIdsDelete({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMarketingActivityidsDeleteParams;
  options?: CustomRequestOptions;
}) {
  const { ids: param0, ...queryParams } = params;

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

/** 导出营销活动列表 POST /xjpmj/marketingActivity/export */
export async function xjpmjMarketingActivityExportPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMarketingActivityExportPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.XjpmjMarketingActivityExportPostResponse>(
    '/xjpmj/marketingActivity/export',
    {
      method: 'POST',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 查询营销活动列表 GET /xjpmj/marketingActivity/list */
export async function xjpmjMarketingActivityListGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.XjpmjMarketingActivityListGetParams;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfoMarketingActivityVo>(
    '/xjpmj/marketingActivity/list',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
