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.
26 lines
483 B
Go
26 lines
483 B
Go
package svc
|
|
|
|
import (
|
|
"context"
|
|
"dcg/app/user_center/usercenter"
|
|
"dcg/config"
|
|
"github.com/zeromicro/go-zero/zrpc"
|
|
)
|
|
|
|
type ServiceContext struct {
|
|
Ctx context.Context
|
|
Config *config.Config
|
|
|
|
UserCenterRpc usercenter.UserCenter
|
|
}
|
|
|
|
func NewServiceContext(ctx context.Context, cfg *config.Config) *ServiceContext {
|
|
svc := &ServiceContext{
|
|
Ctx: ctx,
|
|
Config: cfg,
|
|
// rpc
|
|
UserCenterRpc: usercenter.NewUserCenter(zrpc.MustNewClient(cfg.UserCenterRpc)),
|
|
}
|
|
return svc
|
|
}
|