Files
lone-services/services/express/internal/svc/servicecontext.go
T
2026-08-24 10:06:52 +08:00

24 lines
383 B
Go

package svc
import (
"lone-services/pkg/utils"
"lone-services/services/express/internal/config"
"gorm.io/gorm"
)
type ServiceContext struct {
Config config.Config
DB *gorm.DB
Prefix string
}
func NewServiceContext(c config.Config, db *gorm.DB) *ServiceContext {
return &ServiceContext{
Config: c,
DB: db,
Prefix: utils.GetConfigString("mysql.prefix"),
}
}