-
Notifications
You must be signed in to change notification settings - Fork 4
/
wire_gen.go
39 lines (32 loc) · 1.61 KB
/
wire_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package post
import (
"github.com/chenmingyong0423/fnote/server/internal/post/internal/repository"
"github.com/chenmingyong0423/fnote/server/internal/post/internal/repository/dao"
"github.com/chenmingyong0423/fnote/server/internal/post/internal/service"
"github.com/chenmingyong0423/fnote/server/internal/post/internal/web"
"github.com/chenmingyong0423/fnote/server/internal/post_like"
"github.com/chenmingyong0423/fnote/server/internal/website_config"
"github.com/chenmingyong0423/go-eventbus"
"github.com/google/wire"
"go.mongodb.org/mongo-driver/mongo"
)
// Injectors from wire.go:
func InitPostModule(mongoDB *mongo.Database, cfgModel *website_config.Module, postLikeModel *post_like.Module, eventBus *eventbus.EventBus) *Module {
postDao := dao.NewPostDao(mongoDB)
postRepository := repository.NewPostRepository(postDao)
iWebsiteConfigService := cfgModel.Svc
postService := service.NewPostService(postRepository, iWebsiteConfigService, eventBus)
iPostLikeService := postLikeModel.Svc
postHandler := web.NewPostHandler(postService, iWebsiteConfigService, iPostLikeService, eventBus)
module := &Module{
Svc: postService,
Hdl: postHandler,
}
return module
}
// wire.go:
var PostProviders = wire.NewSet(web.NewPostHandler, service.NewPostService, repository.NewPostRepository, dao.NewPostDao, wire.Bind(new(service.IPostService), new(*service.PostService)), wire.Bind(new(repository.IPostRepository), new(*repository.PostRepository)), wire.Bind(new(dao.IPostDao), new(*dao.PostDao)))