21 lines
334 B
Go
21 lines
334 B
Go
package svc
|
|
|
|
import (
|
|
"fusenapi/initalize"
|
|
"fusenapi/server/canteen/internal/config"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type ServiceContext struct {
|
|
Config config.Config
|
|
|
|
MysqlConn *gorm.DB
|
|
}
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
return &ServiceContext{
|
|
Config: c,
|
|
MysqlConn: initalize.InitMysql(c.SourceMysql),
|
|
}
|
|
}
|