chore: 支持手动上传证书并部署

This commit is contained in:
xiaojunnuo
2025-03-19 00:28:50 +08:00
parent 873f2b618b
commit d1b61b6bf9
17 changed files with 491 additions and 172 deletions
@@ -121,6 +121,16 @@ export class CertInfoController extends CrudController<CertInfoService> {
return this.ok(list);
}
@Post('/getCert', { summary: Constants.per.authOnly })
async getCert(@Query('id') id: number) {
await this.service.checkUserId(id, this.getUserId());
const certInfoEntity = await this.service.info(id);
const certInfo = JSON.parse(certInfoEntity.certInfo);
return this.ok(certInfo);
}
@Post('/upload', { summary: Constants.per.authOnly })
async upload(@Body(ALL) body: {cert: CertInfo, pipeline: any, id?: number}) {
if (body.id) {
@@ -131,23 +141,16 @@ export class CertInfoController extends CrudController<CertInfoService> {
userId: this.getUserId(),
cert: body.cert,
});
return this.ok();
}else{
//添加
await this.certUploadService.createUploadCertPipeline({
const res = await this.certUploadService.createUploadCertPipeline({
userId: this.getUserId(),
cert: body.cert,
pipeline: body.pipeline,
});
return this.ok(res)
}
return this.ok();
}
@Post('/getCert', { summary: Constants.per.authOnly })
async getCert(@Query('id') id: number) {
await this.service.checkUserId(id, this.getUserId());
const certInfoEntity = await this.service.info(id);
const certInfo = JSON.parse(certInfoEntity.certInfo);
return this.ok(certInfo);
}
}