22 lines
347 B
Smarty
Raw Normal View History

2023-06-05 17:56:55 +08:00
package svc
import (
{{.configImport}}
2023-06-12 14:05:35 +08:00
"fusenapi/initalize"
"gorm.io/gorm"
2023-06-05 17:56:55 +08:00
)
type ServiceContext struct {
Config {{.config}}
{{.middleware}}
2023-06-12 14:05:35 +08:00
MysqlConn *gorm.DB
2023-06-05 17:56:55 +08:00
}
func NewServiceContext(c {{.config}}) *ServiceContext {
return &ServiceContext{
Config: c,
2023-06-12 14:05:35 +08:00
MysqlConn: initalize.InitMysql(c.SourceMysql),
2023-06-05 17:56:55 +08:00
{{.middlewareAssignment}}
}
}