feat: 重构项目结构,添加命令处理程序并移除冗余文件

This commit is contained in:
Rogee
2025-09-12 19:43:06 +08:00
parent 4c8205212f
commit dd097e9aec
12 changed files with 6 additions and 61 deletions

View File

@@ -32,8 +32,9 @@ tools:
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install github.com/bufbuild/buf/cmd/buf@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go get go.ipao.vip/atom
go get -u go.ipao.vip/atom
go get -u google.golang.org/genproto
go get -u github.com/gofiber/fiber/v3
.PHONY: init
init: tools
@atomctl swag init

View File

@@ -7,7 +7,6 @@ import (
"go.ipao.vip/atom/container"
"go.ipao.vip/atom/contracts"
"{{.ModuleName}}/app/events/subscribers"
"{{.ModuleName}}/app/srv"
"{{.ModuleName}}/providers/app"
"{{.ModuleName}}/providers/event"
"{{.ModuleName}}/providers/postgres"

View File

@@ -5,7 +5,6 @@ import (
"go.ipao.vip/atom/container"
"go.ipao.vip/atom/contracts"
"{{.ModuleName}}/app/grpc/users"
"{{.ModuleName}}/app/srv"
"{{.ModuleName}}/providers/app"
"{{.ModuleName}}/providers/grpc"
"{{.ModuleName}}/providers/postgres"

View File

@@ -8,7 +8,6 @@ import (
"go.ipao.vip/atom/contracts"
"{{.ModuleName}}/app/errorx"
"{{.ModuleName}}/app/jobs"
"{{.ModuleName}}/app/srv"
_ "{{.ModuleName}}/docs"
"{{.ModuleName}}/providers/app"
"{{.ModuleName}}/providers/http"

View File

@@ -4,7 +4,6 @@ import (
"context"
"database/sql"
"{{.ModuleName}}/app/srv"
"{{.ModuleName}}/database"
"{{.ModuleName}}/providers/postgres"

View File

@@ -8,7 +8,6 @@ import (
"go.ipao.vip/atom/contracts"
"{{.ModuleName}}/app/jobs"
"{{.ModuleName}}/app/srv"
"{{.ModuleName}}/providers/app"
"{{.ModuleName}}/providers/job"
"{{.ModuleName}}/providers/postgres"

View File

@@ -4,8 +4,8 @@ import (
"context"
"testing"
"{{.ModuleName}}/app/commands/testx"
"{{.ModuleName}}/app/services"
"{{.ModuleName}}/app/srv/testx"
. "github.com/riverqueue/river"
. "github.com/smartystreets/goconvey/convey"

View File

@@ -1,54 +1,3 @@
module {{.ModuleName}}
go 1.22.0
require (
github.com/ThreeDotsLabs/watermill v1.5.1
github.com/ThreeDotsLabs/watermill-kafka/v3 v3.1.1
github.com/ThreeDotsLabs/watermill-redisstream v1.4.4
github.com/ThreeDotsLabs/watermill-sql/v3 v3.1.0
github.com/gofiber/fiber/v3 v3.0.0-rc.1
github.com/gofiber/utils/v2 v2.0.0-rc.1
github.com/golang-jwt/jwt/v4 v4.5.2
github.com/imroc/req/v3 v3.55.0
github.com/jackc/pgx/v5 v5.7.6
github.com/juju/go4 v0.0.0-20160222163258-40d72ab9641a
github.com/lib/pq v1.10.9
github.com/opentracing/opentracing-go v1.2.0
github.com/pkg/errors v0.9.1
github.com/pressly/goose/v3 v3.25.0
github.com/redis/go-redis/v9 v9.13.0
github.com/riverqueue/river v0.24.0
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.24.0
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.24.0
github.com/riverqueue/river/rivertype v0.24.0
github.com/rogeecn/fabfile v1.7.0
github.com/rogeecn/swag v1.0.1
github.com/samber/lo v1.51.0
github.com/sirupsen/logrus v1.9.3
github.com/smartystreets/goconvey v1.8.1
github.com/soheilhy/cmux v0.1.5
github.com/speps/go-hashids/v2 v2.0.1
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
github.com/swaggo/files/v2 v2.0.2
github.com/uber/jaeger-client-go v2.30.0+incompatible
go.ipao.vip/atom v1.1.8
go.opentelemetry.io/contrib/instrumentation/runtime v0.63.0
go.opentelemetry.io/otel v1.38.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.38.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.38.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0
go.opentelemetry.io/otel/metric v1.38.0
go.opentelemetry.io/otel/sdk v1.38.0
go.opentelemetry.io/otel/sdk/metric v1.38.0
go.opentelemetry.io/otel/trace v1.38.0
go.uber.org/dig v1.19.0
golang.org/x/net v0.44.0
golang.org/x/sync v0.17.0
google.golang.org/grpc v1.75.0
google.golang.org/protobuf v1.36.9
gopkg.in/retry.v1 v1.0.3
)

View File

@@ -1,8 +1,8 @@
package main
import (
"{{.ModuleName}}/app/srv/http"
"{{.ModuleName}}/app/srv/migrate"
"{{.ModuleName}}/app/commands/http"
"{{.ModuleName}}/app/commands/migrate"
log "github.com/sirupsen/logrus"
"go.ipao.vip/atom"