user_grpc.pb.go 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package user
  3. import (
  4. context "context"
  5. grpc "google.golang.org/grpc"
  6. codes "google.golang.org/grpc/codes"
  7. status "google.golang.org/grpc/status"
  8. emptypb "google.golang.org/protobuf/types/known/emptypb"
  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. // UserClient is the client API for User 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 UserClient interface {
  18. DebugLogin(ctx context.Context, in *DebugLoginRequest, opts ...grpc.CallOption) (*LoginReply, error)
  19. Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error)
  20. UpdateUserInformation(ctx context.Context, in *UpdateUserInformationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  21. UpdateUserPhone(ctx context.Context, in *UpdatePhoneRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  22. GetUserInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserInfo, error)
  23. }
  24. type userClient struct {
  25. cc grpc.ClientConnInterface
  26. }
  27. func NewUserClient(cc grpc.ClientConnInterface) UserClient {
  28. return &userClient{cc}
  29. }
  30. func (c *userClient) DebugLogin(ctx context.Context, in *DebugLoginRequest, opts ...grpc.CallOption) (*LoginReply, error) {
  31. out := new(LoginReply)
  32. err := c.cc.Invoke(ctx, "/api.user.User/DebugLogin", in, out, opts...)
  33. if err != nil {
  34. return nil, err
  35. }
  36. return out, nil
  37. }
  38. func (c *userClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) {
  39. out := new(LoginReply)
  40. err := c.cc.Invoke(ctx, "/api.user.User/Login", in, out, opts...)
  41. if err != nil {
  42. return nil, err
  43. }
  44. return out, nil
  45. }
  46. func (c *userClient) UpdateUserInformation(ctx context.Context, in *UpdateUserInformationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  47. out := new(emptypb.Empty)
  48. err := c.cc.Invoke(ctx, "/api.user.User/UpdateUserInformation", in, out, opts...)
  49. if err != nil {
  50. return nil, err
  51. }
  52. return out, nil
  53. }
  54. func (c *userClient) UpdateUserPhone(ctx context.Context, in *UpdatePhoneRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  55. out := new(emptypb.Empty)
  56. err := c.cc.Invoke(ctx, "/api.user.User/UpdateUserPhone", in, out, opts...)
  57. if err != nil {
  58. return nil, err
  59. }
  60. return out, nil
  61. }
  62. func (c *userClient) GetUserInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserInfo, error) {
  63. out := new(UserInfo)
  64. err := c.cc.Invoke(ctx, "/api.user.User/GetUserInfo", in, out, opts...)
  65. if err != nil {
  66. return nil, err
  67. }
  68. return out, nil
  69. }
  70. // UserServer is the server API for User service.
  71. // All implementations must embed UnimplementedUserServer
  72. // for forward compatibility
  73. type UserServer interface {
  74. DebugLogin(context.Context, *DebugLoginRequest) (*LoginReply, error)
  75. Login(context.Context, *LoginRequest) (*LoginReply, error)
  76. UpdateUserInformation(context.Context, *UpdateUserInformationRequest) (*emptypb.Empty, error)
  77. UpdateUserPhone(context.Context, *UpdatePhoneRequest) (*emptypb.Empty, error)
  78. GetUserInfo(context.Context, *emptypb.Empty) (*UserInfo, error)
  79. mustEmbedUnimplementedUserServer()
  80. }
  81. // UnimplementedUserServer must be embedded to have forward compatible implementations.
  82. type UnimplementedUserServer struct {
  83. }
  84. func (UnimplementedUserServer) DebugLogin(context.Context, *DebugLoginRequest) (*LoginReply, error) {
  85. return nil, status.Errorf(codes.Unimplemented, "method DebugLogin not implemented")
  86. }
  87. func (UnimplementedUserServer) Login(context.Context, *LoginRequest) (*LoginReply, error) {
  88. return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
  89. }
  90. func (UnimplementedUserServer) UpdateUserInformation(context.Context, *UpdateUserInformationRequest) (*emptypb.Empty, error) {
  91. return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInformation not implemented")
  92. }
  93. func (UnimplementedUserServer) UpdateUserPhone(context.Context, *UpdatePhoneRequest) (*emptypb.Empty, error) {
  94. return nil, status.Errorf(codes.Unimplemented, "method UpdateUserPhone not implemented")
  95. }
  96. func (UnimplementedUserServer) GetUserInfo(context.Context, *emptypb.Empty) (*UserInfo, error) {
  97. return nil, status.Errorf(codes.Unimplemented, "method GetUserInfo not implemented")
  98. }
  99. func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {}
  100. // UnsafeUserServer may be embedded to opt out of forward compatibility for this service.
  101. // Use of this interface is not recommended, as added methods to UserServer will
  102. // result in compilation errors.
  103. type UnsafeUserServer interface {
  104. mustEmbedUnimplementedUserServer()
  105. }
  106. func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer) {
  107. s.RegisterService(&User_ServiceDesc, srv)
  108. }
  109. func _User_DebugLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  110. in := new(DebugLoginRequest)
  111. if err := dec(in); err != nil {
  112. return nil, err
  113. }
  114. if interceptor == nil {
  115. return srv.(UserServer).DebugLogin(ctx, in)
  116. }
  117. info := &grpc.UnaryServerInfo{
  118. Server: srv,
  119. FullMethod: "/api.user.User/DebugLogin",
  120. }
  121. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  122. return srv.(UserServer).DebugLogin(ctx, req.(*DebugLoginRequest))
  123. }
  124. return interceptor(ctx, in, info, handler)
  125. }
  126. func _User_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  127. in := new(LoginRequest)
  128. if err := dec(in); err != nil {
  129. return nil, err
  130. }
  131. if interceptor == nil {
  132. return srv.(UserServer).Login(ctx, in)
  133. }
  134. info := &grpc.UnaryServerInfo{
  135. Server: srv,
  136. FullMethod: "/api.user.User/Login",
  137. }
  138. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  139. return srv.(UserServer).Login(ctx, req.(*LoginRequest))
  140. }
  141. return interceptor(ctx, in, info, handler)
  142. }
  143. func _User_UpdateUserInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  144. in := new(UpdateUserInformationRequest)
  145. if err := dec(in); err != nil {
  146. return nil, err
  147. }
  148. if interceptor == nil {
  149. return srv.(UserServer).UpdateUserInformation(ctx, in)
  150. }
  151. info := &grpc.UnaryServerInfo{
  152. Server: srv,
  153. FullMethod: "/api.user.User/UpdateUserInformation",
  154. }
  155. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  156. return srv.(UserServer).UpdateUserInformation(ctx, req.(*UpdateUserInformationRequest))
  157. }
  158. return interceptor(ctx, in, info, handler)
  159. }
  160. func _User_UpdateUserPhone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  161. in := new(UpdatePhoneRequest)
  162. if err := dec(in); err != nil {
  163. return nil, err
  164. }
  165. if interceptor == nil {
  166. return srv.(UserServer).UpdateUserPhone(ctx, in)
  167. }
  168. info := &grpc.UnaryServerInfo{
  169. Server: srv,
  170. FullMethod: "/api.user.User/UpdateUserPhone",
  171. }
  172. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  173. return srv.(UserServer).UpdateUserPhone(ctx, req.(*UpdatePhoneRequest))
  174. }
  175. return interceptor(ctx, in, info, handler)
  176. }
  177. func _User_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  178. in := new(emptypb.Empty)
  179. if err := dec(in); err != nil {
  180. return nil, err
  181. }
  182. if interceptor == nil {
  183. return srv.(UserServer).GetUserInfo(ctx, in)
  184. }
  185. info := &grpc.UnaryServerInfo{
  186. Server: srv,
  187. FullMethod: "/api.user.User/GetUserInfo",
  188. }
  189. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  190. return srv.(UserServer).GetUserInfo(ctx, req.(*emptypb.Empty))
  191. }
  192. return interceptor(ctx, in, info, handler)
  193. }
  194. // User_ServiceDesc is the grpc.ServiceDesc for User service.
  195. // It's only intended for direct use with grpc.RegisterService,
  196. // and not to be introspected or modified (even as a copy)
  197. var User_ServiceDesc = grpc.ServiceDesc{
  198. ServiceName: "api.user.User",
  199. HandlerType: (*UserServer)(nil),
  200. Methods: []grpc.MethodDesc{
  201. {
  202. MethodName: "DebugLogin",
  203. Handler: _User_DebugLogin_Handler,
  204. },
  205. {
  206. MethodName: "Login",
  207. Handler: _User_Login_Handler,
  208. },
  209. {
  210. MethodName: "UpdateUserInformation",
  211. Handler: _User_UpdateUserInformation_Handler,
  212. },
  213. {
  214. MethodName: "UpdateUserPhone",
  215. Handler: _User_UpdateUserPhone_Handler,
  216. },
  217. {
  218. MethodName: "GetUserInfo",
  219. Handler: _User_GetUserInfo_Handler,
  220. },
  221. },
  222. Streams: []grpc.StreamDesc{},
  223. Metadata: "user.proto",
  224. }