mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 14:29:19 +08:00
优化部分模块
This commit is contained in:
@@ -1,143 +0,0 @@
|
||||
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');
|
||||
}
|
||||
|
||||
@@ -2,5 +2,11 @@
|
||||
* 电商模块API导出
|
||||
*/
|
||||
|
||||
export * from './apis';
|
||||
export * from './types';
|
||||
// 订单相关API
|
||||
export * from './order.apis';
|
||||
|
||||
// 订单状态相关API
|
||||
export * from './order-status.apis';
|
||||
|
||||
// 推广费类型相关API
|
||||
export * from './promotion-fee-type.apis';
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { OrderStatusDTO, OrderStatusVO } from './types';
|
||||
|
||||
/**
|
||||
* 订单状态管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 创建订单状态
|
||||
*/
|
||||
export async function createOrderStatusApi(data: OrderStatusDTO.Create) {
|
||||
return requestClient.post<number>('/ec/order-status', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新订单状态
|
||||
*/
|
||||
export async function updateOrderStatusApi(data: OrderStatusDTO.Update) {
|
||||
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.Info>(`/ec/order-status/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取启用的订单状态列表
|
||||
*/
|
||||
export async function getActiveOrderStatusListApi() {
|
||||
return requestClient.get<OrderStatusVO.Info[]>('/ec/order-status/active');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有订单状态列表
|
||||
*/
|
||||
export async function getAllOrderStatusListApi() {
|
||||
return requestClient.get<OrderStatusVO.Info[]>('/ec/order-status/all');
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { OrderDTO, OrderVO, BatchImportResultVO } from './types';
|
||||
|
||||
/**
|
||||
* 订单管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取订单列表
|
||||
*/
|
||||
export async function getOrderPageApi(params: PageQueryDTO<OrderDTO.Filters>) {
|
||||
return requestClient.post<PageResultVO<OrderVO.Info>>('/ec/order/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
*/
|
||||
export async function createOrderApi(data: OrderDTO.Create) {
|
||||
return requestClient.post<OrderVO.Info>('/ec/order/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新订单
|
||||
*/
|
||||
export async function updateOrderApi(id: number, data: OrderDTO.Update) {
|
||||
return requestClient.put<OrderVO.Info>(`/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.Info>(`/ec/order/detail/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入订单
|
||||
*/
|
||||
export async function batchImportOrdersApi(data: OrderDTO.BatchImport) {
|
||||
return requestClient.post<BatchImportResultVO.Info>('/ec/order/batch-import', data);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PromotionFeeTypeDTO, PromotionFeeTypeVO } from './types';
|
||||
|
||||
/**
|
||||
* 推广费类型管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 创建推广费类型
|
||||
*/
|
||||
export async function createPromotionFeeTypeApi(data: PromotionFeeTypeDTO.Create) {
|
||||
return requestClient.post<number>('/ec/promotion-fee-type', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新推广费类型
|
||||
*/
|
||||
export async function updatePromotionFeeTypeApi(data: PromotionFeeTypeDTO.Update) {
|
||||
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.Info>(`/ec/promotion-fee-type/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取启用的推广费类型列表
|
||||
*/
|
||||
export async function getActivePromotionFeeTypeListApi() {
|
||||
return requestClient.get<PromotionFeeTypeVO.Info[]>('/ec/promotion-fee-type/active');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有推广费类型列表
|
||||
*/
|
||||
export async function getAllPromotionFeeTypeListApi() {
|
||||
return requestClient.get<PromotionFeeTypeVO.Info[]>('/ec/promotion-fee-type/all');
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 订单状态相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace OrderStatusDTO {
|
||||
/** 创建订单状态参数 */
|
||||
export interface Create {
|
||||
/** 状态名称 */
|
||||
statusName: string;
|
||||
/** 状态描述 */
|
||||
description?: string;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
|
||||
/** 更新订单状态参数 */
|
||||
export interface Update {
|
||||
/** 状态ID */
|
||||
id: number;
|
||||
/** 状态名称 */
|
||||
statusName: string;
|
||||
/** 状态描述 */
|
||||
description?: string;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* 订单相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace OrderDTO {
|
||||
/** 创建订单参数 */
|
||||
export interface Create {
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo?: string;
|
||||
/** 订单状态ID */
|
||||
statusId: number;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee?: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 商品名称(冗余存储) */
|
||||
productName: string;
|
||||
/** 规格名称(冗余存储) */
|
||||
specName?: string;
|
||||
/** 数量 */
|
||||
quantity: number;
|
||||
/** 销售单价 */
|
||||
unitPrice: number;
|
||||
/** 成本价(下单时快照) */
|
||||
costPrice: number;
|
||||
/** 成本小计 */
|
||||
costTotal: number;
|
||||
}
|
||||
|
||||
/** 更新订单参数 */
|
||||
export interface Update {
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo?: string;
|
||||
/** 订单状态ID */
|
||||
statusId?: number;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee?: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
/** 商品ID */
|
||||
productId?: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 商品名称(冗余存储) */
|
||||
productName?: string;
|
||||
/** 规格名称(冗余存储) */
|
||||
specName?: string;
|
||||
/** 数量 */
|
||||
quantity?: number;
|
||||
/** 销售单价 */
|
||||
unitPrice?: number;
|
||||
/** 成本价(下单时快照) */
|
||||
costPrice?: number;
|
||||
/** 成本小计 */
|
||||
costTotal?: number;
|
||||
}
|
||||
|
||||
/** 订单过滤条件 */
|
||||
export interface Filters {
|
||||
/** 店铺ID */
|
||||
shopId?: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 订单状态ID */
|
||||
orderStatusId?: number;
|
||||
/** 订单编号(模糊查询) */
|
||||
orderNumber?: string;
|
||||
/** 商品名称(模糊查询) */
|
||||
productName?: string;
|
||||
}
|
||||
|
||||
/** 批量导入订单参数 */
|
||||
export interface BatchImport {
|
||||
/** 订单列表 */
|
||||
orders: Create[];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 推广费类型相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace PromotionFeeTypeDTO {
|
||||
/** 创建推广费类型参数 */
|
||||
export interface Create {
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
/** 类型描述 */
|
||||
description?: string;
|
||||
/** 计算方式 1固定金额 2按比例 3按点击 4按展示 */
|
||||
calculationMethod?: number;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
|
||||
/** 更新推广费类型参数 */
|
||||
export interface Update {
|
||||
/** 推广费类型ID */
|
||||
id: number;
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
/** 类型描述 */
|
||||
description?: string;
|
||||
/** 计算方式 1固定金额 2按比例 3按点击 4按展示 */
|
||||
calculationMethod?: number;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,13 @@
|
||||
* 电商模块类型定义导出
|
||||
*/
|
||||
|
||||
export * from './types.dto';
|
||||
export * from './types.vo';
|
||||
// DTO类型导出
|
||||
export * from './dto.order';
|
||||
export * from './dto.order-status';
|
||||
export * from './dto.promotion-fee-type';
|
||||
|
||||
// VO类型导出
|
||||
export * from './vo.order';
|
||||
export * from './vo.order-status';
|
||||
export * from './vo.promotion-fee-type';
|
||||
export * from './vo.batch-import-result';
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
/**
|
||||
* 电商模块DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace OrderDTO {
|
||||
/** 创建订单参数 */
|
||||
export interface CreateOrderDTO {
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo?: string;
|
||||
/** 订单状态ID */
|
||||
statusId: number;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee?: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId: number;
|
||||
/** 数量 */
|
||||
quantity: number;
|
||||
}
|
||||
|
||||
/** 更新订单参数 */
|
||||
export interface UpdateOrderDTO {
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo?: string;
|
||||
/** 订单状态ID */
|
||||
statusId?: number;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee?: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
}
|
||||
|
||||
/** 订单过滤条件 */
|
||||
export interface OrderFilterDTO {
|
||||
/** 店铺ID */
|
||||
shopId?: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 订单状态ID */
|
||||
orderStatusId?: number;
|
||||
/** 订单编号(模糊查询) */
|
||||
orderNumber?: string;
|
||||
/** 商品名称(模糊查询) */
|
||||
productName?: string;
|
||||
}
|
||||
|
||||
/** 批量导入订单参数 */
|
||||
export interface BatchImportOrderDTO {
|
||||
/** 订单列表 */
|
||||
orders: CreateOrderDTO[];
|
||||
}
|
||||
}
|
||||
|
||||
export namespace OrderStatusDTO {
|
||||
/** 创建订单状态参数 */
|
||||
export interface CreateOrderStatusDTO {
|
||||
/** 状态码 */
|
||||
statusCode: number;
|
||||
/** 状态名称 */
|
||||
statusName: string;
|
||||
/** 状态描述 */
|
||||
description?: string;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
|
||||
/** 更新订单状态参数 */
|
||||
export interface UpdateOrderStatusDTO {
|
||||
/** 状态ID */
|
||||
id: number;
|
||||
/** 状态码 */
|
||||
statusCode: number;
|
||||
/** 状态名称 */
|
||||
statusName: string;
|
||||
/** 状态描述 */
|
||||
description?: string;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace PromotionFeeTypeDTO {
|
||||
/** 创建推广费类型参数 */
|
||||
export interface CreatePromotionFeeTypeDTO {
|
||||
/** 类型编码 */
|
||||
typeCode: string;
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
/** 类型描述 */
|
||||
description?: string;
|
||||
/** 计算方式 1固定金额 2按比例 3按点击 4按展示 */
|
||||
calculationMethod?: number;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
|
||||
/** 更新推广费类型参数 */
|
||||
export interface UpdatePromotionFeeTypeDTO {
|
||||
/** 推广费类型ID */
|
||||
id: number;
|
||||
/** 类型编码 */
|
||||
typeCode: string;
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
/** 类型描述 */
|
||||
description?: string;
|
||||
/** 计算方式 1固定金额 2按比例 3按点击 4按展示 */
|
||||
calculationMethod?: number;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
}
|
||||
}
|
||||
@@ -1,147 +0,0 @@
|
||||
/**
|
||||
* 电商模块VO类型定义
|
||||
*/
|
||||
|
||||
export namespace OrderVO {
|
||||
/** 订单信息 */
|
||||
export interface OrderInfoVO {
|
||||
/** 订单ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 店铺名称 */
|
||||
shopName: string;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo: string;
|
||||
/** 订单状态ID */
|
||||
statusId: number;
|
||||
/** 订单状态名称 */
|
||||
statusName: string;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
/** 订单明细 */
|
||||
orderItem?: OrderItemVO.OrderItemInfoVO;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace OrderItemVO {
|
||||
/** 订单明细信息 */
|
||||
export interface OrderItemInfoVO {
|
||||
/** 订单明细ID */
|
||||
id: number;
|
||||
/** 订单ID */
|
||||
orderId: number;
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId: number;
|
||||
/** 商品名称 */
|
||||
productName: string;
|
||||
/** 规格名称 */
|
||||
specName: string;
|
||||
/** 商品主图 */
|
||||
productImage?: string;
|
||||
/** 数量 */
|
||||
quantity: number;
|
||||
/** 销售单价 */
|
||||
unitPrice: number;
|
||||
/** 成本价 */
|
||||
costPrice: number;
|
||||
/** 小计金额 */
|
||||
subtotal: number;
|
||||
/** 成本小计 */
|
||||
costTotal: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace BatchImportResultVO {
|
||||
/** 批量导入结果 */
|
||||
export interface BatchImportResultInfoVO {
|
||||
/** 总数量 */
|
||||
totalCount: number;
|
||||
/** 成功数量 */
|
||||
successCount: number;
|
||||
/** 失败数量 */
|
||||
failureCount: number;
|
||||
/** 失败详情 */
|
||||
failureDetails: string[];
|
||||
}
|
||||
}
|
||||
|
||||
export namespace OrderStatusVO {
|
||||
/** 订单状态信息 */
|
||||
export interface OrderStatusInfoVO {
|
||||
/** 状态ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 状态码 */
|
||||
statusCode: number;
|
||||
/** 状态名称 */
|
||||
statusName: string;
|
||||
/** 状态描述 */
|
||||
description?: string;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace PromotionFeeTypeVO {
|
||||
/** 推广费类型信息 */
|
||||
export interface PromotionFeeTypeInfoVO {
|
||||
/** 推广费类型ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 类型编码 */
|
||||
typeCode: string;
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
/** 类型描述 */
|
||||
description?: string;
|
||||
/** 计算方式 1固定金额 2按比例 3按点击 4按展示 */
|
||||
calculationMethod?: number;
|
||||
/** 计算方式描述 */
|
||||
calculationMethodDesc?: string;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 批量导入结果相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace BatchImportResultVO {
|
||||
/** 批量导入结果 */
|
||||
export interface Info {
|
||||
/** 总数量 */
|
||||
totalCount: number;
|
||||
/** 成功数量 */
|
||||
successCount: number;
|
||||
/** 失败数量 */
|
||||
failureCount: number;
|
||||
/** 失败详情 */
|
||||
failureDetails: string[];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 订单状态相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace OrderStatusVO {
|
||||
/** 订单状态信息 */
|
||||
export interface Info {
|
||||
/** 状态ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 状态码 */
|
||||
statusCode: number;
|
||||
/** 状态名称 */
|
||||
statusName: string;
|
||||
/** 状态描述 */
|
||||
description?: string;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* 订单相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace OrderVO {
|
||||
/** 订单信息 */
|
||||
export interface Info {
|
||||
/** 订单ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 店铺名称 */
|
||||
shopName: string;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo: string;
|
||||
/** 订单状态ID */
|
||||
statusId: number;
|
||||
/** 订单状态名称 */
|
||||
statusName: string;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 商品名称(冗余存储) */
|
||||
productName: string;
|
||||
/** 规格名称(冗余存储) */
|
||||
specName?: string;
|
||||
/** 数量 */
|
||||
quantity: number;
|
||||
/** 销售单价 */
|
||||
unitPrice: number;
|
||||
/** 成本价(下单时快照) */
|
||||
costPrice: number;
|
||||
/** 成本小计 */
|
||||
costTotal: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 推广费类型相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace PromotionFeeTypeVO {
|
||||
/** 推广费类型信息 */
|
||||
export interface Info {
|
||||
/** 推广费类型ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 类型编码 */
|
||||
typeCode: string;
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
/** 类型描述 */
|
||||
description?: string;
|
||||
/** 计算方式 1固定金额 2按比例 3按点击 4按展示 */
|
||||
calculationMethod?: number;
|
||||
/** 计算方式描述 */
|
||||
calculationMethodDesc?: string;
|
||||
/** 排序 */
|
||||
sortOrder?: number;
|
||||
/** 是否启用 0禁用 1启用 */
|
||||
isActive?: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { MediaFileDTO, MediaFileVO, MediaImageDTO, MediaImageVO } from './types';
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
|
||||
/**
|
||||
* 文件管理相关API
|
||||
*/
|
||||
|
||||
// 文件上传
|
||||
export async function uploadFileApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<MediaFileVO.MediaFileInfoVO>('/media/file/upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 批量文件上传
|
||||
export async function batchUploadFilesApi(files: File[]) {
|
||||
const formData = new FormData();
|
||||
files.forEach(file => {
|
||||
formData.append('files', file);
|
||||
});
|
||||
return requestClient.post<MediaFileVO.MediaFileInfoVO[]>('/media/file/batch-upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 更新文件信息
|
||||
export async function updateFileApi(data: MediaFileDTO.UpdateFileDTO) {
|
||||
return requestClient.put<MediaFileVO.MediaFileInfoVO>('/media/file/update', data);
|
||||
}
|
||||
|
||||
// 删除文件
|
||||
export async function deleteFileApi(id: number) {
|
||||
return requestClient.delete(`/media/file/delete/${id}`);
|
||||
}
|
||||
|
||||
// 根据哈希查询文件
|
||||
export async function getFileByHashApi(fileHash: string) {
|
||||
return requestClient.get<MediaFileVO.MediaFileInfoVO>(`/media/file/hash/${fileHash}`);
|
||||
}
|
||||
|
||||
// 批量根据哈希查询文件
|
||||
export async function getFilesByHashesApi(fileHashes: string[]) {
|
||||
return requestClient.post<MediaFileVO.MediaFileInfoVO[]>('/media/file/batch-hash', fileHashes);
|
||||
}
|
||||
|
||||
// 分页获取文件列表
|
||||
export async function getFilePageApi(params: PageQueryDTO<MediaFileDTO.MediaFileFilterDTO>) {
|
||||
return requestClient.post<PageResultVO<MediaFileVO.MediaFileInfoVO>>('/media/file/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片管理相关API
|
||||
*/
|
||||
|
||||
// 图片上传
|
||||
export async function uploadImageApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<MediaImageVO.MediaImageInfoVO>('/media/image/upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 批量图片上传
|
||||
export async function batchUploadImagesApi(files: File[]) {
|
||||
const formData = new FormData();
|
||||
files.forEach(file => {
|
||||
formData.append('files', file);
|
||||
});
|
||||
return requestClient.post<MediaImageVO.MediaImageInfoVO[]>('/media/image/batch-upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 更新图片信息
|
||||
export async function updateImageApi(data: MediaImageDTO.UpdateImageDTO) {
|
||||
return requestClient.put<MediaImageVO.MediaImageInfoVO>('/media/image/update', data);
|
||||
}
|
||||
|
||||
// 删除图片
|
||||
export async function deleteImageApi(id: number) {
|
||||
return requestClient.delete(`/media/image/delete/${id}`);
|
||||
}
|
||||
|
||||
// 根据哈希查询图片
|
||||
export async function getImageByHashApi(fileHash: string) {
|
||||
return requestClient.get<MediaImageVO.MediaImageInfoVO>(`/media/image/hash/${fileHash}`);
|
||||
}
|
||||
|
||||
// 批量根据哈希查询图片
|
||||
export async function getImagesByHashesApi(fileHashes: string[]) {
|
||||
return requestClient.post<MediaImageVO.MediaImageInfoVO[]>('/media/image/batch-hash', fileHashes);
|
||||
}
|
||||
|
||||
// 分页获取图片列表
|
||||
export async function getImagePageApi(params: PageQueryDTO<MediaImageDTO.MediaImageFilterDTO>) {
|
||||
return requestClient.post<PageResultVO<MediaImageVO.MediaImageInfoVO>>('/media/image/page', params);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { FileDTO, FileVO } from './types';
|
||||
|
||||
/**
|
||||
* 文件管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取文件列表
|
||||
*/
|
||||
export async function getFilePageApi(params: PageQueryDTO<FileDTO.Filters>) {
|
||||
return requestClient.post<PageResultVO<FileVO.Info>>('/media/file/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
export async function uploadFileApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<FileVO.Info>('/media/file/upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量上传文件
|
||||
*/
|
||||
export async function batchUploadFilesApi(files: File[]) {
|
||||
const formData = new FormData();
|
||||
files.forEach(file => {
|
||||
formData.append('files', file);
|
||||
});
|
||||
return requestClient.post<FileVO.Info[]>('/media/file/batch-upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新文件信息
|
||||
*/
|
||||
export async function updateFileApi(id: number, data: FileDTO.Update) {
|
||||
return requestClient.put<FileVO.Info>(`/media/file/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
export async function deleteFileApi(id: number) {
|
||||
return requestClient.delete<void>(`/media/file/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件详情
|
||||
*/
|
||||
export async function getFileByIdApi(id: number) {
|
||||
return requestClient.get<FileVO.Info>(`/media/file/detail/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文件
|
||||
*/
|
||||
export async function batchDeleteFilesApi(ids: number[]) {
|
||||
return requestClient.delete<void>('/media/file/batch-delete', { data: { ids } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件
|
||||
*/
|
||||
export async function downloadFileApi(id: number) {
|
||||
return requestClient.get(`/media/file/download/${id}`, {
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { ImageDTO, ImageVO } from './types';
|
||||
|
||||
/**
|
||||
* 图片管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取图片列表
|
||||
*/
|
||||
export async function getImagePageApi(params: PageQueryDTO<ImageDTO.Filters>) {
|
||||
return requestClient.post<PageResultVO<ImageVO.Info>>('/media/image/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
*/
|
||||
export async function uploadImageApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<ImageVO.Info>('/media/image/upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量上传图片
|
||||
*/
|
||||
export async function batchUploadImagesApi(files: File[]) {
|
||||
const formData = new FormData();
|
||||
files.forEach(file => {
|
||||
formData.append('files', file);
|
||||
});
|
||||
return requestClient.post<ImageVO.Info[]>('/media/image/batch-upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新图片信息
|
||||
*/
|
||||
export async function updateImageApi(id: number, data: ImageDTO.Update) {
|
||||
return requestClient.put<ImageVO.Info>(`/media/image/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片
|
||||
*/
|
||||
export async function deleteImageApi(id: number) {
|
||||
return requestClient.delete<void>(`/media/image/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图片详情
|
||||
*/
|
||||
export async function getImageByIdApi(id: number) {
|
||||
return requestClient.get<ImageVO.Info>(`/media/image/detail/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除图片
|
||||
*/
|
||||
export async function batchDeleteImagesApi(ids: number[]) {
|
||||
return requestClient.delete<void>('/media/image/batch-delete', { data: { ids } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图片缩略图
|
||||
*/
|
||||
export async function getImageThumbnailApi(id: number, width?: number, height?: number) {
|
||||
const params = new URLSearchParams();
|
||||
if (width) params.append('width', width.toString());
|
||||
if (height) params.append('height', height.toString());
|
||||
|
||||
return requestClient.get(`/media/image/thumbnail/${id}?${params.toString()}`, {
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -1,2 +1,12 @@
|
||||
export * from './apis';
|
||||
export * from './types';
|
||||
/**
|
||||
* 媒体管理模块API导出
|
||||
*/
|
||||
|
||||
// 文件相关API
|
||||
export * from './file.apis';
|
||||
|
||||
// 图片相关API
|
||||
export * from './image.apis';
|
||||
|
||||
// 类型定义
|
||||
export * from './types';
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* 媒体文件相关类型定义
|
||||
*/
|
||||
|
||||
export namespace MediaFileVO {
|
||||
export interface MediaFileInfoVO {
|
||||
id: number;
|
||||
companyId: number;
|
||||
url: string;
|
||||
filename: string;
|
||||
fileType: string;
|
||||
fileHash: string;
|
||||
tags: string;
|
||||
remark: string;
|
||||
uploadBy: number;
|
||||
uploadTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace MediaImageVO {
|
||||
export interface MediaImageInfoVO {
|
||||
id: number;
|
||||
companyId: number;
|
||||
url: string;
|
||||
filename: string;
|
||||
type: string;
|
||||
fileHash: string;
|
||||
tags: string;
|
||||
remark: string;
|
||||
uploadBy: number;
|
||||
uploadTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace MediaFileDTO {
|
||||
export interface UpdateFileDTO {
|
||||
id: number;
|
||||
fileType?: string;
|
||||
tags?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface MediaFileFilterDTO {
|
||||
filename?: string;
|
||||
fileType?: string;
|
||||
tags?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace MediaImageDTO {
|
||||
export interface UpdateImageDTO {
|
||||
id: number;
|
||||
type?: string;
|
||||
tags?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface MediaImageFilterDTO {
|
||||
filename?: string;
|
||||
type?: string;
|
||||
tags?: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* 文件管理相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace FileDTO {
|
||||
/** 文件查询过滤条件 */
|
||||
export interface Filters {
|
||||
/** 文件名 */
|
||||
filename?: string;
|
||||
/** 文件格式 */
|
||||
fileFormat?: string;
|
||||
/** 标签 */
|
||||
tags?: string;
|
||||
/** 上传人ID */
|
||||
uploadBy?: number;
|
||||
/** 上传时间范围-开始 */
|
||||
uploadTimeStart?: string;
|
||||
/** 上传时间范围-结束 */
|
||||
uploadTimeEnd?: string;
|
||||
}
|
||||
|
||||
/** 更新文件 */
|
||||
export interface Update {
|
||||
tags?: string;
|
||||
/** 文件描述 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 批量上传文件 */
|
||||
export interface BatchUpload {
|
||||
/** 文件列表 */
|
||||
files: File[];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 图片管理相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace ImageDTO {
|
||||
/** 图片查询过滤条件 */
|
||||
export interface Filters {
|
||||
/** 文件名 */
|
||||
filename?: string;
|
||||
/** 图片分类 (image,avatar,logo) */
|
||||
category?: string;
|
||||
/** 图片格式 */
|
||||
imageFormat?: string;
|
||||
/** 标签 */
|
||||
tags?: string;
|
||||
/** 上传人ID */
|
||||
uploadBy?: number;
|
||||
/** 上传时间范围-开始 */
|
||||
uploadTimeStart?: string;
|
||||
/** 上传时间范围-结束 */
|
||||
uploadTimeEnd?: string;
|
||||
}
|
||||
|
||||
/** 更新图片 */
|
||||
export interface Update {
|
||||
tags?: string;
|
||||
/** 图片说明 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 批量上传图片 */
|
||||
export interface BatchUpload {
|
||||
/** 图片文件列表 */
|
||||
files: File[];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* 媒体管理模块类型定义导出
|
||||
*/
|
||||
|
||||
// DTO类型导出
|
||||
export * from './dto.file';
|
||||
export * from './dto.image';
|
||||
|
||||
// VO类型导出
|
||||
export * from './vo.file';
|
||||
export * from './vo.image';
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* 文件管理相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace FileVO {
|
||||
/** 文件信息 */
|
||||
export interface Info {
|
||||
/** 文件ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 文件URL */
|
||||
url: string;
|
||||
/** 文件名 */
|
||||
filename: string;
|
||||
/** 文件格式,如 pdf/cad/xlsx/doc */
|
||||
fileFormat?: string;
|
||||
/** 文件哈希值,用于去重 */
|
||||
fileHash?: string;
|
||||
/** 标签,逗号分隔 */
|
||||
tags?: string;
|
||||
/** 文件描述 */
|
||||
remark?: string;
|
||||
/** 上传人ID */
|
||||
uploadBy?: number;
|
||||
/** 上传时间 */
|
||||
uploadTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
/** 删除时间 */
|
||||
deleteTime?: string;
|
||||
/** 删除人ID */
|
||||
deleteBy?: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* 图片管理相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace ImageVO {
|
||||
/** 图片信息 */
|
||||
export interface Info {
|
||||
/** 图片ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 图片URL */
|
||||
url: string;
|
||||
/** 原始文件名 */
|
||||
filename?: string;
|
||||
/** 图片分类 (image,avatar,logo) */
|
||||
category?: string;
|
||||
/** 图片格式,如 jpg/png/gif/webp */
|
||||
imageFormat?: string;
|
||||
/** 文件哈希值,用于去重 */
|
||||
fileHash?: string;
|
||||
/** 标签,逗号分隔 */
|
||||
tags?: string;
|
||||
/** 图片说明 */
|
||||
remark?: string;
|
||||
/** 上传人ID */
|
||||
uploadBy?: number;
|
||||
/** 上传时间 */
|
||||
uploadTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
/** 删除时间 */
|
||||
deleteTime?: string;
|
||||
/** 删除人ID */
|
||||
deleteBy?: number;
|
||||
}
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { ShopDTO, ShopVO, ProductDTO, ProductVO } from './types';
|
||||
|
||||
/**
|
||||
* 店铺管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取店铺列表
|
||||
*/
|
||||
export async function getShopPageApi(params: PageQueryDTO<ShopDTO.ShopFiltersDTO>) {
|
||||
return requestClient.post<PageResultVO<ShopVO.ShopInfoVO>>('/ec/shop/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建店铺
|
||||
*/
|
||||
export async function createShopApi(data: ShopDTO.CreateShopDTO) {
|
||||
return requestClient.post<ShopVO.ShopInfoVO>('/ec/shop/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新店铺
|
||||
*/
|
||||
export async function updateShopApi(id: number, data: ShopDTO.UpdateShopDTO) {
|
||||
return requestClient.put<ShopVO.ShopInfoVO>(`/ec/shop/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店铺
|
||||
*/
|
||||
export async function deleteShopApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/shop/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传店铺Logo
|
||||
*/
|
||||
export async function uploadShopLogoApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<ShopVO.ShopInfoVO>('/ec/shop/upload-logo', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取商品列表
|
||||
*/
|
||||
export async function getProductPageApi(params: PageQueryDTO<ProductDTO.ProductFiltersDTO>) {
|
||||
return requestClient.post<PageResultVO<ProductVO.ProductInfoVO>>('/ec/product/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品
|
||||
*/
|
||||
export async function createProductApi(data: ProductDTO.CreateProductDTO) {
|
||||
return requestClient.post<ProductVO.ProductInfoVO>('/ec/product/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新商品
|
||||
*/
|
||||
export async function updateProductApi(id: number, data: ProductDTO.UpdateProductDTO) {
|
||||
return requestClient.put<ProductVO.ProductInfoVO>(`/ec/product/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function deleteProductApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/product/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 一键创建商品和规格
|
||||
*/
|
||||
export async function createProductWithSpecsApi(data: ProductDTO.CreateProductWithSpecsDTO) {
|
||||
return requestClient.post<ProductVO.ProductInfoVO>('/ec/product/create-with-specs', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取商品规格列表
|
||||
*/
|
||||
export async function getProductSpecPageApi(params: PageQueryDTO<ProductDTO.ProductSpecFilterDTO>) {
|
||||
return requestClient.post<PageResultVO<ProductVO.ProductSpecInfoVO>>('/ec/product-spec/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品规格
|
||||
*/
|
||||
export async function createProductSpecApi(data: ProductDTO.CreateProductSpecDTO) {
|
||||
return requestClient.post<ProductVO.ProductSpecInfoVO>('/ec/product-spec/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新商品规格
|
||||
*/
|
||||
export async function updateProductSpecApi(id: number, data: ProductDTO.UpdateProductSpecDTO) {
|
||||
return requestClient.put<ProductVO.ProductSpecInfoVO>(`/ec/product-spec/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格
|
||||
*/
|
||||
export async function deleteProductSpecApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/product-spec/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 精准查询API - 用于数据导入
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据名称精准查询店铺
|
||||
*/
|
||||
export async function getShopByNameApi(name: string) {
|
||||
return requestClient.get<ShopVO.ShopInfoVO>(`/ec/shop/find-by-name/${encodeURIComponent(name)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据名称查询店铺
|
||||
*/
|
||||
export async function getShopsByNamesApi(names: string[]) {
|
||||
return requestClient.post<ShopVO.ShopInfoVO[]>('/ec/shop/find-by-names', names);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称精准查询商品
|
||||
*/
|
||||
export async function getProductByNameApi(name: string) {
|
||||
return requestClient.get<ProductVO.ProductInfoVO>(`/ec/product/find-by-name/${encodeURIComponent(name)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据名称查询商品
|
||||
*/
|
||||
export async function getProductsByNamesApi(names: string[]) {
|
||||
return requestClient.post<ProductVO.ProductInfoVO[]>('/ec/product/find-by-names', names);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品名称和规格编码精准查询商品规格
|
||||
*/
|
||||
export async function getProductSpecByProductAndSpecApi(productName: string, specCode: string) {
|
||||
return requestClient.get<ProductVO.ProductSpecInfoVO>(`/ec/product-spec/find-by-product-and-spec/${encodeURIComponent(productName)}/${encodeURIComponent(specCode)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据商品名称和规格编码查询商品规格
|
||||
*/
|
||||
export async function getProductSpecsByProductAndSpecsApi(queries: { productName: string; specCode: string }[]) {
|
||||
return requestClient.post<ProductVO.ProductInfoVO[]>('/ec/product-spec/find-by-product-and-specs', queries);
|
||||
}
|
||||
@@ -2,5 +2,8 @@
|
||||
* 店铺管理模块API导出
|
||||
*/
|
||||
|
||||
export * from './apis';
|
||||
export * from './types';
|
||||
// 店铺相关API
|
||||
export * from './shop.apis';
|
||||
|
||||
// 商品相关API
|
||||
export * from './product.apis';
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { ProductDTO, ProductVO } from './types';
|
||||
|
||||
/**
|
||||
* 商品管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取商品列表
|
||||
*/
|
||||
export async function getProductPageApi(params: PageQueryDTO<ProductDTO.Filters>) {
|
||||
return requestClient.post<PageResultVO<ProductVO.Info>>('/ec/product/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品
|
||||
*/
|
||||
export async function createProductApi(data: ProductDTO.Create) {
|
||||
return requestClient.post<ProductVO.Info>('/ec/product/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新商品
|
||||
*/
|
||||
export async function updateProductApi(id: number, data: ProductDTO.Update) {
|
||||
return requestClient.put<ProductVO.Info>(`/ec/product/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function deleteProductApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/product/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 一键创建商品和规格
|
||||
*/
|
||||
export async function createProductWithSpecsApi(data: ProductDTO.CreateWithSpecs) {
|
||||
return requestClient.post<ProductVO.Info>('/ec/product/create-with-specs', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取商品规格列表
|
||||
*/
|
||||
export async function getProductSpecPageApi(params: PageQueryDTO<ProductDTO.SpecFilters>) {
|
||||
return requestClient.post<PageResultVO<ProductVO.SpecInfo>>('/ec/product-spec/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品规格
|
||||
*/
|
||||
export async function createProductSpecApi(data: ProductDTO.CreateSpec) {
|
||||
return requestClient.post<ProductVO.SpecInfo>('/ec/product-spec/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新商品规格
|
||||
*/
|
||||
export async function updateProductSpecApi(id: number, data: ProductDTO.UpdateSpec) {
|
||||
return requestClient.put<ProductVO.SpecInfo>(`/ec/product-spec/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格
|
||||
*/
|
||||
export async function deleteProductSpecApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/product-spec/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 精准查询API - 用于数据导入
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据名称精准查询商品
|
||||
*/
|
||||
export async function getProductByNameApi(name: string) {
|
||||
return requestClient.get<ProductVO.Info>(`/ec/product/find-by-name/${encodeURIComponent(name)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据名称查询商品
|
||||
*/
|
||||
export async function getProductsByNamesApi(names: string[]) {
|
||||
return requestClient.post<ProductVO.Info[]>('/ec/product/find-by-names', names);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品名称和规格编码精准查询商品规格
|
||||
*/
|
||||
export async function getProductSpecByProductAndSpecApi(productName: string, specCode: string) {
|
||||
return requestClient.get<ProductVO.SpecInfo>(`/ec/product-spec/find-by-product-and-spec/${encodeURIComponent(productName)}/${encodeURIComponent(specCode)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据商品名称和规格编码查询商品规格
|
||||
*/
|
||||
export async function getProductSpecsByProductAndSpecsApi(queries: { productName: string; specCode: string }[]) {
|
||||
return requestClient.post<ProductVO.Info[]>('/ec/product-spec/find-by-product-and-specs', queries);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { ShopDTO, ShopVO } from './types';
|
||||
|
||||
/**
|
||||
* 店铺管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取店铺列表
|
||||
*/
|
||||
export async function getShopPageApi(params: PageQueryDTO<ShopDTO.Filters>) {
|
||||
return requestClient.post<PageResultVO<ShopVO.Info>>('/ec/shop/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建店铺
|
||||
*/
|
||||
export async function createShopApi(data: ShopDTO.Create) {
|
||||
return requestClient.post<ShopVO.Info>('/ec/shop/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新店铺
|
||||
*/
|
||||
export async function updateShopApi(id: number, data: ShopDTO.Update) {
|
||||
return requestClient.put<ShopVO.Info>(`/ec/shop/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店铺
|
||||
*/
|
||||
export async function deleteShopApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/shop/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传店铺Logo
|
||||
*/
|
||||
export async function uploadShopLogoApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<ShopVO.Info>('/ec/shop/upload-logo', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 精准查询API - 用于数据导入
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据名称精准查询店铺
|
||||
*/
|
||||
export async function getShopByNameApi(name: string) {
|
||||
return requestClient.get<ShopVO.Info>(`/ec/shop/find-by-name/${encodeURIComponent(name)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据名称查询店铺
|
||||
*/
|
||||
export async function getShopsByNamesApi(names: string[]) {
|
||||
return requestClient.post<ShopVO.Info[]>('/ec/shop/find-by-names', names);
|
||||
}
|
||||
+10
-40
@@ -1,40 +1,10 @@
|
||||
/**
|
||||
* 店铺管理模块DTO类型定义
|
||||
* 商品相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace ShopDTO {
|
||||
/** 创建店铺参数 */
|
||||
export interface CreateShopDTO {
|
||||
/** 店铺名称 */
|
||||
name: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
}
|
||||
|
||||
/** 更新店铺参数 */
|
||||
export interface UpdateShopDTO {
|
||||
/** 店铺名称 */
|
||||
name: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
}
|
||||
|
||||
/** 店铺过滤条件 */
|
||||
export interface ShopFiltersDTO {
|
||||
/** 店铺名称(模糊查询) */
|
||||
name?: string;
|
||||
/** 平台 */
|
||||
platform?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace ProductDTO {
|
||||
/** 创建商品参数 */
|
||||
export interface CreateProductDTO {
|
||||
export interface Create {
|
||||
/** 商品名称 */
|
||||
name: string;
|
||||
/** 主图图片ID */
|
||||
@@ -42,7 +12,7 @@ export namespace ProductDTO {
|
||||
}
|
||||
|
||||
/** 更新商品参数 */
|
||||
export interface UpdateProductDTO {
|
||||
export interface Update {
|
||||
/** 商品名称 */
|
||||
name: string;
|
||||
/** 商品编码 */
|
||||
@@ -56,17 +26,17 @@ export namespace ProductDTO {
|
||||
}
|
||||
|
||||
/** 一键创建商品和规格参数 */
|
||||
export interface CreateProductWithSpecsDTO {
|
||||
export interface CreateWithSpecs {
|
||||
/** 商品名称 */
|
||||
name: string;
|
||||
/** 主图图片ID */
|
||||
mainImageId?: number;
|
||||
/** 商品规格列表 */
|
||||
specs: ProductSpecDTO[];
|
||||
specs: Spec[];
|
||||
}
|
||||
|
||||
/** 商品规格DTO */
|
||||
export interface ProductSpecDTO {
|
||||
export interface Spec {
|
||||
/** 规格名称 */
|
||||
name: string;
|
||||
/** 规格编码 */
|
||||
@@ -76,7 +46,7 @@ export namespace ProductDTO {
|
||||
}
|
||||
|
||||
/** 创建商品规格参数 */
|
||||
export interface CreateProductSpecDTO {
|
||||
export interface CreateSpec {
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 规格名称 */
|
||||
@@ -88,7 +58,7 @@ export namespace ProductDTO {
|
||||
}
|
||||
|
||||
/** 更新商品规格参数 */
|
||||
export interface UpdateProductSpecDTO {
|
||||
export interface UpdateSpec {
|
||||
/** 规格名称 */
|
||||
name: string;
|
||||
/** 规格编码 */
|
||||
@@ -98,7 +68,7 @@ export namespace ProductDTO {
|
||||
}
|
||||
|
||||
/** 商品过滤条件 */
|
||||
export interface ProductFiltersDTO {
|
||||
export interface Filters {
|
||||
/** 商品名称(模糊查询) */
|
||||
name?: string;
|
||||
/** 商品编码(模糊查询) */
|
||||
@@ -112,7 +82,7 @@ export namespace ProductDTO {
|
||||
}
|
||||
|
||||
/** 商品规格过滤条件 */
|
||||
export interface ProductSpecFilterDTO {
|
||||
export interface SpecFilters {
|
||||
/** 商品ID */
|
||||
productId?: number;
|
||||
/** 商品名称(模糊查询) */
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 店铺相关DTO类型定义
|
||||
*/
|
||||
|
||||
export namespace ShopDTO {
|
||||
/** 创建店铺参数 */
|
||||
export interface Create {
|
||||
/** 店铺名称 */
|
||||
name: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
}
|
||||
|
||||
/** 更新店铺参数 */
|
||||
export interface Update {
|
||||
/** 店铺名称 */
|
||||
name: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
}
|
||||
|
||||
/** 店铺过滤条件 */
|
||||
export interface Filters {
|
||||
/** 店铺名称(模糊查询) */
|
||||
name?: string;
|
||||
/** 平台 */
|
||||
platform?: string;
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,10 @@
|
||||
* 店铺管理模块类型定义导出
|
||||
*/
|
||||
|
||||
export * from './types.dto';
|
||||
export * from './types.vo';
|
||||
// DTO类型导出
|
||||
export * from './dto.shop';
|
||||
export * from './dto.product';
|
||||
|
||||
// VO类型导出
|
||||
export * from './vo.shop';
|
||||
export * from './vo.product';
|
||||
|
||||
+7
-29
@@ -1,42 +1,20 @@
|
||||
/**
|
||||
* 店铺管理模块VO类型定义
|
||||
* 商品相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace ShopVO {
|
||||
/** 店铺信息 */
|
||||
export interface ShopInfoVO {
|
||||
/** 店铺ID */
|
||||
id: number;
|
||||
/** 所属公司ID */
|
||||
companyId: number;
|
||||
/** 店铺名称 */
|
||||
name: string;
|
||||
/** logo URL */
|
||||
logo?: string;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace ProductVO {
|
||||
/** 商品信息 */
|
||||
export interface ProductInfoVO {
|
||||
export interface Info {
|
||||
/** 商品ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 商品名称 */
|
||||
name: string;
|
||||
/** 主图URL */
|
||||
/** 主图URL(冗余字段) */
|
||||
mainImage?: string;
|
||||
/** 主图图片ID */
|
||||
mainImageId?: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
@@ -46,11 +24,11 @@ export namespace ProductVO {
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
/** 商品规格列表 */
|
||||
specs?: ProductSpecInfoVO[];
|
||||
specs?: SpecInfo[];
|
||||
}
|
||||
|
||||
/** 商品规格信息 */
|
||||
export interface ProductSpecInfoVO {
|
||||
export interface SpecInfo {
|
||||
/** 规格ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 店铺相关VO类型定义
|
||||
*/
|
||||
|
||||
export namespace ShopVO {
|
||||
/** 店铺信息 */
|
||||
export interface Info {
|
||||
/** 店铺ID */
|
||||
id: number;
|
||||
/** 所属公司ID */
|
||||
companyId: number;
|
||||
/** 店铺名称 */
|
||||
name: string;
|
||||
/** logo URL(冗余字段) */
|
||||
logo?: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user