mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-21 18:37:58 +00:00
refactor: clean code
This commit is contained in:
@@ -60,7 +60,7 @@ func (a *applyNode) Run(ctx context.Context) error {
|
||||
}
|
||||
|
||||
// 获取Applicant
|
||||
applicant, err := applicant.GetWithApplyNode(a.node)
|
||||
applicant, err := applicant.NewWithApplyNode(a.node)
|
||||
if err != nil {
|
||||
a.AddOutput(ctx, a.node.Name, "获取申请对象失败", err.Error())
|
||||
return err
|
||||
@@ -101,8 +101,8 @@ func (a *applyNode) Run(ctx context.Context) error {
|
||||
Certificate: applyResult.Certificate,
|
||||
PrivateKey: applyResult.PrivateKey,
|
||||
IssuerCertificate: applyResult.IssuerCertificate,
|
||||
ACMECertUrl: applyResult.CertUrl,
|
||||
ACMECertStableUrl: applyResult.CertStableUrl,
|
||||
ACMECertUrl: applyResult.ACMECertUrl,
|
||||
ACMECertStableUrl: applyResult.ACMECertStableUrl,
|
||||
EffectAt: certX509.NotBefore,
|
||||
ExpireAt: certX509.NotAfter,
|
||||
WorkflowId: GetWorkflowId(ctx),
|
||||
|
@@ -70,9 +70,9 @@ func (d *deployNode) Run(ctx context.Context) error {
|
||||
Domains: cert.SubjectAltNames,
|
||||
AccessConfig: access.Config,
|
||||
AccessRecord: access,
|
||||
Certificate: applicant.Certificate{
|
||||
CertUrl: cert.ACMECertUrl,
|
||||
CertStableUrl: cert.ACMECertStableUrl,
|
||||
Certificate: applicant.ApplyResult{
|
||||
ACMECertUrl: cert.ACMECertUrl,
|
||||
ACMECertStableUrl: cert.ACMECertStableUrl,
|
||||
PrivateKey: cert.PrivateKey,
|
||||
Certificate: cert.Certificate,
|
||||
IssuerCertificate: cert.IssuerCertificate,
|
||||
@@ -85,7 +85,7 @@ func (d *deployNode) Run(ctx context.Context) error {
|
||||
},
|
||||
}
|
||||
|
||||
deploy, err := deployer.GetWithProviderAndOption(d.node.GetConfigString("provider"), option)
|
||||
deploy, err := deployer.NewWithProviderAndOption(d.node.GetConfigString("provider"), option)
|
||||
if err != nil {
|
||||
d.AddOutput(ctx, d.node.Name, "获取部署对象失败", err.Error())
|
||||
return err
|
||||
|
Reference in New Issue
Block a user