feature/init_member #1
|
@ -1,12 +1,13 @@
|
||||||
package middleware
|
package middleware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ers "code.30cm.net/digimon/library-go/errors"
|
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
ers "code.30cm.net/digimon/library-go/errors"
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTimeout = 30 * time.Second
|
const defaultTimeout = 30 * time.Second
|
||||||
|
|
|
@ -10,9 +10,10 @@
|
||||||
package lib
|
package lib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
required "code.30cm.net/digimon/library-go/validator"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
|
|
||||||
|
required "code.30cm.net/digimon/library-go/validator"
|
||||||
|
|
||||||
gomock "go.uber.org/mock/gomock"
|
gomock "go.uber.org/mock/gomock"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"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/sqlx"
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,10 +2,11 @@ package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
"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/options"
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ AutoIdModel = (*customAutoIdModel)(nil)
|
var _ AutoIdModel = (*customAutoIdModel)(nil)
|
||||||
|
|
|
@ -5,11 +5,12 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/stores/cache"
|
"github.com/zeromicro/go-zero/core/stores/cache"
|
||||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ UserTableModel = (*customUserTableModel)(nil)
|
var _ UserTableModel = (*customUserTableModel)(nil)
|
||||||
|
@ -115,8 +116,6 @@ func (m *defaultUserTableModel) ListMembers(ctx context.Context, params *UserQue
|
||||||
args = append(args, params.PageSize, offset)
|
args = append(args, params.PageSize, offset)
|
||||||
|
|
||||||
var users []*UserTable
|
var users []*UserTable
|
||||||
fmt.Println("query:", query)
|
|
||||||
fmt.Println("args:", args)
|
|
||||||
err := m.QueryRowsNoCacheCtx(ctx, &users, query, args...)
|
err := m.QueryRowsNoCacheCtx(ctx, &users, query, args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -7,9 +7,10 @@ import (
|
||||||
"app-cloudep-member-server/internal/model"
|
"app-cloudep-member-server/internal/model"
|
||||||
mgo "app-cloudep-member-server/internal/model/mongo"
|
mgo "app-cloudep-member-server/internal/model/mongo"
|
||||||
"app-cloudep-member-server/internal/usecase"
|
"app-cloudep-member-server/internal/usecase"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
ers "code.30cm.net/digimon/library-go/errors"
|
ers "code.30cm.net/digimon/library-go/errors"
|
||||||
vi "code.30cm.net/digimon/library-go/validator"
|
vi "code.30cm.net/digimon/library-go/validator"
|
||||||
"fmt"
|
|
||||||
"github.com/zeromicro/go-zero/core/stores/redis"
|
"github.com/zeromicro/go-zero/core/stores/redis"
|
||||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,7 +2,8 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
|
||||||
"app-cloudep-member-server/gen_result/pb/member"
|
"app-cloudep-member-server/gen_result/pb/member"
|
||||||
"app-cloudep-member-server/internal/config"
|
"app-cloudep-member-server/internal/config"
|
||||||
|
@ -34,6 +35,6 @@ func main() {
|
||||||
})
|
})
|
||||||
defer s.Stop()
|
defer s.Stop()
|
||||||
|
|
||||||
fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
|
logx.Info("Starting rpc server at %s...\n", c.ListenOn)
|
||||||
s.Start()
|
s.Start()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue