fusenapi/server/product/internal/svc/servicecontext.go
laodaming a9e0f6b98e fix
2023-06-08 11:03:20 +08:00

19 lines
344 B
Go

package svc
import (
"fusenapi/server/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),
}
}