fusenapi/server/canteen/internal/svc/servicecontext.go
laodaming 2a18f0c21a fix
2023-06-09 12:07:54 +08:00

20 lines
343 B
Go

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