feat 修改model名称

This commit is contained in:
2026-01-07 15:15:25 +08:00
parent 46839cd11b
commit a4f40eca2f
29 changed files with 92 additions and 92 deletions

View File

@@ -1,10 +1,10 @@
package app package app
import ( import (
"common/discover"
"common/log"
"fmt" "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" "github.com/judwhite/go-svc"
) )

View File

@@ -1,9 +1,9 @@
package app package app
import ( import (
"common/log" "git.hlsq.asia/mmorpg/service-common/log"
"common/utils" "git.hlsq.asia/mmorpg/service-common/utils"
"gateway/config" "git.hlsq.asia/mmorpg/service-gateway/config"
"math/rand" "math/rand"
) )

View File

@@ -1,8 +1,8 @@
package app package app
import ( import (
"common/db" "git.hlsq.asia/mmorpg/service-common/db"
"gateway/config" "git.hlsq.asia/mmorpg/service-gateway/config"
) )
// ModuleDB 数据库模块 // ModuleDB 数据库模块

View File

@@ -1,9 +1,9 @@
package app package app
import ( import (
"common/net/grpc/service" "git.hlsq.asia/mmorpg/service-common/net/grpc/service"
"gateway/config" "git.hlsq.asia/mmorpg/service-gateway/config"
"gateway/internal/grpc_server/server" "git.hlsq.asia/mmorpg/service-gateway/internal/grpc_server/server"
) )
// ModuleGrpcServer Grpc服务模块 // ModuleGrpcServer Grpc服务模块

View File

@@ -1,8 +1,8 @@
package app package app
import ( import (
"gateway/internal/global" "git.hlsq.asia/mmorpg/service-gateway/internal/global"
"gateway/internal/handler/ws_handler/login" "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/login"
"runtime" "runtime"
) )

View File

@@ -1,11 +1,11 @@
package app package app
import ( import (
"common/log"
"context" "context"
"errors" "errors"
"fmt" "fmt"
"gateway/config" "git.hlsq.asia/mmorpg/service-common/log"
"git.hlsq.asia/mmorpg/service-gateway/config"
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
"net/http" "net/http"
"sync" "sync"

View File

@@ -1,12 +1,12 @@
package app package app
import ( import (
"common/log"
"context" "context"
"errors" "errors"
"fmt" "fmt"
"gateway/config" "git.hlsq.asia/mmorpg/service-common/log"
"gateway/internal/net/http_gateway" "git.hlsq.asia/mmorpg/service-gateway/config"
"git.hlsq.asia/mmorpg/service-gateway/internal/net/http_gateway"
"net/http" "net/http"
"sync" "sync"
) )

View File

@@ -1,11 +1,11 @@
package app package app
import ( import (
"common/log"
"common/net/socket/websocket"
"fmt" "fmt"
"gateway/config" "git.hlsq.asia/mmorpg/service-common/log"
"gateway/internal/net/ws_gateway" "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" "github.com/panjf2000/gnet/v2"
"sync" "sync"
"time" "time"

View File

@@ -1,6 +1,6 @@
package config package config
import "common/config" import "git.hlsq.asia/mmorpg/service-common/config"
const path = "./config" const path = "./config"

6
go.mod
View File

@@ -1,10 +1,10 @@
module gateway module git.hlsq.asia/mmorpg/service-gateway
go 1.23.1 go 1.23.1
require ( require (
bou.ke/monkey v1.0.2 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/alicebob/miniredis/v2 v2.35.0
github.com/gin-contrib/cors v1.7.6 github.com/gin-contrib/cors v1.7.6
github.com/gin-gonic/gin v1.11.0 github.com/gin-gonic/gin v1.11.0
@@ -99,5 +99,3 @@ require (
gorm.io/driver/mysql v1.6.0 // indirect gorm.io/driver/mysql v1.6.0 // indirect
gorm.io/gorm v1.31.1 // indirect gorm.io/gorm v1.31.1 // indirect
) )
replace common => ../common

2
go.sum
View File

@@ -2,6 +2,8 @@ bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI=
bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA= 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 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/alicebob/miniredis/v2 v2.35.0 h1:QwLphYqCEAo1eu1TqPRN2jgVMPBweeQcR21jeqDCONI= github.com/alicebob/miniredis/v2 v2.35.0 h1:QwLphYqCEAo1eu1TqPRN2jgVMPBweeQcR21jeqDCONI=

View File

@@ -1,11 +1,11 @@
package server package server
import ( import (
"common/log"
"common/proto/sc/sc_pb"
"common/proto/ss/grpc_pb"
"context" "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" "google.golang.org/protobuf/proto"
"sync" "sync"
) )

View File

@@ -1,10 +1,10 @@
package server package server
import ( import (
"common/discover/common" "git.hlsq.asia/mmorpg/service-common/discover/common"
"common/net/grpc/service" "git.hlsq.asia/mmorpg/service-common/net/grpc/service"
"common/proto/ss/grpc_pb" "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb"
"gateway/internal/handler/ws_handler/client" "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/client"
"google.golang.org/grpc" "google.golang.org/grpc"
) )

View File

@@ -1,9 +1,9 @@
package stream_client package stream_client
import ( import (
"common/log"
"common/net/grpc/service"
"context" "context"
"git.hlsq.asia/mmorpg/service-common/log"
"git.hlsq.asia/mmorpg/service-common/net/grpc/service"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
"strconv" "strconv"

View File

@@ -1,7 +1,7 @@
package stream_client package stream_client
import ( import (
"gateway/internal/testutil" "git.hlsq.asia/mmorpg/service-gateway/internal/testutil"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
"testing" "testing"
) )

View File

@@ -1,16 +1,16 @@
package http_handler package http_handler
import ( import (
"common/db/redis"
"common/log"
"common/net/grpc/service"
"common/net/http/http_resp"
"common/proto/ss/grpc_pb"
"common/utils"
"context" "context"
"fmt" "fmt"
"gateway/config" "git.hlsq.asia/mmorpg/service-common/db/redis"
"gateway/internal/global" "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" "github.com/gin-gonic/gin"
"time" "time"
) )

View File

@@ -2,16 +2,16 @@ package http_handler
import ( import (
"bou.ke/monkey" "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" "context"
"fmt" "fmt"
"gateway/internal/global" "git.hlsq.asia/mmorpg/service-common/db/redis"
"gateway/internal/testutil" "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/gin-gonic/gin"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
redis2 "github.com/redis/go-redis/v9" redis2 "github.com/redis/go-redis/v9"

View File

@@ -1,10 +1,10 @@
package client package client
import ( import (
"common/log"
"common/net/socket"
"context" "context"
"fmt" "fmt"
"git.hlsq.asia/mmorpg/service-common/log"
"git.hlsq.asia/mmorpg/service-common/net/socket"
"go.uber.org/zap" "go.uber.org/zap"
"runtime/debug" "runtime/debug"
"sync" "sync"

View File

@@ -1,10 +1,10 @@
package client package client
import ( import (
"common/net/grpc/service" "git.hlsq.asia/mmorpg/service-common/net/grpc/service"
"common/proto/sc/sc_pb" "git.hlsq.asia/mmorpg/service-common/proto/sc/sc_pb"
"common/proto/ss/grpc_pb" "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb"
"gateway/internal/grpc_server/stream_client" "git.hlsq.asia/mmorpg/service-gateway/internal/grpc_server/stream_client"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
"time" "time"
) )

View File

@@ -1,7 +1,7 @@
package client package client
import ( import (
"common/proto/sc/sc_pb" "git.hlsq.asia/mmorpg/service-common/proto/sc/sc_pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )

View File

@@ -1,15 +1,15 @@
package login package login
import ( import (
"common/db/redis"
"common/log"
"common/net/grpc/service"
"common/proto/sc/sc_pb"
"common/proto/ss/grpc_pb"
"context" "context"
"fmt" "fmt"
"gateway/internal/global" "git.hlsq.asia/mmorpg/service-common/db/redis"
"gateway/internal/handler/ws_handler/client" "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" "sync"
"time" "time"
) )

View File

@@ -3,7 +3,7 @@ package login
import ( import (
"context" "context"
"errors" "errors"
"gateway/internal/handler/ws_handler/client" "git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/client"
"sync" "sync"
"sync/atomic" "sync/atomic"
) )

View File

@@ -1,11 +1,11 @@
package http_gateway package http_gateway
import ( import (
"common/net/http/http_resp"
"common/utils"
"fmt" "fmt"
"gateway/config" "git.hlsq.asia/mmorpg/service-common/net/http/http_resp"
"gateway/internal/global" "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-contrib/cors"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"go.uber.org/zap" "go.uber.org/zap"

View File

@@ -1,13 +1,13 @@
package http_gateway package http_gateway
import ( import (
"common/log"
"common/net/grpc/service"
"common/net/http/http_resp"
"common/proto/ss/grpc_pb"
"context" "context"
"gateway/internal/handler/http_handler" "git.hlsq.asia/mmorpg/service-common/log"
"gateway/internal/net/http_gateway/wrapper" "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-contrib/cors"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"

View File

@@ -1,10 +1,10 @@
package wrapper package wrapper
import ( import (
"common/net/http/http_resp"
"common/proto/ss/ss_common"
"context" "context"
"encoding/json" "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" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"

View File

@@ -1,8 +1,8 @@
package wrapper package wrapper
import ( import (
"common/net/http/http_resp"
"encoding/json" "encoding/json"
"git.hlsq.asia/mmorpg/service-common/net/http/http_resp"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"io" "io"
) )

View File

@@ -1,13 +1,13 @@
package ws_gateway package ws_gateway
import ( import (
"common/log"
"common/net/socket"
"common/utils"
"fmt" "fmt"
"gateway/config" "git.hlsq.asia/mmorpg/service-common/log"
"gateway/internal/handler/ws_handler/client" "git.hlsq.asia/mmorpg/service-common/net/socket"
"gateway/internal/handler/ws_handler/login" "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" "go.uber.org/zap"
"time" "time"
) )

View File

@@ -1,9 +1,9 @@
package testutil package testutil
import ( import (
config2 "common/config" config2 "git.hlsq.asia/mmorpg/service-common/config"
"common/db/redis" "git.hlsq.asia/mmorpg/service-common/db/redis"
"gateway/config" "git.hlsq.asia/mmorpg/service-gateway/config"
"github.com/alicebob/miniredis/v2" "github.com/alicebob/miniredis/v2"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
) )

View File

@@ -2,7 +2,7 @@ package main
import ( import (
"fmt" "fmt"
"gateway/app" "git.hlsq.asia/mmorpg/service-gateway/app"
"github.com/judwhite/go-svc" "github.com/judwhite/go-svc"
"syscall" "syscall"
) )