完成AllModels序列化
This commit is contained in:
@@ -2,17 +2,22 @@ package svc
|
||||
|
||||
import (
|
||||
{{.configImport}}
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"fusenapi/initalize"
|
||||
"fusenapi/model/gmodel"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"github.com/golang-jwt/jwt"
|
||||
"net/http"
|
||||
"errors"
|
||||
)
|
||||
|
||||
type ServiceContext struct {
|
||||
Config {{.config}}
|
||||
{{.middleware}}
|
||||
MysqlConn *gorm.DB
|
||||
AllModels *gmodel.AllModelsGen
|
||||
}
|
||||
|
||||
func NewServiceContext(c {{.config}}) *ServiceContext {
|
||||
@@ -20,6 +25,7 @@ func NewServiceContext(c {{.config}}) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
MysqlConn: initalize.InitMysql(c.SourceMysql),
|
||||
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
|
||||
{{.middlewareAssignment}}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user