servicecontext.go 355 B

12345678910111213141516171819
  1. package svc
  2. import (
  3. "github.com/zeromicro/go-zero/zrpc"
  4. "ylink/bff/cmdbff/api/internal/config"
  5. "ylink/core/cmd/rpc/cmd"
  6. )
  7. type ServiceContext struct {
  8. Config config.Config
  9. CmdRpc cmd.Cmd
  10. }
  11. func NewServiceContext(c config.Config) *ServiceContext {
  12. return &ServiceContext{
  13. Config: c,
  14. CmdRpc: cmd.NewCmd(zrpc.MustNewClient(c.CmdRpcConf)),
  15. }
  16. }