api 模板的修改
This commit is contained in:
@@ -2,24 +2,18 @@ package svc
|
||||
|
||||
import (
|
||||
"fusenapi/home-user-auth/internal/config"
|
||||
"fusenapi/model"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
FsFontModel model.FsFontModel
|
||||
FsCanteenTypeModel model.FsCanteenTypeModel
|
||||
FsUserModel model.FsUserModel
|
||||
Config config.Config
|
||||
|
||||
MysqlConn sqlx.SqlConn
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
conn := sqlx.NewMysql(c.DataSource)
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
FsFontModel: model.NewFsFontModel(conn),
|
||||
FsCanteenTypeModel: model.NewFsCanteenTypeModel(conn),
|
||||
FsUserModel: model.NewFsUserModel(conn),
|
||||
Config: c,
|
||||
MysqlConn: sqlx.NewMysql(c.SourceMysql),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user