fusenapi/server/product/internal/svc/servicecontext.go
laodaming 53a3490837 fix
2023-06-12 14:05:35 +08:00

21 lines
334 B
Go

package svc
import (
"fusenapi/initalize"
"fusenapi/server/product/internal/config"
"gorm.io/gorm"
)
type ServiceContext struct {
Config config.Config
MysqlConn *gorm.DB
}
func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
Config: c,
MysqlConn: initalize.InitMysql(c.SourceMysql),
}
}