feat: add mongo

This commit is contained in:
王性驊 2024-12-24 19:04:03 +08:00
parent 299615b12a
commit 56cd661094
10 changed files with 10 additions and 6 deletions

View File

@ -1,10 +1,11 @@
package errs package errs
import ( import (
"code.30cm.net/digimon/library-go/errs/code"
"fmt" "fmt"
"github.com/zeromicro/go-zero/core/logx"
"strings" "strings"
"code.30cm.net/digimon/library-go/errs/code"
"github.com/zeromicro/go-zero/core/logx"
) )
type ErrorCode uint32 type ErrorCode uint32

View File

@ -4,7 +4,7 @@ use (
. .
./errs ./errs
./jwt ./jwt
./storage/mongo ./mongo
./utils/bitmap ./utils/bitmap
./utils/invited_code ./utils/invited_code
./validator ./validator

View File

@ -3,6 +3,7 @@ package mongo
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/zeromicro/go-zero/core/stores/cache" "github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/stores/mon" "github.com/zeromicro/go-zero/core/stores/mon"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"

View File

@ -4,15 +4,16 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"net/url"
"strings"
"time"
"github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/stores/mon" "github.com/zeromicro/go-zero/core/stores/mon"
"go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson"
"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"
"go.mongodb.org/mongo-driver/mongo/readpref" "go.mongodb.org/mongo-driver/mongo/readpref"
"net/url"
"strings"
"time"
) )
type DocumentDB struct { type DocumentDB struct {

View File

@ -2,6 +2,7 @@ package mongo
import ( import (
"context" "context"
"github.com/zeromicro/go-zero/core/stores/mon" "github.com/zeromicro/go-zero/core/stores/mon"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
mopt "go.mongodb.org/mongo-driver/mongo/options" mopt "go.mongodb.org/mongo-driver/mongo/options"