This commit is contained in:
laodaming
2023-06-09 12:07:54 +08:00
parent 78e5b2cc59
commit 2a18f0c21a
19 changed files with 573 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
package svc
import (
"fusenapi/server/canteen/internal/config"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
type ServiceContext struct {
Config config.Config
MysqlConn sqlx.SqlConn
}
func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
Config: c,
MysqlConn: sqlx.NewMysql(c.SourceMysql),
}
}