2023-05-31 10:33:02 +00:00
|
|
|
package svc
|
|
|
|
|
|
|
|
import (
|
2023-06-01 03:27:34 +00:00
|
|
|
"fusenapi/home-user-auth/internal/config"
|
|
|
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
2023-05-31 10:33:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type ServiceContext struct {
|
2023-06-05 09:56:55 +00:00
|
|
|
Config config.Config
|
|
|
|
|
|
|
|
MysqlConn sqlx.SqlConn
|
2023-05-31 10:33:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
|
|
return &ServiceContext{
|
2023-06-05 09:56:55 +00:00
|
|
|
Config: c,
|
|
|
|
MysqlConn: sqlx.NewMysql(c.SourceMysql),
|
2023-05-31 10:33:02 +00:00
|
|
|
}
|
|
|
|
}
|