fusenapi/server/data-transfer/internal/svc/servicecontext.go

20 lines
359 B
Go
Raw Normal View History

2023-06-07 11:47:45 +00:00
package svc
import (
2023-06-08 03:03:20 +00:00
config2 "fusenapi/server/data-transfer/internal/config"
2023-06-07 11:47:45 +00:00
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
type ServiceContext struct {
2023-06-08 03:03:20 +00:00
Config config2.Config
2023-06-07 11:47:45 +00:00
MysqlConn sqlx.SqlConn
}
2023-06-08 03:03:20 +00:00
func NewServiceContext(c config2.Config) *ServiceContext {
2023-06-07 11:47:45 +00:00
return &ServiceContext{
Config: c,
MysqlConn: sqlx.NewMysql(c.SourceMysql),
}
}