feat 包命名规范

This commit is contained in:
2026-02-11 14:49:44 +08:00
parent fc9b32b115
commit 14cb2f3270
22 changed files with 137 additions and 135 deletions

View File

@@ -7,7 +7,7 @@ import (
"git.hlsq.asia/mmorpg/service-common/module"
"git.hlsq.asia/mmorpg/service-gateway/config"
"git.hlsq.asia/mmorpg/service-gateway/internal/global"
"git.hlsq.asia/mmorpg/service-gateway/internal/grpc_server"
"git.hlsq.asia/mmorpg/service-gateway/internal/grpcserver"
"github.com/judwhite/go-svc"
"sync"
)
@@ -23,7 +23,7 @@ func (p *Program) Init(_ svc.Environment) error {
p.moduleList = append(p.moduleList, &ModuleWebServer{})
p.moduleList = append(p.moduleList, &ModuleWebsocketServer{})
p.moduleList = append(p.moduleList, &ModuleLoginQueue{})
p.moduleList = append(p.moduleList, &module.Grpc{Server: grpc_server.NewServer(config.Get().Serve.Grpc)})
p.moduleList = append(p.moduleList, &module.Grpc{Server: grpcserver.NewServer(config.Get().Serve.Grpc)})
p.moduleList = append(p.moduleList, &module.Prometheus{Cfg: config.Get().Metric})
p.moduleList = append(p.moduleList, &module.Tracer{Cfg: config.Get().Metric, ServiceName: common.KeyDiscoverServiceNameGateway})
p.moduleList = append(p.moduleList, &module.Discover{})

View File

@@ -7,7 +7,7 @@ import (
"git.hlsq.asia/mmorpg/service-common/log"
"git.hlsq.asia/mmorpg/service-common/module"
"git.hlsq.asia/mmorpg/service-gateway/config"
"git.hlsq.asia/mmorpg/service-gateway/internal/net/http_gateway"
"git.hlsq.asia/mmorpg/service-gateway/internal/net/httpgateway"
"net/http"
"sync"
)
@@ -30,7 +30,7 @@ func (m *ModuleWebServer) Start(ready *sync.WaitGroup) error {
defer m.wg.Done()
m.server = &http.Server{
Addr: fmt.Sprintf("%v:%v", config.Get().Serve.Http.Address, config.Get().Serve.Http.Port),
Handler: http_gateway.InitRouter(),
Handler: httpgateway.InitRouter(),
}
ready.Done()
if err := m.server.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {

View File

@@ -6,7 +6,7 @@ import (
"git.hlsq.asia/mmorpg/service-common/module"
"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"
"git.hlsq.asia/mmorpg/service-gateway/internal/net/wsgateway"
"github.com/panjf2000/gnet/v2"
"sync"
"time"
@@ -22,7 +22,7 @@ type ModuleWebsocketServer struct {
func (m *ModuleWebsocketServer) Init() error {
m.wg = &sync.WaitGroup{}
m.server = websocket.NewWSServer(
&ws_gateway.GatewayWsServer{},
&wsgateway.GatewayWsServer{},
log.GetLogger().Named("ws_server"),
5*time.Second,
)