fusenapi/product/internal/svc/servicecontext.go
laodaming 2d7ea2e302 fixc
2023-06-01 18:34:41 +08:00

19 lines
337 B
Go

package svc
import (
"fusenapi/product/internal/config"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
type ServiceContext struct {
Config config.Config
MysqlConn sqlx.SqlConn
}
func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
Config: c,
MysqlConn: sqlx.NewMysql(c.DataSource),
}
}