chat_grpc.pb.go 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. CreateUserPartnerIsRelationship(ctx context.Context, in *common.UserAndPartnerParam, opts ...grpc.CallOption) (*CreateUserPartnerIsRelationshipReply, error)
  22. // 查询在线人的列表
  23. FindOnlinePersonList(ctx context.Context, in *common.ListPageAndPersonRequest, opts ...grpc.CallOption) (*common.OnlinePersonListReply, error)
  24. Receive(ctx context.Context, in *ReceiveRequest, opts ...grpc.CallOption) (*ReceiveReply, error)
  25. }
  26. type chatClient struct {
  27. cc grpc.ClientConnInterface
  28. }
  29. func NewChatClient(cc grpc.ClientConnInterface) ChatClient {
  30. return &chatClient{cc}
  31. }
  32. func (c *chatClient) CheckUserPartnerIsRelationship(ctx context.Context, in *common.UserAndPartnerIdParam, opts ...grpc.CallOption) (*CheckUserPartnerIsRelationshipReply, error) {
  33. out := new(CheckUserPartnerIsRelationshipReply)
  34. err := c.cc.Invoke(ctx, "/api.chat.Chat/CheckUserPartnerIsRelationship", in, out, opts...)
  35. if err != nil {
  36. return nil, err
  37. }
  38. return out, nil
  39. }
  40. func (c *chatClient) CreateUserPartnerIsRelationship(ctx context.Context, in *common.UserAndPartnerParam, opts ...grpc.CallOption) (*CreateUserPartnerIsRelationshipReply, error) {
  41. out := new(CreateUserPartnerIsRelationshipReply)
  42. err := c.cc.Invoke(ctx, "/api.chat.Chat/CreateUserPartnerIsRelationship", in, out, opts...)
  43. if err != nil {
  44. return nil, err
  45. }
  46. return out, nil
  47. }
  48. func (c *chatClient) FindOnlinePersonList(ctx context.Context, in *common.ListPageAndPersonRequest, opts ...grpc.CallOption) (*common.OnlinePersonListReply, error) {
  49. out := new(common.OnlinePersonListReply)
  50. err := c.cc.Invoke(ctx, "/api.chat.Chat/FindOnlinePersonList", in, out, opts...)
  51. if err != nil {
  52. return nil, err
  53. }
  54. return out, nil
  55. }
  56. func (c *chatClient) Receive(ctx context.Context, in *ReceiveRequest, opts ...grpc.CallOption) (*ReceiveReply, error) {
  57. out := new(ReceiveReply)
  58. err := c.cc.Invoke(ctx, "/api.chat.Chat/Receive", in, out, opts...)
  59. if err != nil {
  60. return nil, err
  61. }
  62. return out, nil
  63. }
  64. // ChatServer is the server API for Chat service.
  65. // All implementations must embed UnimplementedChatServer
  66. // for forward compatibility
  67. type ChatServer interface {
  68. // 检查用户是否与接待员聊天
  69. CheckUserPartnerIsRelationship(context.Context, *common.UserAndPartnerIdParam) (*CheckUserPartnerIsRelationshipReply, error)
  70. // 创建用户与接待员的聊天
  71. CreateUserPartnerIsRelationship(context.Context, *common.UserAndPartnerParam) (*CreateUserPartnerIsRelationshipReply, error)
  72. // 查询在线人的列表
  73. FindOnlinePersonList(context.Context, *common.ListPageAndPersonRequest) (*common.OnlinePersonListReply, error)
  74. Receive(context.Context, *ReceiveRequest) (*ReceiveReply, error)
  75. mustEmbedUnimplementedChatServer()
  76. }
  77. // UnimplementedChatServer must be embedded to have forward compatible implementations.
  78. type UnimplementedChatServer struct {
  79. }
  80. func (UnimplementedChatServer) CheckUserPartnerIsRelationship(context.Context, *common.UserAndPartnerIdParam) (*CheckUserPartnerIsRelationshipReply, error) {
  81. return nil, status.Errorf(codes.Unimplemented, "method CheckUserPartnerIsRelationship not implemented")
  82. }
  83. func (UnimplementedChatServer) CreateUserPartnerIsRelationship(context.Context, *common.UserAndPartnerParam) (*CreateUserPartnerIsRelationshipReply, error) {
  84. return nil, status.Errorf(codes.Unimplemented, "method CreateUserPartnerIsRelationship not implemented")
  85. }
  86. func (UnimplementedChatServer) FindOnlinePersonList(context.Context, *common.ListPageAndPersonRequest) (*common.OnlinePersonListReply, error) {
  87. return nil, status.Errorf(codes.Unimplemented, "method FindOnlinePersonList not implemented")
  88. }
  89. func (UnimplementedChatServer) Receive(context.Context, *ReceiveRequest) (*ReceiveReply, error) {
  90. return nil, status.Errorf(codes.Unimplemented, "method Receive not implemented")
  91. }
  92. func (UnimplementedChatServer) mustEmbedUnimplementedChatServer() {}
  93. // UnsafeChatServer may be embedded to opt out of forward compatibility for this service.
  94. // Use of this interface is not recommended, as added methods to ChatServer will
  95. // result in compilation errors.
  96. type UnsafeChatServer interface {
  97. mustEmbedUnimplementedChatServer()
  98. }
  99. func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer) {
  100. s.RegisterService(&Chat_ServiceDesc, srv)
  101. }
  102. func _Chat_CheckUserPartnerIsRelationship_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  103. in := new(common.UserAndPartnerIdParam)
  104. if err := dec(in); err != nil {
  105. return nil, err
  106. }
  107. if interceptor == nil {
  108. return srv.(ChatServer).CheckUserPartnerIsRelationship(ctx, in)
  109. }
  110. info := &grpc.UnaryServerInfo{
  111. Server: srv,
  112. FullMethod: "/api.chat.Chat/CheckUserPartnerIsRelationship",
  113. }
  114. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  115. return srv.(ChatServer).CheckUserPartnerIsRelationship(ctx, req.(*common.UserAndPartnerIdParam))
  116. }
  117. return interceptor(ctx, in, info, handler)
  118. }
  119. func _Chat_CreateUserPartnerIsRelationship_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  120. in := new(common.UserAndPartnerParam)
  121. if err := dec(in); err != nil {
  122. return nil, err
  123. }
  124. if interceptor == nil {
  125. return srv.(ChatServer).CreateUserPartnerIsRelationship(ctx, in)
  126. }
  127. info := &grpc.UnaryServerInfo{
  128. Server: srv,
  129. FullMethod: "/api.chat.Chat/CreateUserPartnerIsRelationship",
  130. }
  131. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  132. return srv.(ChatServer).CreateUserPartnerIsRelationship(ctx, req.(*common.UserAndPartnerParam))
  133. }
  134. return interceptor(ctx, in, info, handler)
  135. }
  136. func _Chat_FindOnlinePersonList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  137. in := new(common.ListPageAndPersonRequest)
  138. if err := dec(in); err != nil {
  139. return nil, err
  140. }
  141. if interceptor == nil {
  142. return srv.(ChatServer).FindOnlinePersonList(ctx, in)
  143. }
  144. info := &grpc.UnaryServerInfo{
  145. Server: srv,
  146. FullMethod: "/api.chat.Chat/FindOnlinePersonList",
  147. }
  148. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  149. return srv.(ChatServer).FindOnlinePersonList(ctx, req.(*common.ListPageAndPersonRequest))
  150. }
  151. return interceptor(ctx, in, info, handler)
  152. }
  153. func _Chat_Receive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  154. in := new(ReceiveRequest)
  155. if err := dec(in); err != nil {
  156. return nil, err
  157. }
  158. if interceptor == nil {
  159. return srv.(ChatServer).Receive(ctx, in)
  160. }
  161. info := &grpc.UnaryServerInfo{
  162. Server: srv,
  163. FullMethod: "/api.chat.Chat/Receive",
  164. }
  165. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  166. return srv.(ChatServer).Receive(ctx, req.(*ReceiveRequest))
  167. }
  168. return interceptor(ctx, in, info, handler)
  169. }
  170. // Chat_ServiceDesc is the grpc.ServiceDesc for Chat service.
  171. // It's only intended for direct use with grpc.RegisterService,
  172. // and not to be introspected or modified (even as a copy)
  173. var Chat_ServiceDesc = grpc.ServiceDesc{
  174. ServiceName: "api.chat.Chat",
  175. HandlerType: (*ChatServer)(nil),
  176. Methods: []grpc.MethodDesc{
  177. {
  178. MethodName: "CheckUserPartnerIsRelationship",
  179. Handler: _Chat_CheckUserPartnerIsRelationship_Handler,
  180. },
  181. {
  182. MethodName: "CreateUserPartnerIsRelationship",
  183. Handler: _Chat_CreateUserPartnerIsRelationship_Handler,
  184. },
  185. {
  186. MethodName: "FindOnlinePersonList",
  187. Handler: _Chat_FindOnlinePersonList_Handler,
  188. },
  189. {
  190. MethodName: "Receive",
  191. Handler: _Chat_Receive_Handler,
  192. },
  193. },
  194. Streams: []grpc.StreamDesc{},
  195. Metadata: "chat.proto",
  196. }