fusenapi/home-user-auth/internal/svc/servicecontext.go

22 lines
399 B
Go
Raw Normal View History

2023-05-31 18:33:02 +08:00
package svc
import (
"fusenapi/home-user-auth/internal/config"
"fusenapi/model"
2023-05-31 18:33:02 +08:00
"github.com/zeromicro/go-zero/core/stores/sqlx"
2023-05-31 18:33:02 +08:00
)
type ServiceContext struct {
Config config.Config
FsFontModel model.FsFontModel
2023-05-31 18:33:02 +08:00
}
func NewServiceContext(c config.Config) *ServiceContext {
2023-06-01 13:05:57 +08:00
2023-05-31 18:33:02 +08:00
return &ServiceContext{
Config: c,
2023-06-01 12:15:36 +08:00
FsFontModel: model.NewFsFontModel(sqlx.NewMysql(c.DataSource)),
2023-05-31 18:33:02 +08:00
}
}