Skip to content

Let's use AI to Earn!

feat: 事件启动自动任务

yikaJasonMic1daa83e557b2
diff --git a/electron/main/autoRun/controller.ts b/electron/main/autoRun/controller.ts
index 62034e1a..a2948070 100644
--- a/electron/main/autoRun/controller.ts
+++ b/electron/main/autoRun/controller.ts
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-01-20 22:02:54
- * @LastEditTime: 2025-03-19 19:34:24
+ * @LastEditTime: 2025-03-23 09:59:57
* @LastEditors: nevin
* @Description: autoRun AutoRun
*/
@@ -10,7 +10,7 @@ import { AutoRunService } from './service';
import { AutoRunType } from '../../db/models/autoRun';
import { getUserInfo } from '../user/comment';
import { EtEvent } from '../../global/event';
-import { autoRunTypeEtTag } from './comment';
+import { autoRunTypeEtTag, hasTriggered } from './comment';
@Controller()
export class AutoRunController {
@@ -119,7 +119,8 @@ export class AutoRunController {
for (const item of autoRunList) {
const tag = autoRunTypeEtTag.get(item.type);
if (!tag) continue;
- // TODO: 根据创建记录,对比是否已经执行
+ const needRun = hasTriggered(item.cycleType);
+ if (!needRun) continue;
EtEvent.emit(tag, item);
}
} catch (error) {
diff --git a/electron/main/reply/controller.ts b/electron/main/reply/controller.ts
index 101ef213..4e600daf 100644
--- a/electron/main/reply/controller.ts
+++ b/electron/main/reply/controller.ts
@@ -1,12 +1,13 @@
/*
* @Author: nevin
* @Date: 2025-01-20 22:02:54
- * @LastEditTime: 2025-03-23 09:44:54
+ * @LastEditTime: 2025-03-23 09:57:58
* @LastEditors: nevin
* @Description: reply Reply
*/
import { AutoRunModel, AutoRunType } from '../../db/models/autoRun';
import { AccountService } from '../account/service';
+import { autoRunTypeEtTag } from '../autoRun/comment';
import { AutoRunService } from '../autoRun/service';
import { Controller, Et, Icp, Inject } from '../core/decorators';
import platController from '../plat';