diff --git a/.gitignore b/.gitignore index 38f5885..7a67b59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ /.idea /data /output -etc \ No newline at end of file +<<<<<<< HEAD +etc +======= +>>>>>>> 1614d94c8a1344a30c74ad9847dc271f8381a8a4 diff --git a/biz/adaptor/server.go b/biz/adaptor/server.go index 828826d..b995177 100644 --- a/biz/adaptor/server.go +++ b/biz/adaptor/server.go @@ -12,6 +12,31 @@ type ContentServerImpl struct { FileService service.IFileService PostService service.IPostService LabelService service.ILabelService + UserService service.UserService +} + +func (s *ContentServerImpl) DeleteUser(ctx context.Context, req *content.DeleteUserReq) (resp *content.DeleteUserResp, err error) { + return s.UserService.DeleteUser(ctx, req) +} + +func (s *ContentServerImpl) UpdateUser(ctx context.Context, req *content.UpdateUserReq) (resp *content.UpdateUserResp, err error) { + return s.UserService.UpdateUser(ctx, req) +} + +func (s *ContentServerImpl) GetUser(ctx context.Context, req *content.GetUserReq) (resp *content.GetUserResp, err error) { + return s.UserService.GetUser(ctx, req) +} + +func (s *ContentServerImpl) SearchUser(ctx context.Context, req *content.SearchUserReq) (resp *content.SearchUserResp, err error) { + return s.UserService.SearchUser(ctx, req) +} + +func (s *ContentServerImpl) CreateUser(ctx context.Context, req *content.CreateUserReq) (resp *content.CreateUserResp, err error) { + return s.UserService.CreateUser(ctx, req) +} + +func (s *ContentServerImpl) GetUserDetail(ctx context.Context, req *content.GetUserDetailReq) (resp *content.GetUserDetailResp, err error) { + return s.UserService.GetUserDetail(ctx, req) } func (s *ContentServerImpl) GetFolderSize(ctx context.Context, req *content.GetFolderSizeReq) (*content.GetFolderSizeResp, error) { diff --git a/biz/application/service/user.go b/biz/application/service/user.go new file mode 100644 index 0000000..b0b778f --- /dev/null +++ b/biz/application/service/user.go @@ -0,0 +1,122 @@ +package service + +import ( + "context" + "github.com/CloudStriver/cloudmind-content/biz/infrastructure/config" + "github.com/CloudStriver/cloudmind-content/biz/infrastructure/consts" + "github.com/CloudStriver/cloudmind-content/biz/infrastructure/convertor" + usermapper "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/user" + "github.com/CloudStriver/go-pkg/utils/pagination/esp" + "github.com/CloudStriver/go-pkg/utils/pconvertor" + "github.com/CloudStriver/go-pkg/utils/util/log" + gencontent "github.com/CloudStriver/service-idl-gen-go/kitex_gen/cloudmind/content" + "github.com/google/wire" + "github.com/zeromicro/go-zero/core/stores/redis" + "go.mongodb.org/mongo-driver/bson/primitive" +) + +type UserService interface { + GetUser(ctx context.Context, req *gencontent.GetUserReq) (resp *gencontent.GetUserResp, err error) + CreateUser(ctx context.Context, req *gencontent.CreateUserReq) (resp *gencontent.CreateUserResp, err error) + UpdateUser(ctx context.Context, req *gencontent.UpdateUserReq) (resp *gencontent.UpdateUserResp, err error) + GetUserDetail(ctx context.Context, req *gencontent.GetUserDetailReq) (resp *gencontent.GetUserDetailResp, err error) + SearchUser(ctx context.Context, req *gencontent.SearchUserReq) (resp *gencontent.SearchUserResp, err error) + DeleteUser(ctx context.Context, req *gencontent.DeleteUserReq) (resp *gencontent.DeleteUserResp, err error) +} + +type UserServiceImpl struct { + Config *config.Config + UserMongoMapper usermapper.UserMongoMapper + UserEsMapper usermapper.UserEsMapper + Redis *redis.Redis +} + +var UserSet = wire.NewSet( + wire.Struct(new(UserServiceImpl), "*"), + wire.Bind(new(UserService), new(*UserServiceImpl)), +) + +func (s *UserServiceImpl) DeleteUser(ctx context.Context, req *gencontent.DeleteUserReq) (resp *gencontent.DeleteUserResp, err error) { + resp = new(gencontent.DeleteUserResp) + _, err = s.UserMongoMapper.Delete(ctx, req.UserId) + if err != nil { + log.CtxError(ctx, "删除用户信息异常[%v]\n", err) + return resp, err + } + return resp, nil +} + +func (s *UserServiceImpl) SearchUser(ctx context.Context, req *gencontent.SearchUserReq) (resp *gencontent.SearchUserResp, err error) { + resp = new(gencontent.SearchUserResp) + p := pconvertor.PaginationOptionsToModelPaginationOptions(req.PaginationOptions) + user, total, err := s.UserEsMapper.Search(ctx, req.Keyword, p, esp.ScoreCursorType) + if err != nil { + log.CtxError(ctx, "搜索用户信息异常[%v]\n", err) + return resp, err + } + + if p.LastToken != nil { + resp.LastToken = *p.LastToken + } + resp.Total = total + resp.Users = make([]*gencontent.User, 0, len(user)) + for _, u := range user { + resp.Users = append(resp.Users, convertor.UserMapperToUser(u)) + } + + return resp, nil +} + +func (s *UserServiceImpl) GetUserDetail(ctx context.Context, req *gencontent.GetUserDetailReq) (resp *gencontent.GetUserDetailResp, err error) { + resp = new(gencontent.GetUserDetailResp) + var user *usermapper.User + user, err = s.UserMongoMapper.FindOne(ctx, req.UserId) + if err != nil { + log.CtxError(ctx, "查询用户信息异常[%v]\n", err) + return resp, err + } + + resp.UserDetail = convertor.UserMapperToUserDetail(user) + return resp, nil +} + +func (s *UserServiceImpl) GetUser(ctx context.Context, req *gencontent.GetUserReq) (resp *gencontent.GetUserResp, err error) { + resp = new(gencontent.GetUserResp) + var user *usermapper.User + user, err = s.UserMongoMapper.FindOne(ctx, req.UserId) + if err != nil { + log.CtxError(ctx, "查询用户信息异常[%v]\n", err) + return resp, err + } + + resp.User = convertor.UserMapperToUser(user) + return resp, nil +} + +func (s *UserServiceImpl) CreateUser(ctx context.Context, req *gencontent.CreateUserReq) (resp *gencontent.CreateUserResp, err error) { + resp = new(gencontent.CreateUserResp) + ID, err := primitive.ObjectIDFromHex(req.UserInfo.UserId) + if err != nil { + return resp, consts.ErrInvalidObjectId + } + if _, err = s.UserMongoMapper.Insert(ctx, &usermapper.User{ + ID: ID, + Name: req.UserInfo.Name, + Sex: int32(req.UserInfo.Sex), + Description: consts.DefaultDescription, + Url: consts.DefaultAvatarUrl, + }); err != nil { + log.CtxError(ctx, "插入用户信息异常[%v]\n", err) + return resp, err + } + return resp, nil +} + +func (s *UserServiceImpl) UpdateUser(ctx context.Context, req *gencontent.UpdateUserReq) (resp *gencontent.UpdateUserResp, err error) { + resp = new(gencontent.UpdateUserResp) + if _, err = s.UserMongoMapper.Update(ctx, convertor.UserDetailToUserMapper(req.UserDetailInfo)); err != nil { + log.CtxError(ctx, "修改用户信息异常[%v]\n", err) + return resp, err + } + return resp, nil +} diff --git a/biz/infrastructure/consts/error.go b/biz/infrastructure/consts/error.go index d2af6c0..4364d78 100644 --- a/biz/infrastructure/consts/error.go +++ b/biz/infrastructure/consts/error.go @@ -1,6 +1,7 @@ package consts import ( + "errors" "google.golang.org/grpc/status" ) @@ -11,4 +12,10 @@ var ( ErrFileIsNotDir = status.Error(10104, "目标文件不是文件夹") ErrNotFound = status.Error(10105, "数据不存在") ErrInvalidDeleteType = status.Error(10106, "删除类型无效") + ErrDataBase = status.Error(10001, "数据库异常") + ErrEsMapper = status.Error(10002, "Es异常") +) + +var ( + ErrInvalidObjectId = errors.New("invalid objectId") ) diff --git a/biz/infrastructure/consts/field.go b/biz/infrastructure/consts/field.go index 7ca9799..999c263 100644 --- a/biz/infrastructure/consts/field.go +++ b/biz/infrastructure/consts/field.go @@ -1,18 +1,23 @@ package consts const ( - ID = "_id" - UserId = "userId" - Name = "name" - Type = "type" - Path = "path" - FatherId = "fatherId" - Size = "size" - FileMd5 = "fileMd5" - IsDel = "isDel" - Tag = "tag" - Description = "description" - CreateAt = "createAt" - UpdateAt = "updateAt" - DeletedAt = "deletedAt" + ID = "_id" + UserId = "userId" + Name = "name" + Type = "type" + Path = "path" + FatherId = "fatherId" + Size = "size" + FileMd5 = "fileMd5" + IsDel = "isDel" + Tag = "tag" + Description = "description" + CreateAt = "createAt" + UpdateAt = "updateAt" + DeletedAt = "deletedAt" + TargetId = "targetId" + TargetType = "targetType" + RelationType = "relationType" + DefaultAvatarUrl = "d2042520dce2223751906a11e547d43e.png" + DefaultDescription = "点击添加描述,让大家更好的了解你..." ) diff --git a/biz/infrastructure/convertor/convertor.go b/biz/infrastructure/convertor/convertor.go new file mode 100644 index 0000000..99e0668 --- /dev/null +++ b/biz/infrastructure/convertor/convertor.go @@ -0,0 +1,42 @@ +package convertor + +import ( + usermapper "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/user" + gencontent "github.com/CloudStriver/service-idl-gen-go/kitex_gen/cloudmind/content" + "go.mongodb.org/mongo-driver/bson/primitive" +) + +func UserMapperToUserDetail(in *usermapper.User) *gencontent.UserDetail { + return &gencontent.UserDetail{ + Name: in.Name, + Sex: in.Sex, + FullName: in.FullName, + IdCard: in.IdCard, + CreatedAt: in.CreateAt.UnixMilli(), + UpdatedAt: in.UpdateAt.UnixMilli(), + Description: in.Description, + Url: in.Url, + UserId: in.ID.Hex(), + } +} + +func UserDetailToUserMapper(in *gencontent.UserDetailInfo) *usermapper.User { + ID, _ := primitive.ObjectIDFromHex(in.UserId) + return &usermapper.User{ + ID: ID, + Name: in.Name, + Sex: int32(in.GetSex()), + FullName: in.FullName, + IdCard: in.IdCard, + Description: in.Description, + Url: in.Url, + } +} + +func UserMapperToUser(in *usermapper.User) *gencontent.User { + return &gencontent.User{ + UserId: in.ID.Hex(), + Name: in.Name, + Url: in.Url, + } +} diff --git a/biz/infrastructure/mapper/user/es.go b/biz/infrastructure/mapper/user/es.go new file mode 100644 index 0000000..e2bffd9 --- /dev/null +++ b/biz/infrastructure/mapper/user/es.go @@ -0,0 +1,112 @@ +package user + +import ( + "context" + "fmt" + "github.com/CloudStriver/cloudmind-content/biz/infrastructure/config" + "github.com/CloudStriver/cloudmind-content/biz/infrastructure/consts" + "github.com/CloudStriver/go-pkg/utils/pagination" + "github.com/CloudStriver/go-pkg/utils/pagination/esp" + "github.com/bytedance/sonic" + "github.com/elastic/go-elasticsearch/v8" + "github.com/elastic/go-elasticsearch/v8/typedapi/core/search" + "github.com/elastic/go-elasticsearch/v8/typedapi/types" + "github.com/mitchellh/mapstructure" + "github.com/samber/lo" + "github.com/zeromicro/go-zero/core/logx" + "go.mongodb.org/mongo-driver/bson/primitive" + "time" +) + +type ( + UserEsMapper interface { + Search(ctx context.Context, keyword string, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*User, int32, error) + } + + EsMapper struct { + es *elasticsearch.TypedClient + IndexName string + } +) + +func (e *EsMapper) Search(ctx context.Context, keyword string, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*User, int32, error) { + p := esp.NewEsPaginator(pagination.NewRawStore(sorter), popts) + s, sa, err := p.MakeSortOptions(ctx) + if err != nil { + return nil, 0, err + } + res, err := e.es.Search().Index(e.IndexName).Request(&search.Request{ + Query: &types.Query{ + Bool: &types.BoolQuery{ + Must: []types.Query{ + { + MultiMatch: &types.MultiMatchQuery{ + Fields: []string{consts.Name, consts.ID}, + Query: keyword, + }, + }, + }, + }, + }, + Sort: s, + SearchAfter: sa, + Size: lo.ToPtr(int(*popts.Limit)), + }).Do(ctx) + if err != nil { + logx.Errorf("es查询异常[%v]\n", err) + return nil, 0, err + } + + total := res.Hits.Total.Value + users := make([]*User, 0, len(res.Hits.Hits)) + for _, hit := range res.Hits.Hits { + user := &User{} + source := make(map[string]any) + err = sonic.Unmarshal(hit.Source_, &source) + if err != nil { + return nil, 0, err + } + if source[consts.CreateAt], err = time.Parse("2006-01-02T15:04:05Z07:00", source[consts.CreateAt].(string)); err != nil { + return nil, 0, err + } + if source[consts.UpdateAt], err = time.Parse("2006-01-02T15:04:05Z07:00", source[consts.UpdateAt].(string)); err != nil { + return nil, 0, err + } + err = mapstructure.Decode(source, user) + if err != nil { + return nil, 0, err + } + + oid := hit.Id_ + user.ID, err = primitive.ObjectIDFromHex(oid) + if err != nil { + return nil, 0, err + } + user.Score_ = float64(hit.Score_) + users = append(users, user) + } + + if *popts.Backward { + users = lo.Reverse(users) + } + + // 更新游标 + if len(users) > 0 { + err = p.StoreCursor(ctx, users[0], users[len(users)-1]) + if err != nil { + return nil, 0, err + } + } + return users, int32(total), nil +} + +func NewEsMapper(config *config.Config) UserEsMapper { + es, err := elasticsearch.NewTypedClient(elasticsearch.Config{Addresses: config.Elasticsearch.Addresses, Username: config.Elasticsearch.Username, Password: config.Elasticsearch.Password}) + if err != nil { + logx.Errorf("elasticsearch连接异常[%v]\n", err) + } + return &EsMapper{ + es: es, + IndexName: fmt.Sprintf("%s.%s", config.Mongo.DB, CollectionName), + } +} diff --git a/biz/infrastructure/mapper/user/mongo.go b/biz/infrastructure/mapper/user/mongo.go new file mode 100644 index 0000000..ff81095 --- /dev/null +++ b/biz/infrastructure/mapper/user/mongo.go @@ -0,0 +1,105 @@ +package user + +import ( + "context" + "errors" + "github.com/CloudStriver/cloudmind-content/biz/infrastructure/config" + "github.com/CloudStriver/cloudmind-content/biz/infrastructure/consts" + "github.com/zeromicro/go-zero/core/stores/monc" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "time" +) + +const CollectionName = "user" + +var PrefixUserCacheKey = "cache:user:" + +var _ UserMongoMapper = (*MongoMapper)(nil) + +type ( + UserMongoMapper interface { + Insert(ctx context.Context, data *User) (string, error) + FindOne(ctx context.Context, id string) (*User, error) + Update(ctx context.Context, data *User) (*mongo.UpdateResult, error) + Delete(ctx context.Context, id string) (int64, error) + } + User struct { + ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` + Name string `bson:"name,omitempty" json:"name,omitempty"` + Sex int32 `bson:"sex,omitempty" json:"sex,omitempty"` + FullName string `bson:"fullName,omitempty" json:"fullName,omitempty"` + IdCard string `bson:"idCard,omitempty" json:"idCard,omitempty"` + Description string `bson:"description,omitempty" json:"description,omitempty"` + Url string `bson:"url,omitempty" json:"url,omitempty"` + UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` + CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` + Score_ float64 `bson:"_score,omitempty" json:"_score,omitempty"` + } + + MongoMapper struct { + conn *monc.Model + } +) + +func NewMongoMapper(config *config.Config) UserMongoMapper { + conn := monc.MustNewModel(config.Mongo.URL, config.Mongo.DB, CollectionName, config.CacheConf) + return &MongoMapper{ + conn: conn, + } +} + +func (m *MongoMapper) StartClient() *mongo.Client { + return m.conn.Database().Client() +} + +func (m *MongoMapper) Insert(ctx context.Context, data *User) (string, error) { + if data.ID.IsZero() { + data.ID = primitive.NewObjectID() + data.CreateAt = time.Now() + data.UpdateAt = time.Now() + } + + key := PrefixUserCacheKey + data.ID.Hex() + ID, err := m.conn.InsertOne(ctx, key, data) + if err != nil { + return "", err + } + return ID.InsertedID.(primitive.ObjectID).Hex(), err +} + +func (m *MongoMapper) FindOne(ctx context.Context, id string) (*User, error) { + oid, err := primitive.ObjectIDFromHex(id) + if err != nil { + return nil, err + } + var data User + key := PrefixUserCacheKey + id + err = m.conn.FindOne(ctx, key, &data, bson.M{"_id": oid}) + switch { + case err == nil: + return &data, nil + case errors.Is(err, monc.ErrNotFound): + return nil, consts.ErrNotFound + default: + return nil, err + } +} + +func (m *MongoMapper) Update(ctx context.Context, data *User) (*mongo.UpdateResult, error) { + data.UpdateAt = time.Now() + key := PrefixUserCacheKey + data.ID.Hex() + res, err := m.conn.UpdateOne(ctx, key, bson.M{"_id": data.ID}, bson.M{"$set": data}) + return res, err +} + +func (m *MongoMapper) Delete(ctx context.Context, id string) (int64, error) { + oid, err := primitive.ObjectIDFromHex(id) + if err != nil { + return 0, err + } + key := PrefixUserCacheKey + id + res, err := m.conn.DeleteOne(ctx, key, bson.M{"_id": oid}) + return res, err +} diff --git a/biz/infrastructure/stores/redis/redis.go b/biz/infrastructure/stores/redis/redis.go index abc2e1c..4ac6f4f 100644 --- a/biz/infrastructure/stores/redis/redis.go +++ b/biz/infrastructure/stores/redis/redis.go @@ -5,10 +5,6 @@ import ( "github.com/zeromicro/go-zero/core/stores/redis" ) -const ( - fileId = "fileId" -) - func NewRedis(config *config.Config) *redis.Redis { return redis.MustNewRedis(*config.Redis) } diff --git a/biz/infrastructure/util/lib.go b/biz/infrastructure/util/lib.go deleted file mode 100644 index 9b1440b..0000000 --- a/biz/infrastructure/util/lib.go +++ /dev/null @@ -1,46 +0,0 @@ -package util - -import ( - "github.com/CloudStriver/service-idl-gen-go/kitex_gen/basic" - "github.com/bytedance/sonic" - "github.com/xh-polaris/gopkg/pagination" - "github.com/xh-polaris/gopkg/util/log" - "sync" - - "github.com/bytedance/gopkg/util/gopool" -) - -func JSONF(v any) string { - data, err := sonic.Marshal(v) - if err != nil { - log.Error("JSONF fail, v=%v, err=%v", v, err) - } - return string(data) -} - -func ParsePagination(opts *basic.PaginationOptions) (p *pagination.PaginationOptions) { - if opts == nil { - p = &pagination.PaginationOptions{} - } else { - p = &pagination.PaginationOptions{ - Limit: opts.Limit, - Offset: opts.Offset, - Backward: opts.Backward, - LastToken: opts.LastToken, - } - } - return -} - -func ParallelRun(fns []func()) { - wg := sync.WaitGroup{} - wg.Add(len(fns)) - for _, fn := range fns { - fn := fn - gopool.Go(func() { - defer wg.Done() - fn() - }) - } - wg.Wait() -} diff --git a/biz/infrastructure/util/log/log.go b/biz/infrastructure/util/log/log.go deleted file mode 100644 index 832683e..0000000 --- a/biz/infrastructure/util/log/log.go +++ /dev/null @@ -1,35 +0,0 @@ -package log - -import ( - "context" - - "github.com/zeromicro/go-zero/core/logx" -) - -func getLoggerCtx(ctx context.Context) logx.Logger { - return logx.WithContext(ctx).WithCallerSkip(1) -} - -func getLogger() logx.Logger { - return logx.WithCallerSkip(1) -} - -func CtxInfo(ctx context.Context, format string, v ...any) { - getLoggerCtx(ctx).Infof(format, v...) -} - -func Info(format string, v ...any) { - getLogger().Infof(format, v...) -} - -func CtxError(ctx context.Context, format string, v ...any) { - getLoggerCtx(ctx).Errorf(format, v...) -} - -func Error(format string, v ...any) { - getLogger().Errorf(format, v...) -} - -func CtxDebug(ctx context.Context, format string, v ...any) { - getLoggerCtx(ctx).Debugf(format, v...) -} diff --git a/build.sh b/build.sh index a9f3351..f9922f3 100644 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -RUN_NAME="cloudmind.collection" +RUN_NAME="cloudmind.content" mkdir -p output/bin cp script/* output/ diff --git a/go.mod b/go.mod index 6c2e67f..05edb33 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/CloudStriver/cloudmind-content -go 1.21.0 +go 1.20 require ( github.com/CloudStriver/go-pkg v0.0.0-20231229114943-910edcb8788d diff --git a/go.sum b/go.sum index 89d18a9..1b81e32 100644 --- a/go.sum +++ b/go.sum @@ -29,9 +29,7 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE= -github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.31.0 h1:ObEFUNlJwoIiyjxdrYF0QIDE7qXcLc7D3WpSH4c22PU= -github.com/alicebob/miniredis/v2 v2.31.0/go.mod h1:UB/T2Uztp7MlFSDakaX1sTXUv5CASoprx0wulRT6HBg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -39,7 +37,6 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -196,7 +193,6 @@ github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= @@ -232,7 +228,6 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= -github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -275,7 +270,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -308,7 +302,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= -github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -379,7 +372,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -394,7 +386,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= @@ -425,15 +416,12 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nyaruka/phonenumbers v1.0.55/go.mod h1:sDaTZ/KPX5f8qyV9qN+hIm+4ZBARJrupC6LuhshJq1U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oleiade/lane v1.0.1 h1:hXofkn7GEOubzTwNpeL9MaNy8WxolCYb9cInAIeqShU= github.com/oleiade/lane v1.0.1/go.mod h1:IyTkraa4maLfjq/GmHR+Dxb4kCMtEGeb+qmhlrQ5Mk4= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= @@ -453,7 +441,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -484,12 +471,10 @@ github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= @@ -583,7 +568,6 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= -github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/zeromicro/go-zero v1.6.1 h1:E8fRkMPiYODk8+jUIrxQQIEG+MTgWfXKiH7sjc9l6Vs= github.com/zeromicro/go-zero v1.6.1/go.mod h1:slLvzqPP/H/h9ABq9ykNOuX6pYLjA8Uy3Rb8adkXTGw= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -613,9 +597,7 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0 h1:Wx7nFnvCaissIUZxPkBqDz2963Z+Cl+PkYbDKzTxDqQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0/go.mod h1:E5NNboN0UqSAki0Atn9kVwaN7I+l25gGxDqBueo/74E= go.opentelemetry.io/contrib/propagators/b3 v1.20.0 h1:Yty9Vs4F3D6/liF1o6FNt0PvN85h/BJJ6DQKJ3nrcM0= -go.opentelemetry.io/contrib/propagators/b3 v1.20.0/go.mod h1:On4VgbkqYL18kbJlWsa18+cMNe6rYpBnPi1ARI/BrsU= go.opentelemetry.io/contrib/propagators/ot v1.20.0 h1:duH7mgL6VGQH7e7QEAVOFkCQXWpCb4PjTtrhdrYrJRQ= -go.opentelemetry.io/contrib/propagators/ot v1.20.0/go.mod h1:gijQzxOq0JLj9lyZhTvqjDddGV/zaNagpPIn+2r8CEI= go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= @@ -653,7 +635,6 @@ go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0 go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -839,7 +820,6 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -955,18 +935,14 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= -gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= -gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -989,10 +965,8 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/output/bootstrap.sh b/output/bootstrap.sh deleted file mode 100755 index b08fbdd..0000000 --- a/output/bootstrap.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/env bash -CURDIR=$(cd $(dirname $0); pwd) - -if [ "X$1" != "X" ]; then - RUNTIME_ROOT=$1 -else - RUNTIME_ROOT=${CURDIR} -fi - -export KITEX_RUNTIME_ROOT=$RUNTIME_ROOT -export KITEX_LOG_DIR="$RUNTIME_ROOT/log" - -if [ ! -d "$KITEX_LOG_DIR/app" ]; then - mkdir -p "$KITEX_LOG_DIR/app" -fi - -if [ ! -d "$KITEX_LOG_DIR/rpc" ]; then - mkdir -p "$KITEX_LOG_DIR/rpc" -fi - -exec "$CURDIR/bin/cloudmind.collection" - diff --git a/provider/provider.go b/provider/provider.go index 28438b0..9ebbd91 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -7,6 +7,7 @@ import ( "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/label" "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/post" "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/sharefile" + "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/user" "github.com/CloudStriver/cloudmind-content/biz/infrastructure/stores/redis" "github.com/google/wire" ) @@ -20,6 +21,7 @@ var ApplicationSet = wire.NewSet( service.FileSet, service.PostSet, service.LabelSet, + service.UserSet, ) var InfrastructureSet = wire.NewSet( @@ -35,4 +37,6 @@ var MapperSet = wire.NewSet( post.NewMongoMapper, post.NewEsMapper, label.NewMongoMapper, + user.NewEsMapper, + user.NewMongoMapper, ) diff --git a/provider/wire_gen.go b/provider/wire_gen.go index 2067339..0ce1c99 100644 --- a/provider/wire_gen.go +++ b/provider/wire_gen.go @@ -14,6 +14,7 @@ import ( "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/label" "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/post" "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/sharefile" + "github.com/CloudStriver/cloudmind-content/biz/infrastructure/mapper/user" "github.com/CloudStriver/cloudmind-content/biz/infrastructure/stores/redis" ) @@ -43,11 +44,20 @@ func NewContentServerImpl() (*adaptor.ContentServerImpl, error) { labelService := &service.LabelService{ LabelMongoMapper: labelIMongoMapper, } + userMongoMapper := user.NewMongoMapper(configConfig) + userEsMapper := user.NewEsMapper(configConfig) + userServiceImpl := &service.UserServiceImpl{ + Config: configConfig, + UserMongoMapper: userMongoMapper, + UserEsMapper: userEsMapper, + Redis: redisRedis, + } contentServerImpl := &adaptor.ContentServerImpl{ Config: configConfig, FileService: fileService, PostService: postService, LabelService: labelService, + UserService: userServiceImpl, } return contentServerImpl, nil } diff --git a/script/bootstrap.sh b/script/bootstrap.sh index b08fbdd..8358fcd 100644 --- a/script/bootstrap.sh +++ b/script/bootstrap.sh @@ -18,5 +18,5 @@ if [ ! -d "$KITEX_LOG_DIR/rpc" ]; then mkdir -p "$KITEX_LOG_DIR/rpc" fi -exec "$CURDIR/bin/cloudmind.collection" +exec "$CURDIR/bin/cloudmind.content"