// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v7.35.0
// source: module/base/passport/proto/login.proto

package passport

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	Login_Pwd_FullMethodName   = "/passport.Login/Pwd"
	Login_Code_FullMethodName  = "/passport.Login/Code"
	Login_Quick_FullMethodName = "/passport.Login/Quick"
)

// LoginClient is the client API for Login service.
//
// 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.
//
// Passport-通行证模块-登录
type LoginClient interface {
	// 通过密码登录
	Pwd(ctx context.Context, in *LoginByPwdRequest, opts ...grpc.CallOption) (*LoginReply, error)
	// 通过验证码登录
	Code(ctx context.Context, in *LoginByCodeRequest, opts ...grpc.CallOption) (*LoginReply, error)
	// 通过验证码快捷登录并注册
	Quick(ctx context.Context, in *LoginByCodeRequest, opts ...grpc.CallOption) (*LoginReply, error)
}

type loginClient struct {
	cc grpc.ClientConnInterface
}

func NewLoginClient(cc grpc.ClientConnInterface) LoginClient {
	return &loginClient{cc}
}

func (c *loginClient) Pwd(ctx context.Context, in *LoginByPwdRequest, opts ...grpc.CallOption) (*LoginReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(LoginReply)
	err := c.cc.Invoke(ctx, Login_Pwd_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loginClient) Code(ctx context.Context, in *LoginByCodeRequest, opts ...grpc.CallOption) (*LoginReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(LoginReply)
	err := c.cc.Invoke(ctx, Login_Code_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loginClient) Quick(ctx context.Context, in *LoginByCodeRequest, opts ...grpc.CallOption) (*LoginReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(LoginReply)
	err := c.cc.Invoke(ctx, Login_Quick_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// LoginServer is the server API for Login service.
// All implementations should embed UnimplementedLoginServer
// for forward compatibility.
//
// Passport-通行证模块-登录
type LoginServer interface {
	// 通过密码登录
	Pwd(context.Context, *LoginByPwdRequest) (*LoginReply, error)
	// 通过验证码登录
	Code(context.Context, *LoginByCodeRequest) (*LoginReply, error)
	// 通过验证码快捷登录并注册
	Quick(context.Context, *LoginByCodeRequest) (*LoginReply, error)
}

// UnimplementedLoginServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedLoginServer struct{}

func (UnimplementedLoginServer) Pwd(context.Context, *LoginByPwdRequest) (*LoginReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Pwd not implemented")
}
func (UnimplementedLoginServer) Code(context.Context, *LoginByCodeRequest) (*LoginReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Code not implemented")
}
func (UnimplementedLoginServer) Quick(context.Context, *LoginByCodeRequest) (*LoginReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Quick not implemented")
}
func (UnimplementedLoginServer) testEmbeddedByValue() {}

// UnsafeLoginServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to LoginServer will
// result in compilation errors.
type UnsafeLoginServer interface {
	mustEmbedUnimplementedLoginServer()
}

func RegisterLoginServer(s grpc.ServiceRegistrar, srv LoginServer) {
	// If the following call panics, it indicates UnimplementedLoginServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&Login_ServiceDesc, srv)
}

func _Login_Pwd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(LoginByPwdRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoginServer).Pwd(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Login_Pwd_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoginServer).Pwd(ctx, req.(*LoginByPwdRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Login_Code_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(LoginByCodeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoginServer).Code(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Login_Code_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoginServer).Code(ctx, req.(*LoginByCodeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Login_Quick_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(LoginByCodeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoginServer).Quick(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Login_Quick_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoginServer).Quick(ctx, req.(*LoginByCodeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Login_ServiceDesc is the grpc.ServiceDesc for Login service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Login_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "passport.Login",
	HandlerType: (*LoginServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Pwd",
			Handler:    _Login_Pwd_Handler,
		},
		{
			MethodName: "Code",
			Handler:    _Login_Code_Handler,
		},
		{
			MethodName: "Quick",
			Handler:    _Login_Quick_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/base/passport/proto/login.proto",
}
