app-cloudep-tweeting-service/internal/svc/service_context.go

26 lines
538 B
Go
Raw Normal View History

2024-08-28 09:09:01 +00:00
package svc
import (
"app-cloudep-tweeting-service/internal/config"
model "app-cloudep-tweeting-service/internal/model/mongo"
vi "code.30cm.net/digimon/library-go/validator"
)
2024-08-28 09:09:01 +00:00
type ServiceContext struct {
Config config.Config
Validate vi.Validate
PostModel model.PostModel
CommentModel model.CommentModel
2024-08-28 09:09:01 +00:00
}
func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
Config: c,
Validate: vi.MustValidator(),
PostModel: MustPostModel(c),
CommentModel: MustCommentModel(c),
2024-08-28 09:09:01 +00:00
}
}