api.go 891 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package dao
  2. import (
  3. giftApi "go-common/app/service/live/gift/api/liverpc"
  4. rcApi "go-common/app/service/live/rc/api/liverpc"
  5. userExtApi "go-common/app/service/live/userext/api/liverpc"
  6. "go-common/app/service/live/xlottery/conf"
  7. account "go-common/app/service/main/account/rpc/client"
  8. "go-common/library/net/rpc/liverpc"
  9. )
  10. // AccountApi liverpc user api
  11. var AccountApi *account.Service3
  12. // GiftApi liverpc gift api
  13. var GiftApi *giftApi.Client
  14. // RcApi rc api
  15. var RcApi *rcApi.Client
  16. // UserExtApi userext api
  17. var UserExtApi *userExtApi.Client
  18. // InitAPI init all service APIs
  19. func InitAPI() {
  20. AccountApi = account.New3(nil)
  21. GiftApi = giftApi.New(getConf("gift"))
  22. RcApi = rcApi.New(getConf("rc"))
  23. UserExtApi = userExtApi.New(getConf("userext"))
  24. }
  25. func getConf(appName string) *liverpc.ClientConfig {
  26. c := conf.Conf.LiveRpc
  27. if c != nil {
  28. return c[appName]
  29. }
  30. return nil
  31. }