diff --git a/app/app.go b/app/app.go index 7d953c2..2b62bbb 100644 --- a/app/app.go +++ b/app/app.go @@ -1,10 +1,10 @@ package app import ( - "common/discover" - "common/log" "fmt" - "gateway/config" + "git.hlsq.asia/mmorpg/service-common/discover" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-gateway/config" "github.com/judwhite/go-svc" ) diff --git a/app/base.go b/app/base.go index c59624f..4a110c7 100644 --- a/app/base.go +++ b/app/base.go @@ -1,9 +1,9 @@ package app import ( - "common/log" - "common/utils" - "gateway/config" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-common/utils" + "git.hlsq.asia/mmorpg/service-gateway/config" "math/rand" ) diff --git a/app/db.go b/app/db.go index 9cf44ca..e762ebc 100644 --- a/app/db.go +++ b/app/db.go @@ -1,8 +1,8 @@ package app import ( - "common/db" - "gateway/config" + "git.hlsq.asia/mmorpg/service-common/db" + "git.hlsq.asia/mmorpg/service-gateway/config" ) // ModuleDB 数据库模块 diff --git a/app/grpc.go b/app/grpc.go index 2a08f80..77ed571 100644 --- a/app/grpc.go +++ b/app/grpc.go @@ -1,9 +1,9 @@ package app import ( - "common/net/grpc/service" - "gateway/config" - "gateway/internal/grpc_server/server" + "git.hlsq.asia/mmorpg/service-common/net/grpc/service" + "git.hlsq.asia/mmorpg/service-gateway/config" + "git.hlsq.asia/mmorpg/service-gateway/internal/grpc_server/server" ) // ModuleGrpcServer Grpc服务模块 diff --git a/app/login_queue.go b/app/login_queue.go index 22559df..7c098c9 100644 --- a/app/login_queue.go +++ b/app/login_queue.go @@ -1,8 +1,8 @@ package app import ( - "gateway/internal/global" - "gateway/internal/handler/ws_handler/login" + "git.hlsq.asia/mmorpg/service-gateway/internal/global" + "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/login" "runtime" ) diff --git a/app/prometheus.go b/app/prometheus.go index f864925..b024985 100644 --- a/app/prometheus.go +++ b/app/prometheus.go @@ -1,11 +1,11 @@ package app import ( - "common/log" "context" "errors" "fmt" - "gateway/config" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-gateway/config" "github.com/prometheus/client_golang/prometheus/promhttp" "net/http" "sync" diff --git a/app/web.go b/app/web.go index 1ea66de..6430a9a 100644 --- a/app/web.go +++ b/app/web.go @@ -1,12 +1,12 @@ package app import ( - "common/log" "context" "errors" "fmt" - "gateway/config" - "gateway/internal/net/http_gateway" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-gateway/config" + "git.hlsq.asia/mmorpg/service-gateway/internal/net/http_gateway" "net/http" "sync" ) diff --git a/app/websocket.go b/app/websocket.go index e82f012..ef4eebc 100644 --- a/app/websocket.go +++ b/app/websocket.go @@ -1,11 +1,11 @@ package app import ( - "common/log" - "common/net/socket/websocket" "fmt" - "gateway/config" - "gateway/internal/net/ws_gateway" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-common/net/socket/websocket" + "git.hlsq.asia/mmorpg/service-gateway/config" + "git.hlsq.asia/mmorpg/service-gateway/internal/net/ws_gateway" "github.com/panjf2000/gnet/v2" "sync" "time" diff --git a/config/config.go b/config/config.go index e5167f2..efd145d 100644 --- a/config/config.go +++ b/config/config.go @@ -1,6 +1,6 @@ package config -import "common/config" +import "git.hlsq.asia/mmorpg/service-common/config" const path = "./config" diff --git a/go.mod b/go.mod index 7b9486d..1f86e9a 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ -module gateway +module git.hlsq.asia/mmorpg/service-gateway go 1.23.1 require ( bou.ke/monkey v1.0.2 - common v0.0.0-00010101000000-000000000000 + git.hlsq.asia/mmorpg/service-common v0.0.0-20260107061047-e02e56781e78 github.com/alicebob/miniredis/v2 v2.35.0 github.com/gin-contrib/cors v1.7.6 github.com/gin-gonic/gin v1.11.0 @@ -99,5 +99,3 @@ require ( gorm.io/driver/mysql v1.6.0 // indirect gorm.io/gorm v1.31.1 // indirect ) - -replace common => ../common diff --git a/go.sum b/go.sum index f0883d3..1e7885d 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI= bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +git.hlsq.asia/mmorpg/service-common v0.0.0-20260107061047-e02e56781e78 h1:4CP8w5jHDOdN7hym8YrtioxNDd7PS2WcZDrO6dtY344= +git.hlsq.asia/mmorpg/service-common v0.0.0-20260107061047-e02e56781e78/go.mod h1:xv6m1I2jUA6mudKVznygpnzMoshBQarthHD1QnkW4qc= github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0= github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/alicebob/miniredis/v2 v2.35.0 h1:QwLphYqCEAo1eu1TqPRN2jgVMPBweeQcR21jeqDCONI= diff --git a/internal/grpc_server/server/server.go b/internal/grpc_server/server/server.go index f908800..7e93252 100644 --- a/internal/grpc_server/server/server.go +++ b/internal/grpc_server/server/server.go @@ -1,11 +1,11 @@ package server import ( - "common/log" - "common/proto/sc/sc_pb" - "common/proto/ss/grpc_pb" "context" - "gateway/internal/handler/ws_handler/client" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-common/proto/sc/sc_pb" + "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb" + "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/client" "google.golang.org/protobuf/proto" "sync" ) diff --git a/internal/grpc_server/server/server_init.go b/internal/grpc_server/server/server_init.go index 5f51097..1372d8c 100644 --- a/internal/grpc_server/server/server_init.go +++ b/internal/grpc_server/server/server_init.go @@ -1,10 +1,10 @@ package server import ( - "common/discover/common" - "common/net/grpc/service" - "common/proto/ss/grpc_pb" - "gateway/internal/handler/ws_handler/client" + "git.hlsq.asia/mmorpg/service-common/discover/common" + "git.hlsq.asia/mmorpg/service-common/net/grpc/service" + "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb" + "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/client" "google.golang.org/grpc" ) diff --git a/internal/grpc_server/stream_client/scene.go b/internal/grpc_server/stream_client/scene.go index 3db503a..dda305a 100644 --- a/internal/grpc_server/stream_client/scene.go +++ b/internal/grpc_server/stream_client/scene.go @@ -1,9 +1,9 @@ package stream_client import ( - "common/log" - "common/net/grpc/service" "context" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-common/net/grpc/service" "google.golang.org/grpc" "google.golang.org/protobuf/proto" "strconv" diff --git a/internal/grpc_server/stream_client/scene_test.go b/internal/grpc_server/stream_client/scene_test.go index 136cf41..78c6c78 100644 --- a/internal/grpc_server/stream_client/scene_test.go +++ b/internal/grpc_server/stream_client/scene_test.go @@ -1,7 +1,7 @@ package stream_client import ( - "gateway/internal/testutil" + "git.hlsq.asia/mmorpg/service-gateway/internal/testutil" "github.com/stretchr/testify/suite" "testing" ) diff --git a/internal/handler/http_handler/login.go b/internal/handler/http_handler/login.go index cd94807..7310da2 100644 --- a/internal/handler/http_handler/login.go +++ b/internal/handler/http_handler/login.go @@ -1,16 +1,16 @@ package http_handler import ( - "common/db/redis" - "common/log" - "common/net/grpc/service" - "common/net/http/http_resp" - "common/proto/ss/grpc_pb" - "common/utils" "context" "fmt" - "gateway/config" - "gateway/internal/global" + "git.hlsq.asia/mmorpg/service-common/db/redis" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-common/net/grpc/service" + "git.hlsq.asia/mmorpg/service-common/net/http/http_resp" + "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb" + "git.hlsq.asia/mmorpg/service-common/utils" + "git.hlsq.asia/mmorpg/service-gateway/config" + "git.hlsq.asia/mmorpg/service-gateway/internal/global" "github.com/gin-gonic/gin" "time" ) diff --git a/internal/handler/http_handler/login_test.go b/internal/handler/http_handler/login_test.go index b300764..6e2a9f1 100644 --- a/internal/handler/http_handler/login_test.go +++ b/internal/handler/http_handler/login_test.go @@ -2,16 +2,16 @@ package http_handler import ( "bou.ke/monkey" - "common/db/redis" - "common/net/grpc/service" - "common/net/http/http_resp" - "common/proto/ss/grpc_pb" - "common/proto/ss/grpc_pb/mocks" - "common/utils" "context" "fmt" - "gateway/internal/global" - "gateway/internal/testutil" + "git.hlsq.asia/mmorpg/service-common/db/redis" + "git.hlsq.asia/mmorpg/service-common/net/grpc/service" + "git.hlsq.asia/mmorpg/service-common/net/http/http_resp" + "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb" + "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb/mocks" + "git.hlsq.asia/mmorpg/service-common/utils" + "git.hlsq.asia/mmorpg/service-gateway/internal/global" + "git.hlsq.asia/mmorpg/service-gateway/internal/testutil" "github.com/gin-gonic/gin" "github.com/golang/mock/gomock" redis2 "github.com/redis/go-redis/v9" diff --git a/internal/handler/ws_handler/client/client.go b/internal/handler/ws_handler/client/client.go index 736fcee..f9f73fc 100644 --- a/internal/handler/ws_handler/client/client.go +++ b/internal/handler/ws_handler/client/client.go @@ -1,10 +1,10 @@ package client import ( - "common/log" - "common/net/socket" "context" "fmt" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-common/net/socket" "go.uber.org/zap" "runtime/debug" "sync" diff --git a/internal/handler/ws_handler/client/client_handler.go b/internal/handler/ws_handler/client/client_handler.go index 5e8c339..5c156a0 100644 --- a/internal/handler/ws_handler/client/client_handler.go +++ b/internal/handler/ws_handler/client/client_handler.go @@ -1,10 +1,10 @@ package client import ( - "common/net/grpc/service" - "common/proto/sc/sc_pb" - "common/proto/ss/grpc_pb" - "gateway/internal/grpc_server/stream_client" + "git.hlsq.asia/mmorpg/service-common/net/grpc/service" + "git.hlsq.asia/mmorpg/service-common/proto/sc/sc_pb" + "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb" + "git.hlsq.asia/mmorpg/service-gateway/internal/grpc_server/stream_client" "google.golang.org/protobuf/proto" "time" ) diff --git a/internal/handler/ws_handler/client/client_write.go b/internal/handler/ws_handler/client/client_write.go index ccd7f80..de6563d 100644 --- a/internal/handler/ws_handler/client/client_write.go +++ b/internal/handler/ws_handler/client/client_write.go @@ -1,7 +1,7 @@ package client import ( - "common/proto/sc/sc_pb" + "git.hlsq.asia/mmorpg/service-common/proto/sc/sc_pb" "google.golang.org/protobuf/proto" ) diff --git a/internal/handler/ws_handler/login/login.go b/internal/handler/ws_handler/login/login.go index 3010ba0..15dc46e 100644 --- a/internal/handler/ws_handler/login/login.go +++ b/internal/handler/ws_handler/login/login.go @@ -1,15 +1,15 @@ package login import ( - "common/db/redis" - "common/log" - "common/net/grpc/service" - "common/proto/sc/sc_pb" - "common/proto/ss/grpc_pb" "context" "fmt" - "gateway/internal/global" - "gateway/internal/handler/ws_handler/client" + "git.hlsq.asia/mmorpg/service-common/db/redis" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-common/net/grpc/service" + "git.hlsq.asia/mmorpg/service-common/proto/sc/sc_pb" + "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb" + "git.hlsq.asia/mmorpg/service-gateway/internal/global" + "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/client" "sync" "time" ) diff --git a/internal/handler/ws_handler/login/queue_up.go b/internal/handler/ws_handler/login/queue_up.go index e482f9d..e715ad1 100644 --- a/internal/handler/ws_handler/login/queue_up.go +++ b/internal/handler/ws_handler/login/queue_up.go @@ -3,7 +3,7 @@ package login import ( "context" "errors" - "gateway/internal/handler/ws_handler/client" + "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/client" "sync" "sync/atomic" ) diff --git a/internal/net/http_gateway/middleward.go b/internal/net/http_gateway/middleward.go index 095d233..8023040 100644 --- a/internal/net/http_gateway/middleward.go +++ b/internal/net/http_gateway/middleward.go @@ -1,11 +1,11 @@ package http_gateway import ( - "common/net/http/http_resp" - "common/utils" "fmt" - "gateway/config" - "gateway/internal/global" + "git.hlsq.asia/mmorpg/service-common/net/http/http_resp" + "git.hlsq.asia/mmorpg/service-common/utils" + "git.hlsq.asia/mmorpg/service-gateway/config" + "git.hlsq.asia/mmorpg/service-gateway/internal/global" "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" "go.uber.org/zap" diff --git a/internal/net/http_gateway/router.go b/internal/net/http_gateway/router.go index c7181dd..13547ff 100644 --- a/internal/net/http_gateway/router.go +++ b/internal/net/http_gateway/router.go @@ -1,13 +1,13 @@ package http_gateway import ( - "common/log" - "common/net/grpc/service" - "common/net/http/http_resp" - "common/proto/ss/grpc_pb" "context" - "gateway/internal/handler/http_handler" - "gateway/internal/net/http_gateway/wrapper" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-common/net/grpc/service" + "git.hlsq.asia/mmorpg/service-common/net/http/http_resp" + "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb" + "git.hlsq.asia/mmorpg/service-gateway/internal/handler/http_handler" + "git.hlsq.asia/mmorpg/service-gateway/internal/net/http_gateway/wrapper" "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" diff --git a/internal/net/http_gateway/wrapper/error_handler.go b/internal/net/http_gateway/wrapper/error_handler.go index a89b508..42f30f8 100644 --- a/internal/net/http_gateway/wrapper/error_handler.go +++ b/internal/net/http_gateway/wrapper/error_handler.go @@ -1,10 +1,10 @@ package wrapper import ( - "common/net/http/http_resp" - "common/proto/ss/ss_common" "context" "encoding/json" + "git.hlsq.asia/mmorpg/service-common/net/http/http_resp" + "git.hlsq.asia/mmorpg/service-common/proto/ss/ss_common" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/internal/net/http_gateway/wrapper/marshal.go b/internal/net/http_gateway/wrapper/marshal.go index 18782d0..28b947d 100644 --- a/internal/net/http_gateway/wrapper/marshal.go +++ b/internal/net/http_gateway/wrapper/marshal.go @@ -1,8 +1,8 @@ package wrapper import ( - "common/net/http/http_resp" "encoding/json" + "git.hlsq.asia/mmorpg/service-common/net/http/http_resp" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "io" ) diff --git a/internal/net/ws_gateway/server.go b/internal/net/ws_gateway/server.go index 0d8ddde..774c4d6 100644 --- a/internal/net/ws_gateway/server.go +++ b/internal/net/ws_gateway/server.go @@ -1,13 +1,13 @@ package ws_gateway import ( - "common/log" - "common/net/socket" - "common/utils" "fmt" - "gateway/config" - "gateway/internal/handler/ws_handler/client" - "gateway/internal/handler/ws_handler/login" + "git.hlsq.asia/mmorpg/service-common/log" + "git.hlsq.asia/mmorpg/service-common/net/socket" + "git.hlsq.asia/mmorpg/service-common/utils" + "git.hlsq.asia/mmorpg/service-gateway/config" + "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/client" + "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/login" "go.uber.org/zap" "time" ) diff --git a/internal/testutil/suite.go b/internal/testutil/suite.go index 43505c6..8d0f132 100644 --- a/internal/testutil/suite.go +++ b/internal/testutil/suite.go @@ -1,9 +1,9 @@ package testutil import ( - config2 "common/config" - "common/db/redis" - "gateway/config" + config2 "git.hlsq.asia/mmorpg/service-common/config" + "git.hlsq.asia/mmorpg/service-common/db/redis" + "git.hlsq.asia/mmorpg/service-gateway/config" "github.com/alicebob/miniredis/v2" "github.com/stretchr/testify/suite" ) diff --git a/main.go b/main.go index 44b42fd..626d6fe 100644 --- a/main.go +++ b/main.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "gateway/app" + "git.hlsq.asia/mmorpg/service-gateway/app" "github.com/judwhite/go-svc" "syscall" )