diff --git a/src/pages/Order/List/index.tsx b/src/pages/Order/List/index.tsx index 9b323d3..277c55d 100644 --- a/src/pages/Order/List/index.tsx +++ b/src/pages/Order/List/index.tsx @@ -26,7 +26,6 @@ import { import { productcontrollerSearchproducts } from '@/servers/api/product'; import { sitecontrollerAll } from '@/servers/api/site'; import { stockcontrollerGetallstockpoints } from '@/servers/api/stock'; -import { wpproductcontrollerSearchproducts } from '@/servers/api/wpProduct'; import { formatShipmentState, formatSource } from '@/utils/format'; import { CodeSandboxOutlined, diff --git a/src/pages/Product/List/index.tsx b/src/pages/Product/List/index.tsx index d0db50d..3f3bd9f 100644 --- a/src/pages/Product/List/index.tsx +++ b/src/pages/Product/List/index.tsx @@ -10,10 +10,6 @@ import { } from '@/servers/api/product'; import { sitecontrollerAll } from '@/servers/api/site'; import { siteapicontrollerGetproducts } from '@/servers/api/siteApi'; -import { - wpproductcontrollerBatchsynctosite, - wpproductcontrollerSynctoproduct, -} from '@/servers/api/wpProduct'; import { ActionType, ModalForm, diff --git a/src/pages/Site/List/index.tsx b/src/pages/Site/List/index.tsx index e96137a..47e6ec7 100644 --- a/src/pages/Site/List/index.tsx +++ b/src/pages/Site/List/index.tsx @@ -6,7 +6,6 @@ import { sitecontrollerUpdate, } from '@/servers/api/site'; import { subscriptioncontrollerSync } from '@/servers/api/subscription'; -import { wpproductcontrollerSyncproducts } from '@/servers/api/wpProduct'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; import { Button, message, notification, Popconfirm, Space, Tag } from 'antd'; import React, { useRef, useState } from 'react'; diff --git a/src/servers/api/index.ts b/src/servers/api/index.ts index c8db741..d6e8542 100644 --- a/src/servers/api/index.ts +++ b/src/servers/api/index.ts @@ -19,7 +19,6 @@ import * as subscription from './subscription'; import * as template from './template'; import * as user from './user'; import * as webhook from './webhook'; -import * as wpProduct from './wpProduct'; export default { area, category, @@ -38,5 +37,4 @@ export default { template, user, webhook, - wpProduct, }; diff --git a/src/servers/api/product.ts b/src/servers/api/product.ts index 6b4aed8..905ff3f 100644 --- a/src/servers/api/product.ts +++ b/src/servers/api/product.ts @@ -770,16 +770,6 @@ export async function productcontrollerSyncstocktoproduct(options?: { }); } -/** 此处后端没有提供注释 GET /product/wp-products */ -export async function productcontrollerGetwpproducts(options?: { - [key: string]: any; -}) { - return request('/product/wp-products', { - method: 'GET', - ...(options || {}), - }); -} - /** 此处后端没有提供注释 PUT /productupdateNameCn/${param1}/${param0} */ export async function productcontrollerUpdatenamecn( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) diff --git a/src/servers/api/typings.d.ts b/src/servers/api/typings.d.ts index d4ae648..45fdbd5 100644 --- a/src/servers/api/typings.d.ts +++ b/src/servers/api/typings.d.ts @@ -91,11 +91,6 @@ declare namespace API { orders?: BatchShipOrderItemDTO[]; }; - type BatchSyncProductsDTO = { - /** 产品ID列表 */ - productIds?: number[]; - }; - type BatchUpdateProductDTO = { /** 产品ID列表 */ ids: any[]; @@ -123,36 +118,6 @@ declare namespace API { type?: 'single' | 'bundle'; }; - type BatchUpdateProductsDTO = { - /** 产品ID列表 */ - ids?: number[]; - /** 常规价格 */ - regular_price?: number; - /** 销售价格 */ - sale_price?: number; - /** 分类列表 */ - categories?: string[]; - /** 标签列表 */ - tags?: string[]; - /** 状态 */ - status?: - | 'publish' - | 'draft' - | 'pending' - | 'private' - | 'trash' - | 'auto-draft' - | 'future' - | 'inherit'; - }; - - type BatchUpdateTagsDTO = { - /** 产品ID列表 */ - ids?: number[]; - /** 标签列表 */ - tags?: string[]; - }; - type BooleanRes = { /** 状态码 */ code?: number; @@ -1375,29 +1340,6 @@ declare namespace API { keyword?: string; }; - type QueryWpProductDTO = { - /** 页码 */ - current?: number; - /** 每页大小 */ - pageSize?: number; - /** 产品名 */ - name?: string; - /** 站点ID */ - siteId?: string; - /** 产品状态 */ - status?: - | 'publish' - | 'draft' - | 'pending' - | 'private' - | 'trash' - | 'auto-draft' - | 'future' - | 'inherit'; - /** SKU列表 */ - skus?: any[]; - }; - type RateDTO = { carrier_name?: string; service_name?: string; @@ -1534,8 +1476,6 @@ declare namespace API { reference_codes?: any; }; - type Site = {}; - type siteapicontrollerBatchcustomersParams = { siteId: number; }; @@ -2350,8 +2290,6 @@ declare namespace API { page?: number; /** 每页数量 */ per_page?: number; - /** 每页数量别名 */ - page_size?: number; /** 总页数 */ totalPages?: number; }; @@ -2393,8 +2331,6 @@ declare namespace API { page?: number; /** 每页数量 */ per_page?: number; - /** 每页数量别名 */ - page_size?: number; /** 总页数 */ totalPages?: number; }; @@ -2464,8 +2400,6 @@ declare namespace API { page?: number; /** 每页数量 */ per_page?: number; - /** 每页数量别名 */ - page_size?: number; /** 总页数 */ totalPages?: number; }; @@ -2479,8 +2413,6 @@ declare namespace API { page?: number; /** 每页数量 */ per_page?: number; - /** 每页数量别名 */ - page_size?: number; /** 总页数 */ totalPages?: number; }; @@ -2552,8 +2484,6 @@ declare namespace API { page?: number; /** 每页数量 */ per_page?: number; - /** 每页数量别名 */ - page_size?: number; /** 总页数 */ totalPages?: number; }; @@ -2609,8 +2539,6 @@ declare namespace API { page?: number; /** 每页数量 */ per_page?: number; - /** 每页数量别名 */ - page_size?: number; /** 总页数 */ totalPages?: number; }; @@ -2662,8 +2590,6 @@ declare namespace API { page?: number; /** 每页数量 */ per_page?: number; - /** 每页数量别名 */ - page_size?: number; /** 总页数 */ totalPages?: number; }; @@ -2791,19 +2717,6 @@ declare namespace API { testData?: string; }; - type UpdateVariationDTO = { - /** 产品名称 */ - name?: string; - /** SKU */ - sku?: string; - /** 常规价格 */ - regular_price?: number; - /** 销售价格 */ - sale_price?: number; - /** 是否促销中 */ - on_sale?: boolean; - }; - type UpdateWebhookDTO = { /** 名称 */ name?: string; @@ -2821,25 +2734,6 @@ declare namespace API { api_version?: string; }; - type UpdateWpProductDTO = { - /** 变体名称 */ - name?: string; - /** SKU */ - sku?: string; - /** 常规价格 */ - regular_price?: number; - /** 销售价格 */ - sale_price?: number; - /** 是否促销中 */ - on_sale?: boolean; - /** 分类列表 */ - categories?: string[]; - /** 标签列表 */ - tags?: string[]; - /** 站点ID */ - siteId?: number; - }; - type UploadMediaDTO = { /** Base64 编码的文件内容 */ file?: string; @@ -2851,223 +2745,7 @@ declare namespace API { id?: number; }; - type VariationDTO = { - /** ID */ - id: number; - /** 站点 id */ - siteId?: number; - /** wp产品ID */ - externalProductId: string; - /** wp变体ID */ - externalVariationId: string; - /** 对应WP产品表的ID */ - productId: number; - /** sku */ - sku?: string; - /** 变体名称 */ - name: string; - /** 常规价格 */ - regular_price?: number; - /** 销售价格 */ - sale_price?: number; - /** 是否促销中 */ - on_sale?: boolean; - /** 是否删除 */ - on_delete?: boolean; - /** 创建时间 */ - createdAt: string; - /** 更新时间 */ - updatedAt: string; - }; - type webhookcontrollerHandlewoowebhookParams = { siteId?: string; }; - - type wpproductcontrollerBatchsynctositeParams = { - siteId: number; - }; - - type wpproductcontrollerCreateproductParams = { - siteId: number; - }; - - type wpproductcontrollerDeleteParams = { - id: number; - }; - - type wpproductcontrollerGetwpproductsParams = { - /** 页码 */ - current?: number; - /** 每页大小 */ - pageSize?: number; - /** 产品名 */ - name?: string; - /** 站点ID */ - siteId?: string; - /** 产品状态 */ - status?: - | 'publish' - | 'draft' - | 'pending' - | 'private' - | 'trash' - | 'auto-draft' - | 'future' - | 'inherit'; - /** SKU列表 */ - skus?: any[]; - }; - - type wpproductcontrollerImportproductsParams = { - siteId: number; - }; - - type wpproductcontrollerSearchproductsParams = { - name?: string; - }; - - type wpproductcontrollerSyncproductsParams = { - siteId: number; - }; - - type wpproductcontrollerSynctoproductParams = { - id: number; - }; - - type wpproductcontrollerUpdateproductParams = { - productId: string; - siteId: number; - }; - - type wpproductcontrollerUpdatevariationParams = { - variationId: string; - productId: string; - siteId: number; - }; - - type wpproductcontrollerUpdatewpproductstateParams = { - id: number; - }; - - type WpProductDTO = { - /** ID */ - id: number; - /** wp网站ID */ - siteId: number; - /** 站点信息 */ - site?: Site; - /** wp产品ID */ - externalProductId: string; - /** 商店sku */ - sku?: string; - /** 产品名称 */ - name: string; - /** 产品状态 */ - status?: - | 'publish' - | 'draft' - | 'pending' - | 'private' - | 'trash' - | 'auto-draft' - | 'future' - | 'inherit'; - /** 是否为特色产品 */ - featured?: boolean; - /** 目录可见性 */ - catalog_visibility?: string; - /** 产品描述 */ - description?: string; - /** 产品短描述 */ - short_description?: string; - /** 上下架状态 */ - stockStatus?: 'instock' | 'outofstock' | 'onbackorder'; - /** 库存数量 */ - stock_quantity?: number; - /** 允许缺货下单 */ - backorders?: string; - /** 是否单独出售 */ - sold_individually?: boolean; - /** 常规价格 */ - regular_price?: number; - /** 销售价格 */ - sale_price?: number; - /** 促销开始日期 */ - date_on_sale_from?: Date; - /** 促销结束日期 */ - date_on_sale_to?: Date; - /** 是否促销中 */ - on_sale?: boolean; - /** 税务状态 */ - tax_status?: string; - /** 税类 */ - tax_class?: string; - /** 重量(g) */ - weight?: number; - /** 尺寸(长宽高) */ - dimensions?: any; - /** 允许评论 */ - reviews_allowed?: boolean; - /** 购买备注 */ - purchase_note?: string; - /** 菜单排序 */ - menu_order?: number; - /** 产品类型 */ - type?: 'simple' | 'variable' | 'woosb'; - /** 父产品ID */ - parent_id?: number; - /** 外部产品URL */ - external_url?: string; - /** 外部产品按钮文本 */ - button_text?: string; - /** 分组产品 */ - grouped_products?: any; - /** 追加销售 */ - upsell_ids?: any; - /** 交叉销售 */ - cross_sell_ids?: any; - /** 分类 */ - categories?: any; - /** 标签 */ - tags?: any; - /** 图片 */ - images?: any; - /** 产品属性 */ - attributes?: any; - /** 默认属性 */ - default_attributes?: any; - /** GTIN */ - gtin?: string; - /** 是否删除 */ - on_delete?: boolean; - /** 创建时间 */ - createdAt: string; - /** 更新时间 */ - updatedAt: string; - /** 变体列表 */ - variations?: VariationDTO[]; - }; - - type WpProductListRes = { - /** 状态码 */ - code?: number; - /** 是否成功 */ - success?: boolean; - /** 消息内容 */ - message?: string; - /** 响应数据 */ - data?: WpProductPaginatedResponse; - }; - - type WpProductPaginatedResponse = { - /** 当前页码 */ - page?: number; - /** 每页大小 */ - pageSize?: number; - /** 总记录数 */ - total?: number; - /** 数据列表 */ - items?: WpProductDTO[]; - }; } diff --git a/src/servers/api/wpProduct.ts b/src/servers/api/wpProduct.ts deleted file mode 100644 index 637bc2d..0000000 --- a/src/servers/api/wpProduct.ts +++ /dev/null @@ -1,269 +0,0 @@ -// @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 || {}), - }); -}