20 lines
408 B
Go
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)),
|
|
}
|
|
}
|