feat: add model file library links
This commit is contained in:
@@ -62,6 +62,21 @@ export const modelCadFiles = mysqlTable("model_cad_files", {
|
||||
export type ModelCadFile = typeof modelCadFiles.$inferSelect;
|
||||
export type InsertModelCadFile = typeof modelCadFiles.$inferInsert;
|
||||
|
||||
// ─── 车型点云文件 ─────────────────────────────────────────────────────────────
|
||||
// 一个车型可维护多个通用点云文件,供任务按需关联复用
|
||||
|
||||
export const modelPointcloudFiles = mysqlTable("model_pointcloud_files", {
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
modelId: int("modelId").notNull(),
|
||||
name: varchar("name", { length: 255 }).notNull(),
|
||||
fileSize: bigint("fileSize", { mode: "number" }).notNull(),
|
||||
filePath: varchar("filePath", { length: 512 }).notNull(),
|
||||
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||
});
|
||||
|
||||
export type ModelPointcloudFile = typeof modelPointcloudFiles.$inferSelect;
|
||||
export type InsertModelPointcloudFile = typeof modelPointcloudFiles.$inferInsert;
|
||||
|
||||
// ─── 任务 CAD 文件 ─────────────────────────────────────────────────────────────
|
||||
// 每个任务可关联任意个 CAD 文件(与车型级 CAD 独立,用于本次检测的实测参考)
|
||||
|
||||
@@ -72,6 +87,10 @@ export const taskCadFiles = mysqlTable("task_cad_files", {
|
||||
format: varchar("format", { length: 32 }).notNull(),
|
||||
fileSize: bigint("fileSize", { mode: "number" }).notNull(),
|
||||
filePath: varchar("filePath", { length: 512 }).notNull(),
|
||||
/** 来源:uploaded = 用户上传;model_library = 车型 CAD 库关联 */
|
||||
source: varchar("source", { length: 32 }).default("uploaded").notNull(),
|
||||
/** 来源车型 CAD 文件 ID(仅 model_library 时有值) */
|
||||
sourceModelCadFileId: int("sourceModelCadFileId"),
|
||||
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||
});
|
||||
|
||||
@@ -105,10 +124,14 @@ export const taskPointcloudFiles = mysqlTable("task_pointcloud_files", {
|
||||
name: varchar("name", { length: 255 }).notNull(),
|
||||
fileSize: bigint("fileSize", { mode: "number" }).notNull(),
|
||||
filePath: varchar("filePath", { length: 512 }).notNull(),
|
||||
/** 来源:uploaded = 用户上传;registered = 配准算法产出 */
|
||||
/** 来源:uploaded = 用户上传;registered = 配准算法产出;model_library = 车型点云库关联 */
|
||||
source: varchar("source", { length: 32 }).default("uploaded").notNull(),
|
||||
/** 产出该点云的分析结果 ID(仅 registered 时有值) */
|
||||
sourceResultId: int("sourceResultId"),
|
||||
/** 生成该配准产物的原始任务点云 ID(仅 registered 时有值) */
|
||||
sourcePointcloudFileId: int("sourcePointcloudFileId"),
|
||||
/** 来源车型点云文件 ID(仅 model_library 时有值) */
|
||||
sourceModelPointcloudId: int("sourceModelPointcloudId"),
|
||||
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user