feat: 忘了干啥了

This commit is contained in:
ah--desktop
2026-03-09 20:40:13 +08:00
parent 79109202d3
commit 60d34e2a47
37 changed files with 751 additions and 2673 deletions
@@ -27,17 +27,23 @@ export namespace ProductDTO {
specs?: UpdateSpec[];
}
/** 商品规格DTO */
/** 商品规格DTO(创建时) */
export interface Spec {
/** 规格名称 */
name: string;
/** 规格编码 */
specCode?: string;
/** 成本价 */
costPrice: number;
/** 商品成本 */
productCost: number;
/** 运费成本 */
shippingCost?: number;
/** 其他成本 */
otherCost?: number;
/** 备注 */
remark?: string;
}
/** 创建商品规格参数 */
/** 创建商品规格参数(独立接口用) */
export interface CreateSpec {
/** 商品ID */
productId: number;
@@ -45,8 +51,14 @@ export namespace ProductDTO {
name: string;
/** 规格编码 */
specCode?: string;
/** 成本价 */
costPrice: number;
/** 商品成本 */
productCost: number;
/** 运费成本 */
shippingCost?: number;
/** 其他成本 */
otherCost?: number;
/** 备注 */
remark?: string;
}
/** 更新商品规格参数 */
@@ -57,8 +69,14 @@ export namespace ProductDTO {
name: string;
/** 规格编码 */
specCode?: string;
/** 成本价 */
costPrice: number;
/** 商品成本 */
productCost: number;
/** 运费成本 */
shippingCost?: number;
/** 其他成本 */
otherCost?: number;
/** 备注 */
remark?: string;
}
/** 商品过滤条件 */
@@ -13,10 +13,8 @@ export namespace ProductVO {
name: string;
/** 商品编码 */
productCode?: string;
/** 主图URL(冗余字段) */
/** 主图URL */
mainImage?: string;
/** 主图图片ID */
mainImageId?: number;
/** 创建时间 */
createTime: string;
/** 更新时间 */
@@ -43,8 +41,14 @@ export namespace ProductVO {
name: string;
/** 规格编码 */
specCode?: string;
/** 成本价 */
costPrice: number;
/** 商品成本 */
productCost: number;
/** 运费成本 */
shippingCost?: number;
/** 其他成本 */
otherCost?: number;
/** 备注 */
remark?: string;
/** 创建时间 */
createTime: string;
/** 更新时间 */
@@ -107,6 +107,8 @@ export namespace ShopVO {
/** 店铺概览统计信息 */
export interface OverviewStatistics {
/** 店铺名称 */
shopName: string;
/** 店铺总销售额 */
totalSalesAmount: number;
/** 较上月同期增长百分比 */
@@ -0,0 +1,67 @@
import type { FileDTO, FileVO } from './types';
import type { PageQueryDTO, PageResultVO } from '#/types/common';
import { requestClient } from '#/api/request';
/**
* 系统文件管理API
*/
/**
* 批量上传文件
* @param files 文件列表
*/
export async function batchUploadFilesApi(files: File[]) {
const formData = new FormData();
files.forEach((file) => {
formData.append('files', file);
});
return requestClient.post<FileVO.Upload[]>(
'/sys/file/batch-upload',
formData,
{
headers: {
'Content-Type': 'multipart/form-data',
},
},
);
}
/**
* 批量获取Header签名
* @param data 批量签名请求参数
*/
export async function batchSignUrlApi(data: FileDTO.BatchSignUrl) {
return requestClient.post<FileVO.BatchSignUrl>(
'/sys/file/batch-sign-url',
data,
);
}
/**
* 批量创建OSS文件记录
* @param data 批量创建OSS文件记录请求参数
*/
export async function batchCreateOssFilesApi(data: FileDTO.BatchCreateOss) {
return requestClient.post<FileVO.Info[]>('/sys/file/batch-create-oss', data);
}
/**
* 获取文件访问URL
* @param fileId 文件ID
*/
export async function getFileAccessUrlApi(fileId: number) {
return requestClient.get<string>(`/sys/file/${fileId}/access-url`);
}
/**
* 分页获取文件列表
* @param params 分页查询参数
*/
export async function getFilePageApi(params: PageQueryDTO<FileDTO.Filter>) {
return requestClient.post<PageResultVO<FileVO.Info>>(
'/sys/file/page',
params,
);
}
@@ -0,0 +1,6 @@
/**
* 系统文件管理模块API导出
*/
export * from './apis';
export * from './types';
@@ -0,0 +1,6 @@
/**
* 系统文件管理模块类型定义导出
*/
export * from './types.dto';
export * from './types.vo';
@@ -0,0 +1,63 @@
/**
* 系统文件管理模块DTO类型定义
*/
export namespace FileDTO {
/** 批量URL签名请求参数 */
export interface BatchSignUrl {
/** 文件列表 */
files: FileItem[];
}
/** 文件项 */
export interface FileItem {
/** 文件名 */
filename: string;
/** 文件哈希值 */
fileHash: string;
}
/** 批量创建OSS文件记录请求参数 */
export interface BatchCreateOss {
/** 文件列表 */
files: CreateOssFileItem[];
}
/** 创建OSS文件项 */
export interface CreateOssFileItem {
/** 文件名 */
filename: string;
/** 文件哈希值 */
fileHash: string;
/** 存储路径/Key */
storagePath: string;
/** 文件大小(字节) */
fileSize?: number;
/** MIME类型 */
mimeType?: string;
/** 文件分类 */
category?: string;
/** 标签 */
tags?: string;
/** 备注 */
remark?: string;
}
/** 文件过滤条件 */
export interface Filter {
/** 文件名(模糊查询) */
filename?: string;
/** 文件格式(精准查询) */
fileFormat?: string;
/** 存储类型(精准查询) */
storageType?: string;
/** 文件分类(精准查询) */
category?: string;
/** 标签(模糊查询) */
tags?: string;
/** 上传时间范围-开始时间 */
startUploadTime?: string;
/** 上传时间范围-结束时间 */
endUploadTime?: string;
}
}
@@ -0,0 +1,99 @@
/**
* 系统文件管理模块VO类型定义
*/
export namespace FileVO {
/** 文件上传响应信息 */
export interface Upload {
/** 文件ID */
id: number;
/** 存储类型 */
storageType: string;
/** 存储路径/Key */
storagePath: string;
/** 原始文件名 */
filename: string;
/** 文件格式 */
fileFormat: string;
/** MIME类型 */
mimeType: string;
/** 文件大小(字节) */
fileSize: number;
/** 文件哈希值 */
fileHash: string;
/** 文件分类 */
category?: string;
/** 标签 */
tags?: string;
/** 文件描述 */
remark?: string;
/** 访问URL(临时签名URL,仅OSS存储) */
accessUrl?: string;
}
/** 系统文件信息 */
export interface Info {
/** 文件ID */
id: number;
/** 公司ID */
companyId?: number;
/** 存储类型 */
storageType: string;
/** 存储路径/Key */
storagePath: string;
/** 原始文件名 */
filename: string;
/** 文件格式 */
fileFormat: string;
/** MIME类型 */
mimeType: string;
/** 文件大小(字节) */
fileSize: number;
/** 文件哈希值 */
fileHash: string;
/** 文件分类 */
category?: string;
/** 标签 */
tags?: string;
/** 文件描述 */
remark?: string;
/** 上传人ID */
uploadBy?: number;
/** 上传时间 */
uploadTime: string;
/** 更新时间 */
updateTime: string;
/** 更新人ID */
updateBy?: number;
/** 访问URL(临时签名URL) */
accessUrl?: string;
}
/** 批量Header签名响应(Header签名) */
export interface BatchSignUrl {
/** 文件信息列表 */
files: FileSignInfo[];
}
/** 文件签名信息 */
export interface FileSignInfo {
/** 文件名 */
filename: string;
/** 文件哈希值 */
fileHash: string;
/** 文件ID(如果文件已存在) */
fileId?: number;
/** 是否已存在 */
exists: boolean;
/** 上传URL(如果文件不存在,不含签名参数) */
uploadUrl?: string;
/** 上传所需的Header签名信息(如果文件不存在,包含Authorization、Date、x-oss-date、Content-Type等) */
uploadHeaders?: Record<string, string>;
/** 存储路径/Key(如果文件不存在,用于前端创建文件记录时使用) */
storagePath?: string;
/** 访问URL(如果文件已存在,临时签名URL) */
accessUrl?: string;
/** 文件信息(如果文件已存在) */
fileInfo?: Info;
}
}