优化结构
This commit is contained in:
+13
@@ -9,12 +9,16 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"kra/internal/app"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/server/router"
|
||||
"kra/internal/service"
|
||||
"kra/internal/service/dto"
|
||||
"kra/internal/worker"
|
||||
"kra/pkg/logging"
|
||||
"kra/pkg/module"
|
||||
"kra/pkg/mq"
|
||||
platformtask "kra/pkg/task"
|
||||
|
||||
"github.com/go-kratos/kratos/v3"
|
||||
"github.com/go-kratos/kratos/v3/config"
|
||||
@@ -41,6 +45,15 @@ func init() {
|
||||
flag.StringVar(&flagconf, "conf", "./configs", "config path, eg: -conf config.yaml")
|
||||
}
|
||||
|
||||
// runtimeContributions is the binary-level list of modules with constructed
|
||||
// route or task dependencies. Adding another runtime module is explicit here.
|
||||
func runtimeContributions(systemRoutes *router.Routes, systemTasks *worker.TaskMethods) app.RuntimeContributions {
|
||||
return app.RuntimeContributions{
|
||||
Routes: []module.RouteRegistrar{systemRoutes},
|
||||
Tasks: []platformtask.Contributor{systemTasks},
|
||||
}
|
||||
}
|
||||
|
||||
func newApp(logger *slog.Logger, hs *kratoshttp.Server, scheduler *worker.TaskScheduler, audit *service.AuditRecorder, loggerControl *logging.ReloadableLogger, _ mq.Client) *kratos.App {
|
||||
if audit != nil && loggerControl != nil {
|
||||
loggerControl.SetErrorSink(logging.ErrorSinkFunc(func(ctx context.Context, entry logging.ErrorEntry) error {
|
||||
|
||||
Reference in New Issue
Block a user