Components.ts 1.5 KB
Newer Older
R
Rongfeng Fu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** List Components query all component versions GET /api/v1/components */
export async function queryAllComponentVersions(options?: {
  [key: string]: any;
}) {
  return request<API.OBResponseDataListComponent_>('/api/v1/components', {
    method: 'GET',
    ...(options || {}),
  });
}

/** Get Component query component by component name GET /api/v1/components/${param0} */
export async function queryComponentByComponentName(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryComponentByComponentNameParams,
  options?: { [key: string]: any },
) {
  const { component: param0, ...queryParams } = params;
  return request<API.OBResponseComponent_>(`/api/v1/components/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** List Component Parameters query component parameters POST /api/v1/components/parameters */
export async function queryComponentParameters(
R
Rongfeng Fu 已提交
31 32 33 34 35
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryComponentParametersParams & {
    // header
    'accept-language'?: string;
  },
R
Rongfeng Fu 已提交
36 37 38 39 40 41 42 43 44 45
  body: API.ParameterRequest,
  options?: { [key: string]: any },
) {
  return request<API.OBResponseDataListParameterMeta_>(
    '/api/v1/components/parameters',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
R
Rongfeng Fu 已提交
46
      params: { ...params },
R
Rongfeng Fu 已提交
47 48 49 50 51
      data: body,
      ...(options || {}),
    },
  );
}