chat_grpc.pb.go 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package chat
  3. import (
  4. context "context"
  5. common "git.ikuban.com/server/pw-protobuf/api/common"
  6. grpc "google.golang.org/grpc"
  7. codes "google.golang.org/grpc/codes"
  8. status "google.golang.org/grpc/status"
  9. )
  10. // This is a compile-time assertion to ensure that this generated file
  11. // is compatible with the grpc package it is being compiled against.
  12. // Requires gRPC-Go v1.32.0 or later.
  13. const _ = grpc.SupportPackageIsVersion7
  14. // ChatClient is the client API for Chat service.
  15. //
  16. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
  17. type ChatClient interface {
  18. // 检查用户是否与接待员聊天
  19. CheckUserPartnerIsRelationship(ctx context.Context, in *common.UserAndPartnerIdParam, opts ...grpc.CallOption) (*CheckUserPartnerIsRelationshipReply, error)
  20. // 创建聊天房间
  21. CreateChatRoom(ctx context.Context, in *CreateChatRoomParam, opts ...grpc.CallOption) (*RoomReply, error)
  22. // 查询在线人的列表
  23. FindOnlinePersonList(ctx context.Context, in *common.ListPageAndPersonRequest, opts ...grpc.CallOption) (*common.OnlinePersonListReply, error)
  24. // 接待员查询房间列表
  25. PartnerFindRoomList(ctx context.Context, in *PartnerFindRoomListRequest, opts ...grpc.CallOption) (*PartnerFindRoomListReply, error)
  26. Receive(ctx context.Context, in *ReceiveRequest, opts ...grpc.CallOption) (*ReceiveReply, error)
  27. }
  28. type chatClient struct {
  29. cc grpc.ClientConnInterface
  30. }
  31. func NewChatClient(cc grpc.ClientConnInterface) ChatClient {
  32. return &chatClient{cc}
  33. }
  34. func (c *chatClient) CheckUserPartnerIsRelationship(ctx context.Context, in *common.UserAndPartnerIdParam, opts ...grpc.CallOption) (*CheckUserPartnerIsRelationshipReply, error) {
  35. out := new(CheckUserPartnerIsRelationshipReply)
  36. err := c.cc.Invoke(ctx, "/api.chat.Chat/CheckUserPartnerIsRelationship", in, out, opts...)
  37. if err != nil {
  38. return nil, err
  39. }
  40. return out, nil
  41. }
  42. func (c *chatClient) CreateChatRoom(ctx context.Context, in *CreateChatRoomParam, opts ...grpc.CallOption) (*RoomReply, error) {
  43. out := new(RoomReply)
  44. err := c.cc.Invoke(ctx, "/api.chat.Chat/CreateChatRoom", in, out, opts...)
  45. if err != nil {
  46. return nil, err
  47. }
  48. return out, nil
  49. }
  50. func (c *chatClient) FindOnlinePersonList(ctx context.Context, in *common.ListPageAndPersonRequest, opts ...grpc.CallOption) (*common.OnlinePersonListReply, error) {
  51. out := new(common.OnlinePersonListReply)
  52. err := c.cc.Invoke(ctx, "/api.chat.Chat/FindOnlinePersonList", in, out, opts...)
  53. if err != nil {
  54. return nil, err
  55. }
  56. return out, nil
  57. }
  58. func (c *chatClient) PartnerFindRoomList(ctx context.Context, in *PartnerFindRoomListRequest, opts ...grpc.CallOption) (*PartnerFindRoomListReply, error) {
  59. out := new(PartnerFindRoomListReply)
  60. err := c.cc.Invoke(ctx, "/api.chat.Chat/PartnerFindRoomList", in, out, opts...)
  61. if err != nil {
  62. return nil, err
  63. }
  64. return out, nil
  65. }
  66. func (c *chatClient) Receive(ctx context.Context, in *ReceiveRequest, opts ...grpc.CallOption) (*ReceiveReply, error) {
  67. out := new(ReceiveReply)
  68. err := c.cc.Invoke(ctx, "/api.chat.Chat/Receive", in, out, opts...)
  69. if err != nil {
  70. return nil, err
  71. }
  72. return out, nil
  73. }
  74. // ChatServer is the server API for Chat service.
  75. // All implementations must embed UnimplementedChatServer
  76. // for forward compatibility
  77. type ChatServer interface {
  78. // 检查用户是否与接待员聊天
  79. CheckUserPartnerIsRelationship(context.Context, *common.UserAndPartnerIdParam) (*CheckUserPartnerIsRelationshipReply, error)
  80. // 创建聊天房间
  81. CreateChatRoom(context.Context, *CreateChatRoomParam) (*RoomReply, error)
  82. // 查询在线人的列表
  83. FindOnlinePersonList(context.Context, *common.ListPageAndPersonRequest) (*common.OnlinePersonListReply, error)
  84. // 接待员查询房间列表
  85. PartnerFindRoomList(context.Context, *PartnerFindRoomListRequest) (*PartnerFindRoomListReply, error)
  86. Receive(context.Context, *ReceiveRequest) (*ReceiveReply, error)
  87. mustEmbedUnimplementedChatServer()
  88. }
  89. // UnimplementedChatServer must be embedded to have forward compatible implementations.
  90. type UnimplementedChatServer struct {
  91. }
  92. func (UnimplementedChatServer) CheckUserPartnerIsRelationship(context.Context, *common.UserAndPartnerIdParam) (*CheckUserPartnerIsRelationshipReply, error) {
  93. return nil, status.Errorf(codes.Unimplemented, "method CheckUserPartnerIsRelationship not implemented")
  94. }
  95. func (UnimplementedChatServer) CreateChatRoom(context.Context, *CreateChatRoomParam) (*RoomReply, error) {
  96. return nil, status.Errorf(codes.Unimplemented, "method CreateChatRoom not implemented")
  97. }
  98. func (UnimplementedChatServer) FindOnlinePersonList(context.Context, *common.ListPageAndPersonRequest) (*common.OnlinePersonListReply, error) {
  99. return nil, status.Errorf(codes.Unimplemented, "method FindOnlinePersonList not implemented")
  100. }
  101. func (UnimplementedChatServer) PartnerFindRoomList(context.Context, *PartnerFindRoomListRequest) (*PartnerFindRoomListReply, error) {
  102. return nil, status.Errorf(codes.Unimplemented, "method PartnerFindRoomList not implemented")
  103. }
  104. func (UnimplementedChatServer) Receive(context.Context, *ReceiveRequest) (*ReceiveReply, error) {
  105. return nil, status.Errorf(codes.Unimplemented, "method Receive not implemented")
  106. }
  107. func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
  108. // UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
  109. // Use of this interface is not recommended, as added methods to ChatServer will
  110. // result in compilation errors.
  111. type UnsafeChatServer interface {
  112. mustEmbedUnimplementedChatServer()
  113. }
  114. func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer) {
  115. s.RegisterService(&Chat_ServiceDesc, srv)
  116. }
  117. func _Chat_CheckUserPartnerIsRelationship_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  118. in := new(common.UserAndPartnerIdParam)
  119. if err := dec(in); err != nil {
  120. return nil, err
  121. }
  122. if interceptor == nil {
  123. return srv.(ChatServer).CheckUserPartnerIsRelationship(ctx, in)
  124. }
  125. info := &grpc.UnaryServerInfo{
  126. Server: srv,
  127. FullMethod: "/api.chat.Chat/CheckUserPartnerIsRelationship",
  128. }
  129. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  130. return srv.(ChatServer).CheckUserPartnerIsRelationship(ctx, req.(*common.UserAndPartnerIdParam))
  131. }
  132. return interceptor(ctx, in, info, handler)
  133. }
  134. func _Chat_CreateChatRoom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  135. in := new(CreateChatRoomParam)
  136. if err := dec(in); err != nil {
  137. return nil, err
  138. }
  139. if interceptor == nil {
  140. return srv.(ChatServer).CreateChatRoom(ctx, in)
  141. }
  142. info := &grpc.UnaryServerInfo{
  143. Server: srv,
  144. FullMethod: "/api.chat.Chat/CreateChatRoom",
  145. }
  146. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  147. return srv.(ChatServer).CreateChatRoom(ctx, req.(*CreateChatRoomParam))
  148. }
  149. return interceptor(ctx, in, info, handler)
  150. }
  151. func _Chat_FindOnlinePersonList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  152. in := new(common.ListPageAndPersonRequest)
  153. if err := dec(in); err != nil {
  154. return nil, err
  155. }
  156. if interceptor == nil {
  157. return srv.(ChatServer).FindOnlinePersonList(ctx, in)
  158. }
  159. info := &grpc.UnaryServerInfo{
  160. Server: srv,
  161. FullMethod: "/api.chat.Chat/FindOnlinePersonList",
  162. }
  163. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  164. return srv.(ChatServer).FindOnlinePersonList(ctx, req.(*common.ListPageAndPersonRequest))
  165. }
  166. return interceptor(ctx, in, info, handler)
  167. }
  168. func _Chat_PartnerFindRoomList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  169. in := new(PartnerFindRoomListRequest)
  170. if err := dec(in); err != nil {
  171. return nil, err
  172. }
  173. if interceptor == nil {
  174. return srv.(ChatServer).PartnerFindRoomList(ctx, in)
  175. }
  176. info := &grpc.UnaryServerInfo{
  177. Server: srv,
  178. FullMethod: "/api.chat.Chat/PartnerFindRoomList",
  179. }
  180. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  181. return srv.(ChatServer).PartnerFindRoomList(ctx, req.(*PartnerFindRoomListRequest))
  182. }
  183. return interceptor(ctx, in, info, handler)
  184. }
  185. func _Chat_Receive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  186. in := new(ReceiveRequest)
  187. if err := dec(in); err != nil {
  188. return nil, err
  189. }
  190. if interceptor == nil {
  191. return srv.(ChatServer).Receive(ctx, in)
  192. }
  193. info := &grpc.UnaryServerInfo{
  194. Server: srv,
  195. FullMethod: "/api.chat.Chat/Receive",
  196. }
  197. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  198. return srv.(ChatServer).Receive(ctx, req.(*ReceiveRequest))
  199. }
  200. return interceptor(ctx, in, info, handler)
  201. }
  202. // Chat_ServiceDesc is the grpc.ServiceDesc for Chat service.
  203. // It's only intended for direct use with grpc.RegisterService,
  204. // and not to be introspected or modified (even as a copy)
  205. var Chat_ServiceDesc = grpc.ServiceDesc{
  206. ServiceName: "api.chat.Chat",
  207. HandlerType: (*ChatServer)(nil),
  208. Methods: []grpc.MethodDesc{
  209. {
  210. MethodName: "CheckUserPartnerIsRelationship",
  211. Handler: _Chat_CheckUserPartnerIsRelationship_Handler,
  212. },
  213. {
  214. MethodName: "CreateChatRoom",
  215. Handler: _Chat_CreateChatRoom_Handler,
  216. },
  217. {
  218. MethodName: "FindOnlinePersonList",
  219. Handler: _Chat_FindOnlinePersonList_Handler,
  220. },
  221. {
  222. MethodName: "PartnerFindRoomList",
  223. Handler: _Chat_PartnerFindRoomList_Handler,
  224. },
  225. {
  226. MethodName: "Receive",
  227. Handler: _Chat_Receive_Handler,
  228. },
  229. },
  230. Streams: []grpc.StreamDesc{},
  231. Metadata: "chat.proto",
  232. }