fusenapi/product/internal/svc/servicecontext.go
2023-06-01 15:32:28 +08:00

20 lines
408 B
Go

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