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