perf: 站点证书监控增加导出和分组功能

This commit is contained in:
xiaojunnuo
2025-10-21 22:28:02 +08:00
parent e578c52fdf
commit 2ed12c429e
13 changed files with 619 additions and 10 deletions
@@ -0,0 +1,31 @@
import { Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { BaseService } from '@certd/lib-server';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { merge } from 'lodash-es';
import { GroupEntity } from '../entity/group.js';
@Provide()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
export class GroupService extends BaseService<GroupEntity> {
@InjectEntityModel(GroupEntity)
repository: Repository<GroupEntity>;
//@ts-ignore
getRepository() {
return this.repository;
}
async add(bean: any) {
if (!bean.type) {
throw new Error('type is required');
}
bean = merge(
{
favorite: false,
},
bean
);
return await this.repository.save(bean);
}
}