// @ts-ignore /* eslint-disable */ import { request } from 'umi'; /** 此处后端没有提供注释 DELETE /wp_product/${param0} */ export async function wpproductcontrollerDelete( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerDeleteParams, options?: { [key: string]: any }, ) { const { id: param0, ...queryParams } = params; return request(`/wp_product/${param0}`, { method: 'DELETE', params: { ...queryParams }, ...(options || {}), }); } /** 此处后端没有提供注释 POST /wp_product/batch-sync-to-site/${param0} */ export async function wpproductcontrollerBatchsynctosite( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerBatchsynctositeParams, body: API.BatchSyncProductsDTO, options?: { [key: string]: any }, ) { const { siteId: param0, ...queryParams } = params; return request(`/wp_product/batch-sync-to-site/${param0}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, params: { ...queryParams }, data: body, ...(options || {}), }); } /** 此处后端没有提供注释 POST /wp_product/batch-update */ export async function wpproductcontrollerBatchupdateproducts( body: API.BatchUpdateProductsDTO, options?: { [key: string]: any }, ) { return request('/wp_product/batch-update', { method: 'POST', headers: { 'Content-Type': 'application/json', }, data: body, ...(options || {}), }); } /** 此处后端没有提供注释 POST /wp_product/batch-update-tags */ export async function wpproductcontrollerBatchupdatetags( body: API.BatchUpdateTagsDTO, options?: { [key: string]: any }, ) { return request('/wp_product/batch-update-tags', { method: 'POST', headers: { 'Content-Type': 'application/json', }, data: body, ...(options || {}), }); } /** 此处后端没有提供注释 POST /wp_product/import/${param0} */ export async function wpproductcontrollerImportproducts( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerImportproductsParams, body: {}, files?: File[], options?: { [key: string]: any }, ) { const { siteId: param0, ...queryParams } = params; const formData = new FormData(); if (files) { files.forEach((f) => formData.append('files', f || '')); } Object.keys(body).forEach((ele) => { const item = (body as any)[ele]; if (item !== undefined && item !== null) { if (typeof item === 'object' && !(item instanceof File)) { if (item instanceof Array) { item.forEach((f) => formData.append(ele, f || '')); } else { formData.append( ele, new Blob([JSON.stringify(item)], { type: 'application/json' }), ); } } else { formData.append(ele, item); } } }); return request(`/wp_product/import/${param0}`, { method: 'POST', params: { ...queryParams }, data: formData, requestType: 'form', ...(options || {}), }); } /** 此处后端没有提供注释 GET /wp_product/list */ export async function wpproductcontrollerGetwpproducts( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerGetwpproductsParams, options?: { [key: string]: any }, ) { return request('/wp_product/list', { method: 'GET', params: { ...params, }, ...(options || {}), }); } /** 此处后端没有提供注释 GET /wp_product/search */ export async function wpproductcontrollerSearchproducts( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerSearchproductsParams, options?: { [key: string]: any }, ) { return request('/wp_product/search', { method: 'GET', params: { ...params, }, ...(options || {}), }); } /** 此处后端没有提供注释 POST /wp_product/setconstitution */ export async function wpproductcontrollerSetconstitution( body: Record, options?: { [key: string]: any }, ) { return request('/wp_product/setconstitution', { method: 'POST', headers: { 'Content-Type': 'text/plain', }, data: body, ...(options || {}), }); } /** 此处后端没有提供注释 POST /wp_product/siteId/${param0}/products */ export async function wpproductcontrollerCreateproduct( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerCreateproductParams, body: Record, options?: { [key: string]: any }, ) { const { siteId: param0, ...queryParams } = params; return request(`/wp_product/siteId/${param0}/products`, { method: 'POST', headers: { 'Content-Type': 'text/plain', }, params: { ...queryParams }, data: body, ...(options || {}), }); } /** 此处后端没有提供注释 PUT /wp_product/siteId/${param1}/products/${param0} */ export async function wpproductcontrollerUpdateproduct( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerUpdateproductParams, body: API.UpdateWpProductDTO, options?: { [key: string]: any }, ) { const { productId: param0, siteId: param1, ...queryParams } = params; return request( `/wp_product/siteId/${param1}/products/${param0}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, params: { ...queryParams }, data: body, ...(options || {}), }, ); } /** 此处后端没有提供注释 PUT /wp_product/siteId/${param2}/products/${param1}/variations/${param0} */ export async function wpproductcontrollerUpdatevariation( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerUpdatevariationParams, body: API.UpdateVariationDTO, options?: { [key: string]: any }, ) { const { variationId: param0, productId: param1, siteId: param2, ...queryParams } = params; return request( `/wp_product/siteId/${param2}/products/${param1}/variations/${param0}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, params: { ...queryParams }, data: body, ...(options || {}), }, ); } /** 此处后端没有提供注释 POST /wp_product/sync-to-product/${param0} */ export async function wpproductcontrollerSynctoproduct( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerSynctoproductParams, options?: { [key: string]: any }, ) { const { id: param0, ...queryParams } = params; return request(`/wp_product/sync-to-product/${param0}`, { method: 'POST', params: { ...queryParams }, ...(options || {}), }); } /** 此处后端没有提供注释 POST /wp_product/sync/${param0} */ export async function wpproductcontrollerSyncproducts( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerSyncproductsParams, options?: { [key: string]: any }, ) { const { siteId: param0, ...queryParams } = params; return request(`/wp_product/sync/${param0}`, { method: 'POST', params: { ...queryParams }, ...(options || {}), }); } /** 此处后端没有提供注释 POST /wp_product/updateState/${param0} */ export async function wpproductcontrollerUpdatewpproductstate( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) params: API.wpproductcontrollerUpdatewpproductstateParams, body: Record, options?: { [key: string]: any }, ) { const { id: param0, ...queryParams } = params; return request(`/wp_product/updateState/${param0}`, { method: 'POST', headers: { 'Content-Type': 'text/plain', }, params: { ...queryParams }, data: body, ...(options || {}), }); }