eb96aaa2ef
CI / changes (push) Successful in 37s
CI / ad (push) Successful in 44s
CI / admin (push) Successful in 39s
CI / bff (push) Successful in 32s
CI / chore (push) Successful in 38s
CI / express (push) Successful in 42s
CI / product (push) Successful in 43s
CI / sale (push) Successful in 42s
CI / task (push) Successful in 42s
CI / user (push) Successful in 42s
CI / wecom (push) Successful in 41s
24 lines
385 B
Go
24 lines
385 B
Go
package svc
|
|
|
|
import (
|
|
"lone-services/pkg/utils"
|
|
"lone-services/services/equipment/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"),
|
|
}
|
|
}
|