初始化项目
This commit is contained in:
18
internal/svc/service_context.go
Normal file
18
internal/svc/service_context.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package svc
|
||||
|
||||
import (
|
||||
"nova_task/internal/config"
|
||||
"nova_task/internal/model"
|
||||
)
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
TaskModel model.NhTaskModel
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
TaskModel: model.NewNhTaskModel(c.MySql.Conn()),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user