BannerMng.liverpc.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/BannerMng.proto
  3. /*
  4. Package v1 is a generated liverpc stub package.
  5. This code was generated with go-common/app/tool/liverpc/protoc-gen-liverpc v0.1.
  6. It is generated from these files:
  7. v1/BannerMng.proto
  8. v1/Banner.proto
  9. v1/RoomNews.proto
  10. */
  11. package v1
  12. import context "context"
  13. import proto "github.com/golang/protobuf/proto"
  14. import "go-common/library/net/rpc/liverpc"
  15. var _ proto.Message // generate to suppress unused imports
  16. // Imports only used by utility functions:
  17. // ===================
  18. // BannerMng Interface
  19. // ===================
  20. type BannerMng interface {
  21. // * 获取新后台配置的banner
  22. //
  23. GetNewBanner(context.Context, *BannerMngGetNewBannerReq) (*BannerMngGetNewBannerResp, error)
  24. }
  25. // =========================
  26. // BannerMng Live Rpc Client
  27. // =========================
  28. type bannerMngRpcClient struct {
  29. client *liverpc.Client
  30. }
  31. // NewBannerMngRpcClient creates a Rpc client that implements the BannerMng interface.
  32. // It communicates using Rpc and can be configured with a custom HTTPClient.
  33. func NewBannerMngRpcClient(client *liverpc.Client) BannerMng {
  34. return &bannerMngRpcClient{
  35. client: client,
  36. }
  37. }
  38. func (c *bannerMngRpcClient) GetNewBanner(ctx context.Context, in *BannerMngGetNewBannerReq) (*BannerMngGetNewBannerResp, error) {
  39. out := new(BannerMngGetNewBannerResp)
  40. err := doRpcRequest(ctx, c.client, 1, "BannerMng.getNewBanner", in, out)
  41. if err != nil {
  42. return nil, err
  43. }
  44. return out, nil
  45. }
  46. // =====
  47. // Utils
  48. // =====
  49. func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
  50. err = client.Call(ctx, version, method, in, out)
  51. return
  52. }