fusenapi/server/product/internal/svc/servicecontext.go

19 lines
337 B
Go
Raw Normal View History

2023-06-01 07:32:28 +00:00
package svc
import (
"fusenapi/product/internal/config"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
type ServiceContext struct {
2023-06-01 10:34:41 +00:00
Config config.Config
MysqlConn sqlx.SqlConn
2023-06-01 07:32:28 +00:00
}
func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
2023-06-01 10:34:41 +00:00
Config: c,
MysqlConn: sqlx.NewMysql(c.DataSource),
2023-06-01 07:32:28 +00:00
}
}