refactor(api): 统一排序参数名从order改为orderBy并简化接口参数

移除冗余参数并统一排序参数命名,提高代码一致性和可维护性
同时为ordercontrollerSyncorder添加请求体和内容类型头
This commit is contained in:
tikkhun 2025-12-22 17:33:25 +08:00
parent 944baf64d0
commit ffa77560fa
3 changed files with 48 additions and 223 deletions

View File

@ -229,12 +229,17 @@ export async function ordercontrollerChangestatus(
export async function ordercontrollerSyncorder( export async function ordercontrollerSyncorder(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象) // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.ordercontrollerSyncorderParams, params: API.ordercontrollerSyncorderParams,
body: Record<string, any>,
options?: { [key: string]: any }, options?: { [key: string]: any },
) { ) {
const { siteId: param0, ...queryParams } = params; const { siteId: param0, ...queryParams } = params;
return request<API.BooleanRes>(`/order/syncOrder/${param0}`, { return request<API.BooleanRes>(`/order/syncOrder/${param0}`, {
method: 'POST', method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
params: { ...queryParams }, params: { ...queryParams },
data: body,
...(options || {}), ...(options || {}),
}); });
} }

View File

@ -17,8 +17,8 @@ export async function siteapicontrollerGetcustomers(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}, },
@ -76,8 +76,8 @@ export async function siteapicontrollerExportcustomers(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}); });
@ -129,8 +129,8 @@ export async function siteapicontrollerGetmedia(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}); });
@ -212,8 +212,8 @@ export async function siteapicontrollerExportmedia(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}); });
@ -232,8 +232,8 @@ export async function siteapicontrollerGetorders(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}); });
@ -309,8 +309,8 @@ export async function siteapicontrollerExportorders(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}); });
@ -350,8 +350,8 @@ export async function siteapicontrollerGetproducts(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}, },
@ -409,8 +409,8 @@ export async function siteapicontrollerExportproducts(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}); });
@ -429,8 +429,8 @@ export async function siteapicontrollerExportproductsspecial(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}); });
@ -492,8 +492,8 @@ export async function siteapicontrollerGetreviews(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}, },
@ -534,8 +534,8 @@ export async function siteapicontrollerGetsubscriptions(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}, },
@ -555,8 +555,8 @@ export async function siteapicontrollerExportsubscriptions(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}); });
@ -575,8 +575,8 @@ export async function siteapicontrollerGetwebhooks(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}); });
@ -672,8 +672,8 @@ export async function siteapicontrollerGetcustomerorders(
...queryParams, ...queryParams,
where: undefined, where: undefined,
...queryParams['where'], ...queryParams['where'],
order: undefined, orderBy: undefined,
...queryParams['order'], ...queryParams['orderBy'],
}, },
...(options || {}), ...(options || {}),
}, },

View File

@ -1584,24 +1584,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1610,24 +1598,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1636,24 +1612,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1662,24 +1626,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1688,24 +1640,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1714,24 +1654,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1740,24 +1668,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
customerId: number; customerId: number;
siteId: number; siteId: number;
}; };
@ -1772,24 +1688,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1802,24 +1706,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1838,24 +1730,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1869,24 +1749,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1895,24 +1763,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1921,24 +1777,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -1952,24 +1796,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
siteId: number; siteId: number;
}; };
@ -2732,24 +2564,12 @@ declare namespace API {
page?: number; page?: number;
/** 每页数量 */ /** 每页数量 */
per_page?: number; per_page?: number;
/** 每页数量别名 */
page_size?: number;
/** 搜索关键词 */ /** 搜索关键词 */
search?: string; search?: string;
/** 状态 */
status?: string;
/** 客户ID,用于筛选订单 */
customer_id?: number;
/** 过滤条件对象 */ /** 过滤条件对象 */
where?: Record<string, any>; where?: Record<string, any>;
/** 排序对象,例如 { "sku": "desc" } */ /** 排序对象,例如 { "sku": "desc" } */
order?: Record<string, any>; orderBy?: Record<string, any>;
/** 排序字段(兼容旧入参) */
orderby?: string;
/** 排序方式(兼容旧入参) */
orderDir?: string;
/** 选中ID列表,逗号分隔 */
ids?: string;
}; };
type UnifiedSubscriptionDTO = { type UnifiedSubscriptionDTO = {