forked from yoone/WEB
1
0
Fork 0
WEB/src/servers/api/product.ts

891 lines
26 KiB
TypeScript

// @ts-ignore
/* eslint-disable */
import { request } from 'umi';
/** 此处后端没有提供注释 POST /product/ */
export async function productcontrollerCreateproduct(
body: API.CreateProductDTO,
options?: { [key: string]: any },
) {
return request<API.ProductRes>('/product/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/${param0} */
export async function productcontrollerGetproductbyid(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetproductbyidParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.ProductRes>(`/product/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /product/${param0} */
export async function productcontrollerUpdateproduct(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerUpdateproductParams,
body: API.UpdateProductDTO,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.ProductRes>(`/product/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 DELETE /product/${param0} */
export async function productcontrollerDeleteproduct(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerDeleteproductParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.BooleanRes>(`/product/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/${param0}/components */
export async function productcontrollerGetproductcomponents(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetproductcomponentsParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/${param0}/components`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/${param0}/components/auto */
export async function productcontrollerAutobindcomponents(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerAutobindcomponentsParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/${param0}/components/auto`, {
method: 'POST',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/${param0}/site-skus */
export async function productcontrollerGetproductsiteskus(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetproductsiteskusParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/${param0}/site-skus`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/${param0}/site-skus */
export async function productcontrollerBindproductsiteskus(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerBindproductsiteskusParams,
body: Record<string, any>,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/${param0}/site-skus`, {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
params: { ...queryParams },
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/all */
export async function productcontrollerGetallproducts(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetallproductsParams,
options?: { [key: string]: any },
) {
return request<API.ProductListRes>('/product/all', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/attribute */
export async function productcontrollerGetattributelist(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetattributelistParams,
options?: { [key: string]: any },
) {
return request<any>('/product/attribute', {
method: 'GET',
params: {
...params,
pageSize: undefined,
...params['pageSize'],
current: undefined,
...params['current'],
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/attribute */
export async function productcontrollerCreateattribute(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCreateattributeParams,
body: Record<string, any>,
options?: { [key: string]: any },
) {
return request<any>('/product/attribute', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
params: {
...params,
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /product/attribute/${param0} */
export async function productcontrollerUpdateattribute(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerUpdateattributeParams,
body: Record<string, any>,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/attribute/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'text/plain',
},
params: {
...queryParams,
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 DELETE /product/attribute/${param0} */
export async function productcontrollerDeleteattribute(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerDeleteattributeParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.BooleanRes>(`/product/attribute/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/attributeAll */
export async function productcontrollerGetattributeall(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetattributeallParams,
options?: { [key: string]: any },
) {
return request<any>('/product/attributeAll', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/batch-delete */
export async function productcontrollerBatchdeleteproduct(
body: API.BatchDeleteProductDTO,
options?: { [key: string]: any },
) {
return request<API.BooleanRes>('/product/batch-delete', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/batch-sync-from-site */
export async function productcontrollerBatchsyncfromsite(
body: Record<string, any>,
options?: { [key: string]: any },
) {
return request<API.SyncOperationResultDTO>('/product/batch-sync-from-site', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/batch-sync-to-site */
export async function productcontrollerBatchsynctosite(
body: API.BatchSyncProductToSiteDTO,
options?: { [key: string]: any },
) {
return request<API.SyncOperationResultDTO>('/product/batch-sync-to-site', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /product/batch-update */
export async function productcontrollerBatchupdateproduct(
body: API.BatchUpdateProductDTO,
options?: { [key: string]: any },
) {
return request<API.BooleanRes>('/product/batch-update', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/brand */
export async function productcontrollerCompatcreatebrand(
body: Record<string, any>,
options?: { [key: string]: any },
) {
return request<any>('/product/brand', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /product/brand/${param0} */
export async function productcontrollerCompatupdatebrand(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatupdatebrandParams,
body: Record<string, any>,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/brand/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'text/plain',
},
params: { ...queryParams },
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 DELETE /product/brand/${param0} */
export async function productcontrollerCompatdeletebrand(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatdeletebrandParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.BooleanRes>(`/product/brand/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/brandAll */
export async function productcontrollerCompatbrandall(options?: {
[key: string]: any;
}) {
return request<any>('/product/brandAll', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/brands */
export async function productcontrollerCompatbrands(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatbrandsParams,
options?: { [key: string]: any },
) {
return request<any>('/product/brands', {
method: 'GET',
params: {
...params,
pageSize: undefined,
...params['pageSize'],
current: undefined,
...params['current'],
},
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/categories/all */
export async function productcontrollerGetcategoriesall(options?: {
[key: string]: any;
}) {
return request<any>('/product/categories/all', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/category */
export async function productcontrollerCreatecategory(
body: API.CreateCategoryDTO,
options?: { [key: string]: any },
) {
return request<any>('/product/category', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /product/category/${param0} */
export async function productcontrollerUpdatecategory(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerUpdatecategoryParams,
body: API.UpdateCategoryDTO,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/category/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 DELETE /product/category/${param0} */
export async function productcontrollerDeletecategory(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerDeletecategoryParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/category/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/category/${param0}/attributes */
export async function productcontrollerGetcategoryattributes(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetcategoryattributesParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/category/${param0}/attributes`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/category/attribute */
export async function productcontrollerCreatecategoryattribute(
body: Record<string, any>,
options?: { [key: string]: any },
) {
return request<any>('/product/category/attribute', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 DELETE /product/category/attribute/${param0} */
export async function productcontrollerDeletecategoryattribute(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerDeletecategoryattributeParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/category/attribute/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/export */
export async function productcontrollerExportproductscsv(options?: {
[key: string]: any;
}) {
return request<any>('/product/export', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/flavors */
export async function productcontrollerCompatflavors(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatflavorsParams,
options?: { [key: string]: any },
) {
return request<any>('/product/flavors', {
method: 'GET',
params: {
...params,
pageSize: undefined,
...params['pageSize'],
current: undefined,
...params['current'],
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/flavors */
export async function productcontrollerCompatcreateflavors(
body: Record<string, any>,
options?: { [key: string]: any },
) {
return request<any>('/product/flavors', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /product/flavors/${param0} */
export async function productcontrollerCompatupdateflavors(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatupdateflavorsParams,
body: Record<string, any>,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/flavors/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'text/plain',
},
params: { ...queryParams },
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 DELETE /product/flavors/${param0} */
export async function productcontrollerCompatdeleteflavors(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatdeleteflavorsParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.BooleanRes>(`/product/flavors/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/flavorsAll */
export async function productcontrollerCompatflavorsall(options?: {
[key: string]: any;
}) {
return request<any>('/product/flavorsAll', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/grouped */
export async function productcontrollerGetgroupedproducts(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetgroupedproductsParams,
options?: { [key: string]: any },
) {
return request<any>('/product/grouped', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/import */
export async function productcontrollerImportproductscsv(
body: {},
files?: File[],
options?: { [key: string]: any },
) {
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<any>('/product/import', {
method: 'POST',
data: formData,
requestType: 'form',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/list */
export async function productcontrollerGetproductlist(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetproductlistParams,
options?: { [key: string]: any },
) {
return request<API.ProductListRes>('/product/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/list/grouped */
export async function productcontrollerGetproductlistgrouped(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetproductlistgroupedParams,
options?: { [key: string]: any },
) {
return request<Record<string, any>>('/product/list/grouped', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/search */
export async function productcontrollerSearchproducts(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerSearchproductsParams,
options?: { [key: string]: any },
) {
return request<API.ProductsRes>('/product/search', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/site-sku/${param0} */
export async function productcontrollerGetproductbysitesku(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerGetproductbysiteskuParams,
options?: { [key: string]: any },
) {
const { siteSku: param0, ...queryParams } = params;
return request<API.ProductRes>(`/product/site-sku/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/size */
export async function productcontrollerCompatsize(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatsizeParams,
options?: { [key: string]: any },
) {
return request<any>('/product/size', {
method: 'GET',
params: {
...params,
pageSize: undefined,
...params['pageSize'],
current: undefined,
...params['current'],
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/size */
export async function productcontrollerCompatcreatesize(
body: Record<string, any>,
options?: { [key: string]: any },
) {
return request<any>('/product/size', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /product/size/${param0} */
export async function productcontrollerCompatupdatesize(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatupdatesizeParams,
body: Record<string, any>,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/size/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'text/plain',
},
params: { ...queryParams },
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 DELETE /product/size/${param0} */
export async function productcontrollerCompatdeletesize(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatdeletesizeParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.BooleanRes>(`/product/size/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/sizeAll */
export async function productcontrollerCompatsizeall(options?: {
[key: string]: any;
}) {
return request<any>('/product/sizeAll', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/sku/${param0} */
export async function productcontrollerProductbysku(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerProductbyskuParams,
options?: { [key: string]: any },
) {
const { sku: param0, ...queryParams } = params;
return request<API.ProductRes>(`/product/sku/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/strength */
export async function productcontrollerCompatstrength(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatstrengthParams,
options?: { [key: string]: any },
) {
return request<any>('/product/strength', {
method: 'GET',
params: {
...params,
pageSize: undefined,
...params['pageSize'],
current: undefined,
...params['current'],
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/strength */
export async function productcontrollerCompatcreatestrength(
body: Record<string, any>,
options?: { [key: string]: any },
) {
return request<any>('/product/strength', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /product/strength/${param0} */
export async function productcontrollerCompatupdatestrength(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatupdatestrengthParams,
body: Record<string, any>,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/product/strength/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'text/plain',
},
params: { ...queryParams },
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 DELETE /product/strength/${param0} */
export async function productcontrollerCompatdeletestrength(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerCompatdeletestrengthParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.BooleanRes>(`/product/strength/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /product/strengthAll */
export async function productcontrollerCompatstrengthall(options?: {
[key: string]: any;
}) {
return request<any>('/product/strengthAll', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/sync-from-site */
export async function productcontrollerSyncproductfromsite(
body: Record<string, any>,
options?: { [key: string]: any },
) {
return request<API.ProductRes>('/product/sync-from-site', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/sync-stock */
export async function productcontrollerSyncstocktoproduct(options?: {
[key: string]: any;
}) {
return request<any>('/product/sync-stock', {
method: 'POST',
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /product/sync-to-site */
export async function productcontrollerSynctosite(
body: API.SyncProductToSiteDTO,
options?: { [key: string]: any },
) {
return request<API.SyncProductToSiteResultDTO>('/product/sync-to-site', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /productupdateNameCn/${param1}/${param0} */
export async function productcontrollerUpdatenamecn(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.productcontrollerUpdatenamecnParams,
options?: { [key: string]: any },
) {
const { nameCn: param0, id: param1, ...queryParams } = params;
return request<API.ProductRes>(`/productupdateNameCn/${param1}/${param0}`, {
method: 'PUT',
params: { ...queryParams },
...(options || {}),
});
}