322f01998a
CI / changes (push) Successful in 35s
CI / ad (push) Successful in 3s
CI / admin (push) Successful in 1s
CI / bff (push) Successful in 1s
CI / chore (push) Successful in 2s
CI / equipment (push) Successful in 2s
CI / express (push) Successful in 2s
CI / product (push) Successful in 2s
CI / record (push) Successful in 27s
CI / sale (push) Successful in 2s
CI / task (push) Successful in 2s
CI / user (push) Successful in 2s
CI / wecom (push) Successful in 2s
23 lines
381 B
Go
23 lines
381 B
Go
package svc
|
|
|
|
import (
|
|
"lone-services/pkg/utils"
|
|
"lone-services/services/record/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"),
|
|
}
|
|
}
|