api 模板的修改

This commit is contained in:
eson
2023-06-05 17:56:55 +08:00
parent 6c717ce30e
commit ef46164dc3
86 changed files with 1329 additions and 108 deletions

View File

@@ -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),
}
}