forked from yoone/WEB
1
0
Fork 0

feat(api) 运行 openapit2ts

This commit is contained in:
tikkhun 2026-01-17 14:28:21 +08:00
parent 04b9fed6f7
commit d2a84a9a4a
5 changed files with 128 additions and 16 deletions

View File

@ -990,7 +990,7 @@ const Detail: React.FC<{
<ul> <ul>
{record?.items?.map((item: any) => ( {record?.items?.map((item: any) => (
<li key={item.id}> <li key={item.id}>
{item.name}:{item.quantity} {item.name}({item.sku}):{item.quantity}
</li> </li>
))} ))}
</ul> </ul>
@ -1015,7 +1015,7 @@ const Detail: React.FC<{
<ul> <ul>
{record?.sales?.map((item: any) => ( {record?.sales?.map((item: any) => (
<li key={item.id}> <li key={item.id}>
{item.name}:{item.quantity} {item.name}({item.sku}):{item.quantity}
</li> </li>
))} ))}
</ul> </ul>

View File

@ -1,7 +1,7 @@
// @ts-ignore // @ts-ignore
/* eslint-disable */ /* eslint-disable */
// API 更新时间: // API 更新时间
// API 唯一标识: // API 唯一标识
import * as area from './area'; import * as area from './area';
import * as category from './category'; import * as category from './category';
import * as customer from './customer'; import * as customer from './customer';

View File

@ -125,6 +125,21 @@ export async function productcontrollerBindproductsiteskus(
}); });
} }
/** 此处后端没有提供注释 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 */ /** 此处后端没有提供注释 GET /product/attribute */
export async function productcontrollerGetattributelist( export async function productcontrollerGetattributelist(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
@ -539,6 +554,21 @@ export async function productcontrollerCompatflavorsall(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 */ /** 此处后端没有提供注释 POST /product/import */
export async function productcontrollerImportproductscsv( export async function productcontrollerImportproductscsv(
body: {}, body: {},

View File

@ -78,7 +78,7 @@ export async function statisticscontrollerGetorderbyemail(
} }
/** 此处后端没有提供注释 GET /statistics/orderSource */ /** 此处后端没有提供注释 GET /statistics/orderSource */
export async function statisticscontrollerGetordersorce(options?: { export async function statisticscontrollerGetordersource(options?: {
[key: string]: any; [key: string]: any;
}) { }) {
return request<any>('/statistics/orderSource', { return request<any>('/statistics/orderSource', {

View File

@ -145,6 +145,8 @@ declare namespace API {
price?: number; price?: number;
/** 促销价格 */ /** 促销价格 */
promotionPrice?: number; promotionPrice?: number;
/** 产品图片URL */
image?: string;
/** 属性列表 */ /** 属性列表 */
attributes?: any[]; attributes?: any[];
/** 商品类型 */ /** 商品类型 */
@ -266,6 +268,8 @@ declare namespace API {
sku?: string; sku?: string;
/** 分类ID (DictItem ID) */ /** 分类ID (DictItem ID) */
categoryId?: number; categoryId?: number;
/** 分类名称 */
categoryName?: string;
/** 站点 SKU 列表 */ /** 站点 SKU 列表 */
siteSkus?: any[]; siteSkus?: any[];
/** 属性列表 */ /** 属性列表 */
@ -274,6 +278,8 @@ declare namespace API {
price?: number; price?: number;
/** 促销价格 */ /** 促销价格 */
promotionPrice?: number; promotionPrice?: number;
/** 产品图片URL */
image?: string;
/** 商品类型 */ /** 商品类型 */
type?: 'single' | 'bundle'; type?: 'single' | 'bundle';
/** 产品组成 */ /** 产品组成 */
@ -645,6 +651,10 @@ declare namespace API {
createdAt: string; createdAt: string;
/** 更新时间 */ /** 更新时间 */
updatedAt: string; updatedAt: string;
/** 订单项列表 */
orderItems?: any;
/** 销售项列表 */
orderSales?: any;
}; };
type OrderAddress = { type OrderAddress = {
@ -695,28 +705,48 @@ declare namespace API {
}; };
type ordercontrollerGetorderitemsParams = { type ordercontrollerGetorderitemsParams = {
/** 是否为原产品还是库存产品 */
isSource?: boolean; isSource?: boolean;
exceptPackage?: boolean;
/** 页码 */ /** 页码 */
current?: number; current?: number;
/** 每页大小 */ /** 每页大小 */
pageSize?: number; pageSize?: number;
/** 排序对象,格式如 { productName: "asc", sku: "desc" } */
orderBy?: any;
/** 是否排除套餐 */
exceptPackage?: boolean;
/** 站点ID */
siteId?: number; siteId?: number;
/** 名称 */
name?: string; name?: string;
/** SKU */
sku?: string;
/** 开始日期 */
startDate?: string; startDate?: string;
/** 结束日期 */
endDate?: string; endDate?: string;
}; };
type ordercontrollerGetordersalesParams = { type ordercontrollerGetordersalesParams = {
/** 是否为原产品还是库存产品 */
isSource?: boolean; isSource?: boolean;
exceptPackage?: boolean;
/** 页码 */ /** 页码 */
current?: number; current?: number;
/** 每页大小 */ /** 每页大小 */
pageSize?: number; pageSize?: number;
/** 排序对象,格式如 { productName: "asc", sku: "desc" } */
orderBy?: any;
/** 是否排除套餐 */
exceptPackage?: boolean;
/** 站点ID */
siteId?: number; siteId?: number;
/** 名称 */
name?: string; name?: string;
/** SKU */
sku?: string;
/** 开始日期 */
startDate?: string; startDate?: string;
/** 结束日期 */
endDate?: string; endDate?: string;
}; };
@ -820,6 +850,10 @@ declare namespace API {
createdAt: string; createdAt: string;
/** 更新时间 */ /** 更新时间 */
updatedAt: string; updatedAt: string;
/** 订单项列表 */
orderItems?: any;
/** 销售项列表 */
orderSales?: any;
items?: OrderItem[]; items?: OrderItem[];
sales?: OrderSale[]; sales?: OrderSale[];
refundItems?: OrderRefundItem[]; refundItems?: OrderRefundItem[];
@ -935,10 +969,19 @@ declare namespace API {
sku?: string; sku?: string;
quantity?: number; quantity?: number;
isPackage?: boolean; isPackage?: boolean;
isYoone?: boolean; /** 商品品类 */
isZex?: boolean; category?: string;
size?: number; /** 品牌 */
isYooneNew?: boolean; brand?: string;
/** 口味 */
flavor?: string;
/** 湿度 */
humidity?: string;
/** 尺寸 */
size?: string;
strength?: string;
/** 版本 */
version?: string;
/** 创建时间 */ /** 创建时间 */
createdAt?: string; createdAt?: string;
/** 更新时间 */ /** 更新时间 */
@ -956,10 +999,19 @@ declare namespace API {
sku?: string; sku?: string;
quantity?: number; quantity?: number;
isPackage?: boolean; isPackage?: boolean;
isYoone?: boolean; /** 商品品类 */
isZex?: boolean; category?: string;
size?: number; /** 品牌 */
isYooneNew?: boolean; brand?: string;
/** 口味 */
flavor?: string;
/** 湿度 */
humidity?: string;
/** 尺寸 */
size?: string;
strength?: string;
/** 版本 */
version?: string;
/** 创建时间 */ /** 创建时间 */
createdAt?: string; createdAt?: string;
/** 更新时间 */ /** 更新时间 */
@ -994,6 +1046,7 @@ declare namespace API {
endDate?: string; endDate?: string;
keyword?: string; keyword?: string;
siteId?: number; siteId?: number;
country?: any;
purchaseType?: 'all' | 'first_purchase' | 'repeat_purchase'; purchaseType?: 'all' | 'first_purchase' | 'repeat_purchase';
orderType?: 'all' | 'cpc' | 'non_cpc'; orderType?: 'all' | 'cpc' | 'non_cpc';
brand?: 'all' | 'zyn' | 'yoone' | 'zolt'; brand?: 'all' | 'zyn' | 'yoone' | 'zolt';
@ -1034,10 +1087,14 @@ declare namespace API {
shortDescription?: string; shortDescription?: string;
/** 产品描述 */ /** 产品描述 */
description?: string; description?: string;
/** 产品图片URL */
image?: string;
/** 价格 */ /** 价格 */
price?: number; price?: number;
/** 促销价格 */ /** 促销价格 */
promotionPrice?: number; promotionPrice?: number;
/** 分类 ID */
categoryId?: number;
/** 库存组成 */ /** 库存组成 */
components?: ProductStockComponent[]; components?: ProductStockComponent[];
/** 站点 SKU 列表 */ /** 站点 SKU 列表 */
@ -1134,6 +1191,10 @@ declare namespace API {
id: number; id: number;
}; };
type productcontrollerGetallproductsParams = {
brand?: string;
};
type productcontrollerGetattributeallParams = { type productcontrollerGetattributeallParams = {
dictName?: string; dictName?: string;
}; };
@ -1149,6 +1210,11 @@ declare namespace API {
id: number; id: number;
}; };
type productcontrollerGetgroupedproductsParams = {
attribute?: string;
brand?: string;
};
type productcontrollerGetproductbyidParams = { type productcontrollerGetproductbyidParams = {
id: number; id: number;
}; };
@ -1371,15 +1437,25 @@ declare namespace API {
}; };
type QueryOrderSalesDTO = { type QueryOrderSalesDTO = {
/** 是否为原产品还是库存产品 */
isSource?: boolean; isSource?: boolean;
exceptPackage?: boolean;
/** 页码 */ /** 页码 */
current?: number; current?: number;
/** 每页大小 */ /** 每页大小 */
pageSize?: number; pageSize?: number;
/** 排序对象,格式如 { productName: "asc", sku: "desc" } */
orderBy?: any;
/** 是否排除套餐 */
exceptPackage?: boolean;
/** 站点ID */
siteId?: number; siteId?: number;
/** 名称 */
name?: string; name?: string;
/** SKU */
sku?: string;
/** 开始日期 */
startDate?: string; startDate?: string;
/** 结束日期 */
endDate?: string; endDate?: string;
}; };
@ -3088,12 +3164,16 @@ declare namespace API {
sku?: string; sku?: string;
/** 分类ID (DictItem ID) */ /** 分类ID (DictItem ID) */
categoryId?: number; categoryId?: number;
/** 分类名称 */
categoryName?: string;
/** 站点 SKU 列表 */ /** 站点 SKU 列表 */
siteSkus?: any[]; siteSkus?: any[];
/** 价格 */ /** 价格 */
price?: number; price?: number;
/** 促销价格 */ /** 促销价格 */
promotionPrice?: number; promotionPrice?: number;
/** 产品图片URL */
image?: string;
/** 属性列表 */ /** 属性列表 */
attributes?: any[]; attributes?: any[];
/** 商品类型 */ /** 商品类型 */
@ -3144,6 +3224,8 @@ declare namespace API {
stockPointIds?: any; stockPointIds?: any;
/** 站点网站URL */ /** 站点网站URL */
websiteUrl?: string; websiteUrl?: string;
/** Webhook URL */
webhookUrl?: string;
}; };
type UpdateStockDTO = { type UpdateStockDTO = {