FansMedal.liverpc.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/FansMedal.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/FansMedal.proto
  8. v1/Medal.proto
  9. */
  10. package v1
  11. import context "context"
  12. import proto "github.com/golang/protobuf/proto"
  13. import "go-common/library/net/rpc/liverpc"
  14. var _ proto.Message // generate to suppress unused imports
  15. // Imports only used by utility functions:
  16. // ===================
  17. // FansMedal Interface
  18. // ===================
  19. type FansMedal interface {
  20. // * 获取已佩戴的勋章
  21. //
  22. GetWearedMedal(context.Context, *FansMedalGetWearedMedalReq) (*FansMedalGetWearedMedalResp, error)
  23. // * 用户卡
  24. // 基于某房间|主播的 用户卡片信息
  25. TargetsWithMedal(context.Context, *FansMedalTargetsWithMedalReq) (*FansMedalTargetsWithMedalResp, error)
  26. }
  27. // =========================
  28. // FansMedal Live Rpc Client
  29. // =========================
  30. type fansMedalRpcClient struct {
  31. client *liverpc.Client
  32. }
  33. // NewFansMedalRpcClient creates a Rpc client that implements the FansMedal interface.
  34. // It communicates using Rpc and can be configured with a custom HTTPClient.
  35. func NewFansMedalRpcClient(client *liverpc.Client) FansMedal {
  36. return &fansMedalRpcClient{
  37. client: client,
  38. }
  39. }
  40. func (c *fansMedalRpcClient) GetWearedMedal(ctx context.Context, in *FansMedalGetWearedMedalReq) (*FansMedalGetWearedMedalResp, error) {
  41. out := new(FansMedalGetWearedMedalResp)
  42. err := doRpcRequest(ctx, c.client, 1, "FansMedal.get_weared_medal", in, out)
  43. if err != nil {
  44. return nil, err
  45. }
  46. return out, nil
  47. }
  48. func (c *fansMedalRpcClient) TargetsWithMedal(ctx context.Context, in *FansMedalTargetsWithMedalReq) (*FansMedalTargetsWithMedalResp, error) {
  49. out := new(FansMedalTargetsWithMedalResp)
  50. err := doRpcRequest(ctx, c.client, 1, "FansMedal.targetsWithMedal", in, out)
  51. if err != nil {
  52. return nil, err
  53. }
  54. return out, nil
  55. }
  56. // =====
  57. // Utils
  58. // =====
  59. func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
  60. err = client.Call(ctx, version, method, in, out)
  61. return
  62. }