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

19 lines
344 B
Go
Raw Normal View History

2023-06-01 07:32:28 +00:00
package svc
import (
2023-06-08 03:03:20 +00:00
"fusenapi/server/product/internal/config"
2023-06-01 07:32:28 +00:00
"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
}
}