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

View File

@ -1,7 +1,7 @@
// @ts-ignore
/* eslint-disable */
// API 更新时间:
// API 唯一标识:
// API 更新时间
// API 唯一标识
import * as area from './area';
import * as category from './category';
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 */
export async function productcontrollerGetattributelist(
// 叠加生成的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 */
export async function productcontrollerImportproductscsv(
body: {},

View File

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

View File

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