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 }