21 lines
340 B
Go
Raw Normal View History

2023-06-07 19:47:45 +08:00
package svc
import (
2023-06-12 14:05:35 +08:00
"fusenapi/initalize"
"fusenapi/server/data-transfer/internal/config"
"gorm.io/gorm"
2023-06-07 19:47:45 +08:00
)
type ServiceContext struct {
2023-06-12 14:05:35 +08:00
Config config.Config
2023-06-07 19:47:45 +08:00
2023-06-12 14:05:35 +08:00
MysqlConn *gorm.DB
2023-06-07 19:47:45 +08:00
}
2023-06-12 14:05:35 +08:00
func NewServiceContext(c config.Config) *ServiceContext {
2023-06-07 19:47:45 +08:00
return &ServiceContext{
Config: c,
2023-06-12 14:05:35 +08:00
MysqlConn: initalize.InitMysql(c.SourceMysql),
2023-06-07 19:47:45 +08:00
}
}