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

import * as API from './types';

/** 获取字典项列表 根据code获取字典项列表 GET /dictionary/items */
export async function dictionaryItemsUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.dictionaryItemsUsingGetParams;
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: API.DictionaryItem[];
    }
  >('/dictionary/items', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 创建字典项 创建新的数据字典项 POST /dictionary/items */
export async function dictionaryItemsUsingPost({
  body,
  options,
}: {
  body: API.CreateDictionaryItemRequest;
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: API.DictionaryItem;
    }
  >('/dictionary/items', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取字典项详情 根据ID获取字典项详情 GET /dictionary/items/${param0} */
export async function dictionaryItemsIdUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.dictionaryItemsIdUsingGetParams;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      data?: API.DictionaryItem;
    }
  >(`/dictionary/items/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新字典项 根据ID更新数据字典项 PUT /dictionary/items/${param0} */
export async function dictionaryItemsIdUsingPut({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.dictionaryItemsIdUsingPutParams;
  body: API.UpdateDictionaryItemRequest;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      data?: API.DictionaryItem;
    }
  >(`/dictionary/items/${param0}`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 删除字典项 根据ID删除数据字典项 DELETE /dictionary/items/${param0} */
export async function dictionaryItemsIdUsingDelete({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.dictionaryItemsIdUsingDeleteParams;
  options?: CustomRequestOptions;
}) {
  const { id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      data?: string;
    }
  >(`/dictionary/items/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}
