servicecontext.go 468 B

12345678910111213141516171819
  1. package svc
  2. import (
  3. "app.yhyue.com/moapp/dataDeduplication/api/internal/config"
  4. "app.yhyue.com/moapp/dataDeduplication/rpc/deduplicationclient"
  5. "github.com/tal-tech/go-zero/zrpc"
  6. )
  7. type ServiceContext struct {
  8. Config config.Config
  9. Dedup deduplicationclient.Deduplication
  10. }
  11. func NewServiceContext(c config.Config) *ServiceContext {
  12. return &ServiceContext{
  13. Config: c,
  14. Dedup: deduplicationclient.NewDeduplication(zrpc.MustNewClient(c.Deduplication)),
  15. }
  16. }