22 lines
347 B
Smarty
22 lines
347 B
Smarty
package svc
|
|
|
|
import (
|
|
{{.configImport}}
|
|
"fusenapi/initalize"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type ServiceContext struct {
|
|
Config {{.config}}
|
|
{{.middleware}}
|
|
MysqlConn *gorm.DB
|
|
}
|
|
|
|
func NewServiceContext(c {{.config}}) *ServiceContext {
|
|
return &ServiceContext{
|
|
Config: c,
|
|
MysqlConn: initalize.InitMysql(c.SourceMysql),
|
|
{{.middlewareAssignment}}
|
|
}
|
|
}
|