Room.liverpc.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
  2. // source: v2/Room.proto
  3. /*
  4. Package v2 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. v2/Room.proto
  8. */
  9. package v2
  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. // Room Interface
  17. // ==============
  18. type RoomRPCClient interface {
  19. // * 根据房间id获取房间信息v2
  20. // 修正:原来的get_info_by_id 在传了fields字段但是不包含roomid的情况下 依然会返回所有字段, 新版修正这个问题, 只会返回指定的字段.
  21. GetByIds(ctx context.Context, req *RoomGetByIdsReq, opts ...liverpc.CallOption) (resp *RoomGetByIdsResp, err error)
  22. }
  23. // ====================
  24. // Room Live Rpc Client
  25. // ====================
  26. type roomRPCClient struct {
  27. client *liverpc.Client
  28. }
  29. // NewRoomRPCClient creates a client that implements the RoomRPCClient interface.
  30. func NewRoomRPCClient(client *liverpc.Client) RoomRPCClient {
  31. return &roomRPCClient{
  32. client: client,
  33. }
  34. }
  35. func (c *roomRPCClient) GetByIds(ctx context.Context, in *RoomGetByIdsReq, opts ...liverpc.CallOption) (*RoomGetByIdsResp, error) {
  36. out := new(RoomGetByIdsResp)
  37. err := doRPCRequest(ctx, c.client, 2, "Room.get_by_ids", in, out, opts)
  38. if err != nil {
  39. return nil, err
  40. }
  41. return out, nil
  42. }
  43. // =====
  44. // Utils
  45. // =====
  46. func doRPCRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message, opts []liverpc.CallOption) (err error) {
  47. err = client.Call(ctx, version, method, in, out, opts...)
  48. return
  49. }