snss-types 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-types/index.d.ts +681 -0
- package/dist-types/index.js +157 -0
- package/dist-types/index.js.map +1 -0
- package/package.json +10 -4
- package/src/types/case.ts +0 -86
- package/src/types/index.ts +0 -70
- package/src/types/scene.ts +0 -612
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
19
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
20
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
21
|
+
if (decorator = decorators[i])
|
|
22
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23
|
+
if (kind && result) __defProp(target, key, result);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// src/types/index.ts
|
|
28
|
+
var index_exports = {};
|
|
29
|
+
__export(index_exports, {
|
|
30
|
+
DirPathDto: () => DirPathDto,
|
|
31
|
+
InitCaseCacheDto: () => InitCaseCacheDto,
|
|
32
|
+
ModelDto: () => ModelDto,
|
|
33
|
+
ModelEntity: () => ModelEntity,
|
|
34
|
+
SendMessageDto: () => SendMessageDto
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
|
|
38
|
+
// src/dto/DirPathDto.ts
|
|
39
|
+
var import_swagger = require("@nestjs/swagger");
|
|
40
|
+
var DirPathDto = class {
|
|
41
|
+
dir;
|
|
42
|
+
isAbsolutePath;
|
|
43
|
+
};
|
|
44
|
+
__decorateClass([
|
|
45
|
+
(0, import_swagger.ApiProperty)({ description: "\u76F8\u5BF9\u8DEF\u5F84\u6216\u7EDD\u5BF9\u8DEF\u5F84", default: "/dataset/cases" })
|
|
46
|
+
], DirPathDto.prototype, "dir", 2);
|
|
47
|
+
__decorateClass([
|
|
48
|
+
(0, import_swagger.ApiProperty)({
|
|
49
|
+
description: "\u662F\u5426\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u53EF\u9009\u53C2\u6570",
|
|
50
|
+
default: false
|
|
51
|
+
})
|
|
52
|
+
], DirPathDto.prototype, "isAbsolutePath", 2);
|
|
53
|
+
|
|
54
|
+
// src/dto/InitCaseCacheDto.ts
|
|
55
|
+
var import_swagger2 = require("@nestjs/swagger");
|
|
56
|
+
var InitCaseCacheDto = class {
|
|
57
|
+
dirPaths;
|
|
58
|
+
fileName;
|
|
59
|
+
};
|
|
60
|
+
__decorateClass([
|
|
61
|
+
(0, import_swagger2.ApiProperty)({
|
|
62
|
+
description: '\u76EE\u6807\u76EE\u5F55\u8DEF\u5F84\uFF08isAbsolutePath \u4E3A false \u662F\u76F8\u5BF9\u4E8E\u540E\u7AEF\u90E8\u7F72\u5305\u7684\u6839\u76EE\u5F55"/dataset/cases"\uFF0CisAbsolutePath\u4E3A true \u662F\u7EDD\u5BF9\u8DEF\u5F84"D:\\XXX"\uFF09',
|
|
63
|
+
type: [DirPathDto],
|
|
64
|
+
// 这里必须指定类型
|
|
65
|
+
example: [
|
|
66
|
+
{
|
|
67
|
+
dir: "/dataset/cases",
|
|
68
|
+
isAbsolutePath: false
|
|
69
|
+
}
|
|
70
|
+
// ,
|
|
71
|
+
// {
|
|
72
|
+
// dir: 'D:\\test',
|
|
73
|
+
// isAbsolutePath: true,
|
|
74
|
+
// },
|
|
75
|
+
]
|
|
76
|
+
})
|
|
77
|
+
], InitCaseCacheDto.prototype, "dirPaths", 2);
|
|
78
|
+
__decorateClass([
|
|
79
|
+
(0, import_swagger2.ApiProperty)({
|
|
80
|
+
description: "\u6587\u4EF6\u540D\u6A21\u7CCA\u5339\u914D\u5173\u952E\u8BCD\uFF0C\u53EF\u9009\u53C2\u6570",
|
|
81
|
+
default: ""
|
|
82
|
+
})
|
|
83
|
+
], InitCaseCacheDto.prototype, "fileName", 2);
|
|
84
|
+
|
|
85
|
+
// src/dto/ModelDto.ts
|
|
86
|
+
var import_swagger3 = require("@nestjs/swagger");
|
|
87
|
+
var ModelDto = class {
|
|
88
|
+
name;
|
|
89
|
+
type;
|
|
90
|
+
url;
|
|
91
|
+
};
|
|
92
|
+
__decorateClass([
|
|
93
|
+
(0, import_swagger3.ApiProperty)({ description: "\u540D\u79F0", default: "" })
|
|
94
|
+
], ModelDto.prototype, "name", 2);
|
|
95
|
+
__decorateClass([
|
|
96
|
+
(0, import_swagger3.ApiProperty)({
|
|
97
|
+
description: "\u7C7B\u578B ( satellite | station | equip | other )",
|
|
98
|
+
default: "satellite"
|
|
99
|
+
})
|
|
100
|
+
], ModelDto.prototype, "type", 2);
|
|
101
|
+
__decorateClass([
|
|
102
|
+
(0, import_swagger3.ApiProperty)({
|
|
103
|
+
description: "\u6A21\u578B\u76F8\u5BF9\u8DEF\u5F84",
|
|
104
|
+
default: ""
|
|
105
|
+
})
|
|
106
|
+
], ModelDto.prototype, "url", 2);
|
|
107
|
+
|
|
108
|
+
// src/dto/SendMessageDto.ts
|
|
109
|
+
var import_swagger4 = require("@nestjs/swagger");
|
|
110
|
+
var import_class_validator = require("class-validator");
|
|
111
|
+
var SendMessageDto = class {
|
|
112
|
+
// 限制不能为空
|
|
113
|
+
msg;
|
|
114
|
+
};
|
|
115
|
+
__decorateClass([
|
|
116
|
+
(0, import_swagger4.ApiProperty)({ description: "\u8981\u53D1\u9001\u7684\u6D88\u606F\u5185\u5BB9" }),
|
|
117
|
+
(0, import_class_validator.IsString)(),
|
|
118
|
+
(0, import_class_validator.IsNotEmpty)()
|
|
119
|
+
], SendMessageDto.prototype, "msg", 2);
|
|
120
|
+
|
|
121
|
+
// src/entity/ModelEntity.ts
|
|
122
|
+
var import_typeorm = require("typeorm");
|
|
123
|
+
var ModelEntity = class {
|
|
124
|
+
// 自动生成主键值(不用你手动赋值)
|
|
125
|
+
id;
|
|
126
|
+
name;
|
|
127
|
+
type;
|
|
128
|
+
url;
|
|
129
|
+
updateTime;
|
|
130
|
+
};
|
|
131
|
+
__decorateClass([
|
|
132
|
+
(0, import_typeorm.PrimaryGeneratedColumn)()
|
|
133
|
+
], ModelEntity.prototype, "id", 2);
|
|
134
|
+
__decorateClass([
|
|
135
|
+
(0, import_typeorm.Column)()
|
|
136
|
+
], ModelEntity.prototype, "name", 2);
|
|
137
|
+
__decorateClass([
|
|
138
|
+
(0, import_typeorm.Column)()
|
|
139
|
+
], ModelEntity.prototype, "type", 2);
|
|
140
|
+
__decorateClass([
|
|
141
|
+
(0, import_typeorm.Column)()
|
|
142
|
+
], ModelEntity.prototype, "url", 2);
|
|
143
|
+
__decorateClass([
|
|
144
|
+
(0, import_typeorm.UpdateDateColumn)()
|
|
145
|
+
], ModelEntity.prototype, "updateTime", 2);
|
|
146
|
+
ModelEntity = __decorateClass([
|
|
147
|
+
(0, import_typeorm.Entity)()
|
|
148
|
+
], ModelEntity);
|
|
149
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
150
|
+
0 && (module.exports = {
|
|
151
|
+
DirPathDto,
|
|
152
|
+
InitCaseCacheDto,
|
|
153
|
+
ModelDto,
|
|
154
|
+
ModelEntity,
|
|
155
|
+
SendMessageDto
|
|
156
|
+
});
|
|
157
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types/index.ts","../src/dto/DirPathDto.ts","../src/dto/InitCaseCacheDto.ts","../src/dto/ModelDto.ts","../src/dto/SendMessageDto.ts","../src/entity/ModelEntity.ts"],"sourcesContent":["import { ModelEntity } from '@/entity/ModelEntity'\r\nimport { CaseItem } from './case'\r\nimport { SceneItemMeta } from './scene'\r\n\r\nexport * from '@/dto/DirPathDto'\r\nexport * from '@/dto/InitCaseCacheDto'\r\nexport * from '@/dto/ModelDto'\r\nexport * from '@/dto/SendMessageDto'\r\nexport * from '@/entity/ModelEntity'\r\nexport * from './case'\r\nexport * from './scene'\r\n\r\n/**\r\n * 基础响应结构\r\n * 所有 API 响应的通用格式\r\n */\r\nexport interface BaseResponse {\r\n /** 状态码,通常 200 表示成功,其他表示错误 */\r\n code: number\r\n /** 响应数据,可选 */\r\n data?: any\r\n /** 响应消息或错误描述 */\r\n message: string\r\n}\r\n\r\n/**\r\n * 库树结构响应\r\n * 用于返回层级化的树形结构数据(如目录树、模型库树等)\r\n */\r\nexport interface CaseTreeResponse extends BaseResponse {\r\n /** 树形节点数组 */\r\n data?: CaseItem[]\r\n}\r\n/**\r\n * 场景详细信息响应\r\n * 通过场景文件夹路径查询并返回场景详细信息\r\n */\r\nexport interface SceneItemMetaResponse extends BaseResponse {\r\n /** 树形节点数组 */\r\n data?: SceneItemMeta\r\n}\r\n\r\n/**\r\n * JSON 文件上传响应\r\n * 用于返回上传后的文件详细信息\r\n */\r\nexport interface UploadFileResponse extends BaseResponse {\r\n /** 上传文件的具体信息 */\r\n data?: {\r\n /** 原始文件名 */\r\n originalName: string\r\n /** 文件大小(字节) */\r\n size: number\r\n /** 文件 MIME 类型 */\r\n mimetype: string\r\n /** 服务器存储路径 */\r\n path: string\r\n /** 服务器生成的文件名 */\r\n filename: string\r\n }\r\n}\r\n\r\n/**\r\n * 模型响应\r\n * 用于返回单个模型、模型列表或空值\r\n */\r\nexport interface ModelResponse extends BaseResponse {\r\n /** 模型实体数据,可能是单个对象、数组或 null */\r\n data?: ModelEntity | ModelEntity[] | null\r\n}\r\n","import { ApiProperty } from '@nestjs/swagger'\nexport class DirPathDto {\n @ApiProperty({ description: '相对路径或绝对路径', default: '/dataset/cases' })\n dir!: string\n\n @ApiProperty({\n description: '是否为绝对路径,可选参数',\n default: false,\n })\n isAbsolutePath?: boolean\n}\n","import { ApiProperty } from '@nestjs/swagger'\r\nimport { DirPathDto } from './DirPathDto'\r\nexport class InitCaseCacheDto {\r\n @ApiProperty({\r\n description:\r\n '目标目录路径(isAbsolutePath 为 false 是相对于后端部署包的根目录\"/dataset/cases\",isAbsolutePath为 true 是绝对路径\"D:\\\\XXX\")',\r\n type: [DirPathDto], // 这里必须指定类型\r\n example: [\r\n {\r\n dir: '/dataset/cases',\r\n isAbsolutePath: false,\r\n },\r\n // ,\r\n // {\r\n // dir: 'D:\\\\test',\r\n // isAbsolutePath: true,\r\n // },\r\n ],\r\n })\r\n dirPaths?: Array<DirPathDto>\r\n\r\n @ApiProperty({\r\n description: '文件名模糊匹配关键词,可选参数',\r\n default: '',\r\n })\r\n fileName?: string\r\n}\r\n","import { ApiProperty } from '@nestjs/swagger'\nexport class ModelDto {\n @ApiProperty({ description: '名称', default: '' })\n name!: string\n\n @ApiProperty({\n description: '类型 ( satellite | station | equip | other )',\n default: 'satellite',\n })\n type!: string\n\n @ApiProperty({\n description: '模型相对路径',\n default: '',\n })\n url!: string\n}\n","import { ApiProperty } from '@nestjs/swagger'\nimport { IsNotEmpty, IsString } from 'class-validator'\nexport class SendMessageDto {\n @ApiProperty({ description: '要发送的消息内容' })\n @IsString() // 限制必须是字符串\n @IsNotEmpty() // 限制不能为空\n msg!: string\n}\n","import {\n Entity,\n PrimaryGeneratedColumn,\n Column,\n UpdateDateColumn,\n} from 'typeorm'\n\n@Entity() // 默认映射的数据库表名为 model-entity\nexport class ModelEntity {\n @PrimaryGeneratedColumn() // 自动生成主键值(不用你手动赋值)\n id!: number\n\n @Column()\n name!: string // 模型名称\n\n @Column()\n type!: string // 模型类型(卫星、终端设备、信关站)\n\n @Column()\n url!: string // 模型url\n\n // 每次执行 save 操作更新该实体时,该字段会自动更新为当前时间戳\n @UpdateDateColumn()\n updateTime!: Date\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,qBAA4B;AACrB,IAAM,aAAN,MAAiB;AAAA,EAEtB;AAAA,EAMA;AACF;AAPE;AAAA,MADC,4BAAY,EAAE,aAAa,0DAAa,SAAS,iBAAiB,CAAC;AAAA,GADzD,WAEX;AAMA;AAAA,MAJC,4BAAY;AAAA,IACX,aAAa;AAAA,IACb,SAAS;AAAA,EACX,CAAC;AAAA,GAPU,WAQX;;;ACTF,IAAAA,kBAA4B;AAErB,IAAM,mBAAN,MAAuB;AAAA,EAiB5B;AAAA,EAMA;AACF;AAPE;AAAA,MAhBC,6BAAY;AAAA,IACX,aACE;AAAA,IACF,MAAM,CAAC,UAAU;AAAA;AAAA,IACjB,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,gBAAgB;AAAA,MAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMF;AAAA,EACF,CAAC;AAAA,GAhBU,iBAiBX;AAMA;AAAA,MAJC,6BAAY;AAAA,IACX,aAAa;AAAA,IACb,SAAS;AAAA,EACX,CAAC;AAAA,GAtBU,iBAuBX;;;ACzBF,IAAAC,kBAA4B;AACrB,IAAM,WAAN,MAAe;AAAA,EAEpB;AAAA,EAMA;AAAA,EAMA;AACF;AAbE;AAAA,MADC,6BAAY,EAAE,aAAa,gBAAM,SAAS,GAAG,CAAC;AAAA,GADpC,SAEX;AAMA;AAAA,MAJC,6BAAY;AAAA,IACX,aAAa;AAAA,IACb,SAAS;AAAA,EACX,CAAC;AAAA,GAPU,SAQX;AAMA;AAAA,MAJC,6BAAY;AAAA,IACX,aAAa;AAAA,IACb,SAAS;AAAA,EACX,CAAC;AAAA,GAbU,SAcX;;;ACfF,IAAAC,kBAA4B;AAC5B,6BAAqC;AAC9B,IAAM,iBAAN,MAAqB;AAAA;AAAA,EAI1B;AACF;AADE;AAAA,MAHC,6BAAY,EAAE,aAAa,mDAAW,CAAC;AAAA,MACvC,iCAAS;AAAA,MACT,mCAAW;AAAA,GAHD,eAIX;;;ACNF,qBAKO;AAGA,IAAM,cAAN,MAAkB;AAAA;AAAA,EAEvB;AAAA,EAGA;AAAA,EAGA;AAAA,EAGA;AAAA,EAIA;AACF;AAdE;AAAA,MADC,uCAAuB;AAAA,GADb,YAEX;AAGA;AAAA,MADC,uBAAO;AAAA,GAJG,YAKX;AAGA;AAAA,MADC,uBAAO;AAAA,GAPG,YAQX;AAGA;AAAA,MADC,uBAAO;AAAA,GAVG,YAWX;AAIA;AAAA,MADC,iCAAiB;AAAA,GAdP,YAeX;AAfW,cAAN;AAAA,MADN,uBAAO;AAAA,GACK;","names":["import_swagger","import_swagger","import_swagger"]}
|
package/package.json
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snss-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"label": "卫星网络仿真文件解析数据传输服务",
|
|
5
5
|
"description": "基于 Nestjs 的 服务端接口,提供文件数据处理解析传输等服务接口",
|
|
6
6
|
"private": false,
|
|
7
|
-
"main": "./
|
|
7
|
+
"main": "./dist-types/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
|
-
"
|
|
9
|
+
"dist-types"
|
|
10
|
+
],
|
|
11
|
+
"keywords": [
|
|
12
|
+
"snss-types"
|
|
10
13
|
],
|
|
11
14
|
"scripts": {
|
|
12
15
|
"dev": "nest start --watch",
|
|
13
|
-
"build": "nest build",
|
|
16
|
+
"build:server": "nest build",
|
|
17
|
+
"build:types": "tsup --config tsup.config.ts",
|
|
18
|
+
"publish:types": "npm publish",
|
|
14
19
|
"start": "node dist/src/main.js",
|
|
15
20
|
"pm2:start": "npx pm2 start ecosystem.config.js --name nest-app",
|
|
16
21
|
"pm2:save": "npx pm2 save",
|
|
@@ -70,6 +75,7 @@
|
|
|
70
75
|
"ts-loader": "^9.5.2",
|
|
71
76
|
"ts-node": "^10.9.2",
|
|
72
77
|
"tsconfig-paths": "^4.2.0",
|
|
78
|
+
"tsup": "^8.5.1",
|
|
73
79
|
"typescript": "5.7.3",
|
|
74
80
|
"typescript-eslint": "^8.20.0"
|
|
75
81
|
},
|
package/src/types/case.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { EvaluationMethod, SceneItem, SceneItemSelfInfo } from './scene'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 案例类型
|
|
5
|
-
*/
|
|
6
|
-
export type CaseType = 'architecture_optimization'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 优化评估案例
|
|
10
|
-
*/
|
|
11
|
-
export interface CaseJsonData {
|
|
12
|
-
/** 案例唯一标识 */
|
|
13
|
-
case_id: string
|
|
14
|
-
/** 案例名称 */
|
|
15
|
-
case_name: string
|
|
16
|
-
/** 案例类型 */
|
|
17
|
-
case_type: CaseType
|
|
18
|
-
/** 案例描述 */
|
|
19
|
-
description: string
|
|
20
|
-
/** 默认展示的场景ID */
|
|
21
|
-
default_scene_id: string
|
|
22
|
-
/** 场景顺序列表(按迭代顺序排列的 scene_id 数组) */
|
|
23
|
-
scene_order: string[]
|
|
24
|
-
/** 场景详情列表 */
|
|
25
|
-
scenes: SceneItemSelfInfo[]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* 案例库树结构对象
|
|
30
|
-
*/
|
|
31
|
-
export interface CaseItem {
|
|
32
|
-
label: string
|
|
33
|
-
value: string
|
|
34
|
-
meta: CaseItemMeta
|
|
35
|
-
children: SceneItem[]
|
|
36
|
-
isLeaf?: boolean
|
|
37
|
-
isOnline?: boolean
|
|
38
|
-
[x: string]: any
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface CaseItemMeta {
|
|
42
|
-
case_json?: CaseJsonData
|
|
43
|
-
evaluation_summary_json?: EvaluationSummaryData
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* 各维度评分
|
|
48
|
-
*/
|
|
49
|
-
export interface DimensionScores {
|
|
50
|
-
/** 网络容量评分 */
|
|
51
|
-
network_capacity: number
|
|
52
|
-
/** 服务质量评分 */
|
|
53
|
-
service_quality: number
|
|
54
|
-
/** 网络韧性评分 */
|
|
55
|
-
network_resilience: number
|
|
56
|
-
/** 网络复杂度评分 */
|
|
57
|
-
network_complexity: number
|
|
58
|
-
// 支持增加新的评估维度
|
|
59
|
-
[x: string]: number
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* 场景评估节点
|
|
64
|
-
*/
|
|
65
|
-
export interface SceneEvaluation {
|
|
66
|
-
/** 场景唯一标识 */
|
|
67
|
-
scene_id: string
|
|
68
|
-
/** 场景显示名称 */
|
|
69
|
-
scene_name: string
|
|
70
|
-
/** 综合最终得分 */
|
|
71
|
-
final_score: number
|
|
72
|
-
/** 各维度得分详情 */
|
|
73
|
-
dimension_scores: DimensionScores
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* 多维度评估结果
|
|
78
|
-
*/
|
|
79
|
-
export interface EvaluationSummaryData {
|
|
80
|
-
/** 案例唯一标识 */
|
|
81
|
-
case_id: string
|
|
82
|
-
/** 评估方法 */
|
|
83
|
-
evaluation_method: EvaluationMethod
|
|
84
|
-
/** 场景评估列表 */
|
|
85
|
-
scenes: SceneEvaluation[]
|
|
86
|
-
}
|
package/src/types/index.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { ModelEntity } from '@/entity/ModelEntity'
|
|
2
|
-
import { CaseItem } from './case'
|
|
3
|
-
import { SceneItemMeta } from './scene'
|
|
4
|
-
|
|
5
|
-
export * from '@/dto/DirPathDto'
|
|
6
|
-
export * from '@/dto/InitCaseCacheDto'
|
|
7
|
-
export * from '@/dto/ModelDto'
|
|
8
|
-
export * from '@/dto/SendMessageDto'
|
|
9
|
-
export * from '@/entity/ModelEntity'
|
|
10
|
-
export * from './case'
|
|
11
|
-
export * from './scene'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 基础响应结构
|
|
15
|
-
* 所有 API 响应的通用格式
|
|
16
|
-
*/
|
|
17
|
-
export interface BaseResponse {
|
|
18
|
-
/** 状态码,通常 200 表示成功,其他表示错误 */
|
|
19
|
-
code: number
|
|
20
|
-
/** 响应数据,可选 */
|
|
21
|
-
data?: any
|
|
22
|
-
/** 响应消息或错误描述 */
|
|
23
|
-
message: string
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 库树结构响应
|
|
28
|
-
* 用于返回层级化的树形结构数据(如目录树、模型库树等)
|
|
29
|
-
*/
|
|
30
|
-
export interface CaseTreeResponse extends BaseResponse {
|
|
31
|
-
/** 树形节点数组 */
|
|
32
|
-
data?: CaseItem[]
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* 场景详细信息响应
|
|
36
|
-
* 通过场景文件夹路径查询并返回场景详细信息
|
|
37
|
-
*/
|
|
38
|
-
export interface SceneItemMetaResponse extends BaseResponse {
|
|
39
|
-
/** 树形节点数组 */
|
|
40
|
-
data?: SceneItemMeta
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* JSON 文件上传响应
|
|
45
|
-
* 用于返回上传后的文件详细信息
|
|
46
|
-
*/
|
|
47
|
-
export interface UploadFileResponse extends BaseResponse {
|
|
48
|
-
/** 上传文件的具体信息 */
|
|
49
|
-
data?: {
|
|
50
|
-
/** 原始文件名 */
|
|
51
|
-
originalName: string
|
|
52
|
-
/** 文件大小(字节) */
|
|
53
|
-
size: number
|
|
54
|
-
/** 文件 MIME 类型 */
|
|
55
|
-
mimetype: string
|
|
56
|
-
/** 服务器存储路径 */
|
|
57
|
-
path: string
|
|
58
|
-
/** 服务器生成的文件名 */
|
|
59
|
-
filename: string
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 模型响应
|
|
65
|
-
* 用于返回单个模型、模型列表或空值
|
|
66
|
-
*/
|
|
67
|
-
export interface ModelResponse extends BaseResponse {
|
|
68
|
-
/** 模型实体数据,可能是单个对象、数组或 null */
|
|
69
|
-
data?: ModelEntity | ModelEntity[] | null
|
|
70
|
-
}
|