user_grpc.pb.go 10 KB

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