UnionFans.liverpc.go 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/UnionFans.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/UnionFans.proto
  8. */
  9. package v1
  10. import context "context"
  11. import proto "github.com/golang/protobuf/proto"
  12. import "go-common/library/net/rpc/liverpc"
  13. var _ proto.Message // generate to suppress unused imports
  14. // Imports only used by utility functions:
  15. // ===================
  16. // UnionFans Interface
  17. // ===================
  18. type UnionFans interface {
  19. // * 获取友爱社礼包提示
  20. //
  21. GetSendGift(context.Context, *UnionFansGetSendGiftReq) (*UnionFansGetSendGiftResp, error)
  22. // * 查询用户特殊勋章样式
  23. //
  24. GetSpecialMedal(context.Context, *UnionFansGetSpecialMedalReq) (*UnionFansGetSpecialMedalResp, error)
  25. }
  26. // =========================
  27. // UnionFans Live Rpc Client
  28. // =========================
  29. type unionFansRpcClient struct {
  30. client *liverpc.Client
  31. }
  32. // NewUnionFansRpcClient creates a Rpc client that implements the UnionFans interface.
  33. // It communicates using Rpc and can be configured with a custom HTTPClient.
  34. func NewUnionFansRpcClient(client *liverpc.Client) UnionFans {
  35. return &unionFansRpcClient{
  36. client: client,
  37. }
  38. }
  39. func (c *unionFansRpcClient) GetSendGift(ctx context.Context, in *UnionFansGetSendGiftReq) (*UnionFansGetSendGiftResp, error) {
  40. out := new(UnionFansGetSendGiftResp)
  41. err := doRpcRequest(ctx, c.client, 1, "UnionFans.getSendGift", in, out)
  42. if err != nil {
  43. return nil, err
  44. }
  45. return out, nil
  46. }
  47. func (c *unionFansRpcClient) GetSpecialMedal(ctx context.Context, in *UnionFansGetSpecialMedalReq) (*UnionFansGetSpecialMedalResp, error) {
  48. out := new(UnionFansGetSpecialMedalResp)
  49. err := doRpcRequest(ctx, c.client, 1, "UnionFans.getSpecialMedal", in, out)
  50. if err != nil {
  51. return nil, err
  52. }
  53. return out, nil
  54. }
  55. // =====
  56. // Utils
  57. // =====
  58. func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
  59. err = client.Call(ctx, version, method, in, out)
  60. return
  61. }