serviceContext.go 468 B

12345678910111213141516171819
  1. package svc
  2. import (
  3. "GtDataStore/app/cmd/dtgateway/internal/config"
  4. "GtDataStore/app/cmd/organization/organization"
  5. "github.com/zeromicro/go-zero/zrpc"
  6. )
  7. type ServiceContext struct {
  8. Config config.Config
  9. OrganizationRpc organization.Organization
  10. }
  11. func NewServiceContext(c config.Config) *ServiceContext {
  12. return &ServiceContext{
  13. Config: c,
  14. OrganizationRpc: organization.NewOrganization(zrpc.MustNewClient(c.OrganizationRpcConf)),
  15. }
  16. }