feat 修改model名称
This commit is contained in:
10
db/db.go
10
db/db.go
@@ -1,11 +1,11 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"common/config"
|
||||
"common/db/etcd"
|
||||
"common/db/mysql"
|
||||
"common/db/redis"
|
||||
"common/log"
|
||||
"git.hlsq.asia/mmorpg/service-common/config"
|
||||
"git.hlsq.asia/mmorpg/service-common/db/etcd"
|
||||
"git.hlsq.asia/mmorpg/service-common/db/mysql"
|
||||
"git.hlsq.asia/mmorpg/service-common/db/redis"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
)
|
||||
|
||||
// ModuleDB 数据库模块
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package etcd
|
||||
|
||||
import (
|
||||
"common/config"
|
||||
"context"
|
||||
"git.hlsq.asia/mmorpg/service-common/config"
|
||||
"go.etcd.io/etcd/client/v3"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package mongo
|
||||
|
||||
import (
|
||||
"common/config"
|
||||
"common/log"
|
||||
"context"
|
||||
"git.hlsq.asia/mmorpg/service-common/config"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package mysql
|
||||
|
||||
import (
|
||||
"common/config"
|
||||
"common/log"
|
||||
"git.hlsq.asia/mmorpg/service-common/config"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"common/config"
|
||||
"common/log"
|
||||
"context"
|
||||
"git.hlsq.asia/mmorpg/service-common/config"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"common/db/etcd"
|
||||
"common/log"
|
||||
"git.hlsq.asia/mmorpg/service-common/db/etcd"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package discover
|
||||
|
||||
import (
|
||||
"common/db/etcd"
|
||||
"common/discover/common"
|
||||
"common/log"
|
||||
"fmt"
|
||||
"git.hlsq.asia/mmorpg/service-common/db/etcd"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover/common"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package discover
|
||||
|
||||
import (
|
||||
"common/db/etcd"
|
||||
"common/discover/common"
|
||||
"common/log"
|
||||
"common/utils"
|
||||
"context"
|
||||
"fmt"
|
||||
"git.hlsq.asia/mmorpg/service-common/db/etcd"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover/common"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"git.hlsq.asia/mmorpg/service-common/utils"
|
||||
"go.etcd.io/etcd/api/v3/mvccpb"
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
"strconv"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package discover
|
||||
|
||||
import (
|
||||
"common/db/etcd"
|
||||
"common/discover/common"
|
||||
"common/log"
|
||||
"common/net/grpc/grpc_conn"
|
||||
"fmt"
|
||||
"git.hlsq.asia/mmorpg/service-common/db/etcd"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover/common"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"git.hlsq.asia/mmorpg/service-common/net/grpc/grpc_conn"
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
"google.golang.org/grpc"
|
||||
"sync"
|
||||
|
||||
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
||||
module common
|
||||
module git.hlsq.asia/mmorpg/service-common
|
||||
|
||||
go 1.23.1
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package grpc_conn
|
||||
|
||||
import (
|
||||
"common/log"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/keepalive"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package grpc_conn
|
||||
|
||||
import (
|
||||
"common/log"
|
||||
"fmt"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"google.golang.org/grpc"
|
||||
"math/rand"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package resolver
|
||||
|
||||
import (
|
||||
"common/log"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/keepalive"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package resolver
|
||||
|
||||
import (
|
||||
"common/db/etcd"
|
||||
"common/discover/common"
|
||||
"common/log"
|
||||
"context"
|
||||
"git.hlsq.asia/mmorpg/service-common/db/etcd"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover/common"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"go.etcd.io/etcd/client/v3"
|
||||
"google.golang.org/grpc/resolver"
|
||||
"strings"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"common/discover"
|
||||
"common/discover/common"
|
||||
"common/proto/ss/grpc_pb"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover/common"
|
||||
"git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb"
|
||||
)
|
||||
|
||||
func GatewayNewClient(sid ...int64) (grpc_pb.GatewayClient, error) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"common/discover"
|
||||
"common/discover/common"
|
||||
"common/net/grpc/resolver"
|
||||
"common/proto/ss/grpc_pb"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover/common"
|
||||
"git.hlsq.asia/mmorpg/service-common/net/grpc/resolver"
|
||||
"git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb"
|
||||
)
|
||||
|
||||
func SceneNewClient(sid ...int64) (grpc_pb.SceneClient, error) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"common/discover"
|
||||
"common/discover/common"
|
||||
"common/net/grpc/resolver"
|
||||
"common/proto/ss/grpc_pb"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover/common"
|
||||
"git.hlsq.asia/mmorpg/service-common/net/grpc/resolver"
|
||||
"git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb"
|
||||
)
|
||||
|
||||
func UserNewClient(sid ...int64) (grpc_pb.UserClient, error) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"common/discover"
|
||||
"common/log"
|
||||
"common/utils"
|
||||
"context"
|
||||
"fmt"
|
||||
"git.hlsq.asia/mmorpg/service-common/discover"
|
||||
"git.hlsq.asia/mmorpg/service-common/log"
|
||||
"git.hlsq.asia/mmorpg/service-common/utils"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/keepalive"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package http_resp
|
||||
|
||||
import (
|
||||
"common/proto/ss/ss_common"
|
||||
"git.hlsq.asia/mmorpg/service-common/proto/ss/ss_common"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
@@ -2,8 +2,8 @@ package websocket
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"common/net/socket"
|
||||
"context"
|
||||
"git.hlsq.asia/mmorpg/service-common/net/socket"
|
||||
"github.com/panjf2000/gnet/v2"
|
||||
"github.com/panjf2000/gnet/v2/pkg/logging"
|
||||
"sync"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package sc_pb
|
||||
|
||||
import (
|
||||
_ "common/proto/sc/sc_common"
|
||||
_ "git.hlsq.asia/mmorpg/service-common/proto/sc/sc_common"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package sc_pb
|
||||
|
||||
import (
|
||||
_ "common/proto/sc/sc_common"
|
||||
_ "git.hlsq.asia/mmorpg/service-common/proto/sc/sc_common"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package sc_pb
|
||||
|
||||
import (
|
||||
_ "common/proto/sc/sc_common"
|
||||
_ "git.hlsq.asia/mmorpg/service-common/proto/sc/sc_common"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
grpc_pb "common/proto/ss/grpc_pb"
|
||||
context "context"
|
||||
grpc_pb "git.hlsq.asia/mmorpg/service-common/proto/ss/grpc_pb"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package grpc_pb
|
||||
|
||||
import (
|
||||
_ "common/proto/ss/ss_common"
|
||||
_ "git.hlsq.asia/mmorpg/service-common/proto/ss/ss_common"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package grpc_pb
|
||||
|
||||
import (
|
||||
_ "common/proto/ss/ss_common"
|
||||
_ "git.hlsq.asia/mmorpg/service-common/proto/ss/ss_common"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package grpc_pb
|
||||
|
||||
import (
|
||||
_ "common/proto/ss/ss_common"
|
||||
_ "git.hlsq.asia/mmorpg/service-common/proto/ss/ss_common"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
|
||||
@@ -2,8 +2,8 @@ package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"common/net/http/http_resp"
|
||||
"encoding/json"
|
||||
"git.hlsq.asia/mmorpg/service-common/net/http/http_resp"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/suite"
|
||||
"net/http/httptest"
|
||||
|
||||
Reference in New Issue
Block a user