liveRPC.go 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package dao
  2. import (
  3. activityService "go-common/app/service/live/activity/api/liverpc"
  4. avService "go-common/app/service/live/av/api/liverpc"
  5. bannedService "go-common/app/service/live/banned_service/api/liverpc"
  6. fansMedalService "go-common/app/service/live/fans_medal/api/liverpc"
  7. "go-common/app/service/live/live-dm/conf"
  8. liveUserService "go-common/app/service/live/live_user/api/liverpc"
  9. rankdbService "go-common/app/service/live/rankdb/api/liverpc"
  10. rcService "go-common/app/service/live/rc/api/liverpc"
  11. roomService "go-common/app/service/live/room/api/liverpc"
  12. liveBroadCast "go-common/app/service/live/third_api/liveBroadcast"
  13. userService "go-common/app/service/live/user/api/liverpc"
  14. userextService "go-common/app/service/live/userext/api/liverpc"
  15. "go-common/library/net/rpc/liverpc"
  16. )
  17. var (
  18. // BannedServiceClient liveRpc banner_service api
  19. BannedServiceClient *bannedService.Client
  20. // RoomServiceClient liveRpc room service api
  21. RoomServiceClient *roomService.Client
  22. // LiveUserServiceClient liveRpc liveUser service api
  23. LiveUserServiceClient *liveUserService.Client
  24. // AvServiceClient liveRpc av service api
  25. AvServiceClient *avService.Client
  26. //FansMedalServiceClient liverpc fansmedal service api
  27. FansMedalServiceClient *fansMedalService.Client
  28. //ActivityServiceClient liverpc activity service api
  29. ActivityServiceClient *activityService.Client
  30. //RcServiceClient liverpc rc service api
  31. RcServiceClient *rcService.Client
  32. //RankdbServiceClient liverpc rankdb service api
  33. RankdbServiceClient *rankdbService.Client
  34. //UserExtServiceClient liverpc userext service api
  35. UserExtServiceClient *userextService.Client
  36. //LiveBroadCastClient liverpc thirdApi
  37. LiveBroadCastClient *liveBroadCast.Client
  38. //UserClient liveRpc user api
  39. userClient *userService.Client
  40. )
  41. //InitAPI init all service APIS
  42. func InitAPI() {
  43. BannedServiceClient = bannedService.New(getConf("banneDService"))
  44. RoomServiceClient = roomService.New(getConf("room"))
  45. LiveUserServiceClient = liveUserService.New(getConf("liveUser"))
  46. AvServiceClient = avService.New(getConf("avService"))
  47. FansMedalServiceClient = fansMedalService.New(getConf("fansMedal"))
  48. ActivityServiceClient = activityService.New(getConf("activity"))
  49. RcServiceClient = rcService.New(getConf("rc"))
  50. RankdbServiceClient = rankdbService.New(getConf("rankdbService"))
  51. UserExtServiceClient = userextService.New(getConf("userext"))
  52. LiveBroadCastClient = liveBroadCast.New(conf.Conf.HTTPClient)
  53. userClient = userService.New(getConf("user"))
  54. }
  55. func getConf(appName string) *liverpc.ClientConfig {
  56. c := conf.Conf.LiveRPC
  57. if c != nil {
  58. return c[appName]
  59. }
  60. return nil
  61. }