This commit is contained in:
2025-05-05 00:01:36 +08:00
parent d6014b3c40
commit a412c09da0
20 changed files with 2911 additions and 102 deletions

View File

@@ -1,6 +1,6 @@
import { XhsClient } from '@kevisual/xhs/libs/xhs.ts';
import { Sequelize } from 'sequelize';
import { createSequelize } from '@kevisual/xhs/services/xhs-db/db.ts';
// import { createSequelize } from '@kevisual/xhs/services/xhs-db/db.ts';
import path from 'node:path';
import fs from 'node:fs';
@@ -17,7 +17,7 @@ type XhsClientMap = {
client: XhsClient;
key: string;
options: XhsClientOptions;
db: Sequelize;
db?: Sequelize;
};
type XhsServicesOptions = {
root?: string;
@@ -49,16 +49,16 @@ export class XhsServices {
if (!fs.existsSync(storage) || !isNew) {
isNew = true;
}
const db = createSequelize({ storage: storage });
// const db = createSequelize({ storage: storage });
const xhsClientMap = {
client,
key,
options,
db,
// db,
};
if (isNew) {
this.initDb(xhsClientMap);
}
// if (isNew) {
// this.initDb(xhsClientMap);
// }
this.map.set(key, xhsClientMap);
return client;