serviceContext.go 350 B

12345678910111213141516171819
  1. package svc
  2. import (
  3. "github.com/zeromicro/go-zero/zrpc"
  4. "jyBXCore/api/internal/config"
  5. "jyBXCore/rpc/bxcore"
  6. )
  7. type ServiceContext struct {
  8. Config config.Config
  9. BxCore bxcore.BxCore
  10. }
  11. func NewServiceContext(c config.Config) *ServiceContext {
  12. return &ServiceContext{
  13. Config: c,
  14. BxCore: bxcore.NewBxCore(zrpc.MustNewClient(c.Core)),
  15. }
  16. }