chore: stabilize lint and verify builds

This commit is contained in:
2026-02-06 11:51:32 +08:00
parent edede17880
commit 1782f64417
114 changed files with 3032 additions and 1345 deletions

View File

@@ -3,16 +3,18 @@ package event
import (
"context"
"go.ipao.vip/atom"
"go.ipao.vip/atom/container"
"go.ipao.vip/atom/contracts"
"quyun/v2/app/commands"
"quyun/v2/app/errorx"
"quyun/v2/app/events/subscribers"
"quyun/v2/providers/app"
"quyun/v2/providers/event"
"quyun/v2/providers/postgres"
log "github.com/sirupsen/logrus"
"go.ipao.vip/atom"
"go.ipao.vip/atom/container"
"go.ipao.vip/atom/contracts"
logrus "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"go.uber.org/dig"
)
@@ -45,14 +47,19 @@ type Service struct {
Initials []contracts.Initial `group:"initials"`
}
func Serve(cmd *cobra.Command, args []string) error {
return container.Container.Invoke(func(ctx context.Context, svc Service) error {
log.SetFormatter(&log.JSONFormatter{})
func Serve(_ *cobra.Command, _ []string) error {
err := container.Container.Invoke(func(ctx context.Context, svc Service) error {
logrus.SetFormatter(&logrus.JSONFormatter{})
if svc.App.IsDevMode() {
log.SetLevel(log.DebugLevel)
logrus.SetLevel(logrus.DebugLevel)
}
return svc.PubSub.Serve(ctx)
})
if err != nil {
return errorx.ErrOperationFailed.WithCause(err)
}
return nil
}