mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 05:49:20 +08:00
144 lines
3.7 KiB
TypeScript
144 lines
3.7 KiB
TypeScript
import { requestClient } from '#/api/request';
|
|
|
|
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
|
import type { OrderDTO, OrderVO, BatchImportResultVO, OrderStatusDTO, OrderStatusVO, PromotionFeeTypeDTO, PromotionFeeTypeVO } from './types';
|
|
|
|
/**
|
|
* 订单管理API
|
|
*/
|
|
|
|
/**
|
|
* 分页获取订单列表
|
|
*/
|
|
export async function getOrderPageApi(params: PageQueryDTO<OrderDTO.OrderFilterDTO>) {
|
|
return requestClient.post<PageResultVO<OrderVO.OrderInfoVO>>('/ec/order/page', params);
|
|
}
|
|
|
|
/**
|
|
* 创建订单
|
|
*/
|
|
export async function createOrderApi(data: OrderDTO.CreateOrderDTO) {
|
|
return requestClient.post<OrderVO.OrderInfoVO>('/ec/order/create', data);
|
|
}
|
|
|
|
/**
|
|
* 更新订单
|
|
*/
|
|
export async function updateOrderApi(id: number, data: OrderDTO.UpdateOrderDTO) {
|
|
return requestClient.put<OrderVO.OrderInfoVO>(`/ec/order/update/${id}`, data);
|
|
}
|
|
|
|
/**
|
|
* 删除订单
|
|
*/
|
|
export async function deleteOrderApi(id: number) {
|
|
return requestClient.delete<void>(`/ec/order/delete/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 获取订单详情
|
|
*/
|
|
export async function getOrderByIdApi(id: number) {
|
|
return requestClient.get<OrderVO.OrderInfoVO>(`/ec/order/detail/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 批量导入订单
|
|
*/
|
|
export async function batchImportOrdersApi(data: OrderDTO.BatchImportOrderDTO) {
|
|
return requestClient.post<BatchImportResultVO.BatchImportResultInfoVO>('/ec/order/batch-import', data);
|
|
}
|
|
|
|
/**
|
|
* 订单状态管理API
|
|
*/
|
|
|
|
/**
|
|
* 创建订单状态
|
|
*/
|
|
export async function createOrderStatusApi(data: OrderStatusDTO.CreateOrderStatusDTO) {
|
|
return requestClient.post<number>('/ec/order-status', data);
|
|
}
|
|
|
|
/**
|
|
* 更新订单状态
|
|
*/
|
|
export async function updateOrderStatusApi(data: OrderStatusDTO.UpdateOrderStatusDTO) {
|
|
return requestClient.put<void>('/ec/order-status', data);
|
|
}
|
|
|
|
/**
|
|
* 删除订单状态
|
|
*/
|
|
export async function deleteOrderStatusApi(id: number) {
|
|
return requestClient.delete<void>(`/ec/order-status/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 获取订单状态详情
|
|
*/
|
|
export async function getOrderStatusByIdApi(id: number) {
|
|
return requestClient.get<OrderStatusVO.OrderStatusInfoVO>(`/ec/order-status/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 获取启用的订单状态列表
|
|
*/
|
|
export async function getActiveOrderStatusListApi() {
|
|
return requestClient.get<OrderStatusVO.OrderStatusInfoVO[]>('/ec/order-status/active');
|
|
}
|
|
|
|
/**
|
|
* 获取所有订单状态列表
|
|
*/
|
|
export async function getAllOrderStatusListApi() {
|
|
return requestClient.get<OrderStatusVO.OrderStatusInfoVO[]>('/ec/order-status/all');
|
|
}
|
|
|
|
/**
|
|
* 推广费类型管理API
|
|
*/
|
|
|
|
/**
|
|
* 创建推广费类型
|
|
*/
|
|
export async function createPromotionFeeTypeApi(data: PromotionFeeTypeDTO.CreatePromotionFeeTypeDTO) {
|
|
return requestClient.post<number>('/ec/promotion-fee-type', data);
|
|
}
|
|
|
|
/**
|
|
* 更新推广费类型
|
|
*/
|
|
export async function updatePromotionFeeTypeApi(data: PromotionFeeTypeDTO.UpdatePromotionFeeTypeDTO) {
|
|
return requestClient.put<void>('/ec/promotion-fee-type', data);
|
|
}
|
|
|
|
/**
|
|
* 删除推广费类型
|
|
*/
|
|
export async function deletePromotionFeeTypeApi(id: number) {
|
|
return requestClient.delete<void>(`/ec/promotion-fee-type/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 获取推广费类型详情
|
|
*/
|
|
export async function getPromotionFeeTypeByIdApi(id: number) {
|
|
return requestClient.get<PromotionFeeTypeVO.PromotionFeeTypeInfoVO>(`/ec/promotion-fee-type/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 获取启用的推广费类型列表
|
|
*/
|
|
export async function getActivePromotionFeeTypeListApi() {
|
|
return requestClient.get<PromotionFeeTypeVO.PromotionFeeTypeInfoVO[]>('/ec/promotion-fee-type/active');
|
|
}
|
|
|
|
/**
|
|
* 获取所有推广费类型列表
|
|
*/
|
|
export async function getAllPromotionFeeTypeListApi() {
|
|
return requestClient.get<PromotionFeeTypeVO.PromotionFeeTypeInfoVO[]>('/ec/promotion-fee-type/all');
|
|
}
|
|
|