Pk.liverpc.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v1/Pk.proto
  3. package v1
  4. import context "context"
  5. import proto "github.com/golang/protobuf/proto"
  6. import "go-common/library/net/rpc/liverpc"
  7. var _ proto.Message // generate to suppress unused imports
  8. // ============
  9. // Pk Interface
  10. // ============
  11. type Pk interface {
  12. // * 根据id获取PK基础信息
  13. //
  14. GetInfoById(context.Context, *PkGetInfoByIdReq) (*PkGetInfoByIdResp, error)
  15. // * 根据id获取PK基础信息
  16. //
  17. GetPkStatus(context.Context, *PkGetPkStatusReq) (*PkGetPkStatusResp, error)
  18. // * 批量获取pkIds
  19. //
  20. GetPkIdsByRoomIds(context.Context, *PkGetPkIdsByRoomIdsReq) (*PkGetPkIdsByRoomIdsResp, error)
  21. }
  22. // ==================
  23. // Pk Live Rpc Client
  24. // ==================
  25. type pkRpcClient struct {
  26. client *liverpc.Client
  27. }
  28. // NewPkRpcClient creates a Rpc client that implements the Pk interface.
  29. // It communicates using Rpc and can be configured with a custom HTTPClient.
  30. func NewPkRpcClient(client *liverpc.Client) Pk {
  31. return &pkRpcClient{
  32. client: client,
  33. }
  34. }
  35. func (c *pkRpcClient) GetInfoById(ctx context.Context, in *PkGetInfoByIdReq) (*PkGetInfoByIdResp, error) {
  36. out := new(PkGetInfoByIdResp)
  37. err := doRpcRequest(ctx, c.client, 1, "Pk.getInfoById", in, out)
  38. if err != nil {
  39. return nil, err
  40. }
  41. return out, nil
  42. }
  43. func (c *pkRpcClient) GetPkStatus(ctx context.Context, in *PkGetPkStatusReq) (*PkGetPkStatusResp, error) {
  44. out := new(PkGetPkStatusResp)
  45. err := doRpcRequest(ctx, c.client, 1, "Pk.getPkStatus", in, out)
  46. if err != nil {
  47. return nil, err
  48. }
  49. return out, nil
  50. }
  51. func (c *pkRpcClient) GetPkIdsByRoomIds(ctx context.Context, in *PkGetPkIdsByRoomIdsReq) (*PkGetPkIdsByRoomIdsResp, error) {
  52. out := new(PkGetPkIdsByRoomIdsResp)
  53. err := doRpcRequest(ctx, c.client, 1, "Pk.getPkIdsByRoomIds", in, out)
  54. if err != nil {
  55. return nil, err
  56. }
  57. return out, nil
  58. }