WIP: add the logic to save job mark as not suit to db TODO: fix issue about retrieving and showing items

This commit is contained in:
geekgeekrun
2024-10-20 11:25:41 +08:00
parent 7f0ae45758
commit 6b28a9d0ed
7 changed files with 106 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ import { VMarkAsNotSuitLog } from "./entity/VMarkAsNotSuitLog"
import sqlite3 from 'sqlite3';
import * as cliHighlight from 'cli-highlight';
import { saveChatStartupRecord, saveJobInfoFromRecommendPage } from "./handlers";
import { saveChatStartupRecord, saveJobInfoFromRecommendPage, saveMarkAsNotSuitRecord } from "./handlers";
import { UpdateChatStartupLogTable1729182577167 } from "./migrations/1729182577167-UpdateChatStartupLogTable";
Boolean(cliHighlight);
@@ -119,5 +119,15 @@ export default class SqlitePlugin {
chatStartupFrom
});
});
hooks.jobMarkedAsNotSuit.tapPromise("SqlitePlugin", async (_jobInfo, { markFrom = ChatStartupFrom.AutoFromRecommendList, markReason = undefined, extInfo = undefined } = {}) => {
const ds = await this.initPromise;
return await saveMarkAsNotSuitRecord(ds, _jobInfo, this.userInfo, {
autoStartupChatRecordId: this.runRecordId,
markFrom,
markReason,
extInfo
});
});
}
}