details improvement and unnecessary files deletion

This commit is contained in:
yoan
2024-11-24 13:36:17 +08:00
parent 37df882ed3
commit 9ff3e22c80
57 changed files with 978 additions and 5047 deletions

View File

@@ -0,0 +1,11 @@
package scheduler
import "context"
type CertificateService interface {
InitSchedule(ctx context.Context) error
}
func NewCertificateScheduler(service CertificateService) error {
return service.InitSchedule(context.Background())
}

View File

@@ -0,0 +1,19 @@
package scheduler
import (
"github.com/usual2970/certimate/internal/certificate"
"github.com/usual2970/certimate/internal/repository"
"github.com/usual2970/certimate/internal/workflow"
)
func Register() {
workflowRepo := repository.NewWorkflowRepository()
workflowSvc := workflow.NewWorkflowService(workflowRepo)
certificateRepo := repository.NewCertificateRepository()
certificateSvc := certificate.NewCertificateService(certificateRepo)
NewCertificateScheduler(certificateSvc)
NewWorkflowScheduler(workflowSvc)
}

View File

@@ -0,0 +1,11 @@
package scheduler
import "context"
type WorkflowService interface {
InitSchedule(ctx context.Context) error
}
func NewWorkflowScheduler(service WorkflowService) error {
return service.InitSchedule(context.Background())
}