7939917ba0
CI / changes (push) Successful in 39s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 48s
CI / chore (push) Successful in 0s
CI / equipment (push) Failing after 10s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 0s
CI / payment (push) Successful in 1s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 1s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 1s
23 lines
382 B
Go
23 lines
382 B
Go
package svc
|
|
|
|
import (
|
|
"lone-services/pkg/utils"
|
|
"lone-services/services/message/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"),
|
|
}
|
|
}
|