You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
563 B
Go
23 lines
563 B
Go
package svc
|
|
|
|
import (
|
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
|
"live-service/app/user_center/model"
|
|
"live-service/app/user_center/rpc/internal/config"
|
|
)
|
|
|
|
type ServiceContext struct {
|
|
Config config.Config
|
|
|
|
UserModel model.UserModel
|
|
UserPlatformModel model.UserPlatformModel
|
|
}
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
return &ServiceContext{
|
|
Config: c,
|
|
UserModel: model.NewUserModel(sqlx.NewMysql(c.DB.DataSource)),
|
|
UserPlatformModel: model.NewUserPlatformModel(sqlx.NewMysql(c.DB.DataSource)),
|
|
}
|
|
}
|