perf: 修复删除历史记录没有删除log的bug,新增history管理页面,演示站点启动时不自动启动非管理员用户的定时任务

This commit is contained in:
xiaojunnuo
2024-08-05 12:49:44 +08:00
parent 0227155ab4
commit f78ae93eed
25 changed files with 562 additions and 77 deletions
@@ -1,6 +1,6 @@
import { Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { In, Repository } from 'typeorm';
import { BaseService } from '../../../basic/base-service.js';
import { HistoryLogEntity } from '../entity/history-log.js';
@@ -24,4 +24,11 @@ export class HistoryLogService extends BaseService<HistoryLogEntity> {
await this.add(bean);
}
}
async deleteByHistoryIds(numbers: number[]) {
if (numbers.length === 0) {
return;
}
await this.repository.delete({ historyId: In(numbers) });
}
}