Files
certd/packages/ui/certd-server/src/modules/pipeline/service/history-log-service.ts
T
2023-01-29 13:44:19 +08:00

28 lines
693 B
TypeScript

import { Provide, Scope, ScopeEnum } from "@midwayjs/decorator";
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { BaseService } from '../../../basic/base-service';
import { HistoryLogEntity } from '../entity/history-log';
/**
* 证书申请
*/
@Provide()
@Scope(ScopeEnum.Singleton)
export class HistoryLogService extends BaseService<HistoryLogEntity> {
@InjectEntityModel(HistoryLogEntity)
repository: Repository<HistoryLogEntity>;
getRepository() {
return this.repository;
}
async save(bean: HistoryLogEntity) {
if (bean.id > 0) {
await this.update(bean);
} else {
await this.add(bean);
}
}
}