// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: user.proto

package services

import (
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	math "math"
)

import (
	context "context"
	api "github.com/micro/go-micro/v2/api"
	client "github.com/micro/go-micro/v2/client"
	server "github.com/micro/go-micro/v2/server"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option

// Api Endpoints for UserService service

func NewUserServiceEndpoints() []*api.Endpoint {
	return []*api.Endpoint{}
}

// Client API for UserService service

type UserService interface {
	Login(ctx context.Context, in *DouyinUserLoginRequest, opts ...client.CallOption) (*DouyinUserLoginResponse, error)
	Register(ctx context.Context, in *DouyinUserRegisterRequest, opts ...client.CallOption) (*DouyinUserRegisterResponse, error)
	UserInfo(ctx context.Context, in *DouyinUserRequest, opts ...client.CallOption) (*DouyinUserResponse, error)
}

type userService struct {
	c    client.Client
	name string
}

func NewUserService(name string, c client.Client) UserService {
	return &userService{
		c:    c,
		name: name,
	}
}

func (c *userService) Login(ctx context.Context, in *DouyinUserLoginRequest, opts ...client.CallOption) (*DouyinUserLoginResponse, error) {
	req := c.c.NewRequest(c.name, "UserService.Login", in)
	out := new(DouyinUserLoginResponse)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *userService) Register(ctx context.Context, in *DouyinUserRegisterRequest, opts ...client.CallOption) (*DouyinUserRegisterResponse, error) {
	req := c.c.NewRequest(c.name, "UserService.Register", in)
	out := new(DouyinUserRegisterResponse)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *userService) UserInfo(ctx context.Context, in *DouyinUserRequest, opts ...client.CallOption) (*DouyinUserResponse, error) {
	req := c.c.NewRequest(c.name, "UserService.UserInfo", in)
	out := new(DouyinUserResponse)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for UserService service

type UserServiceHandler interface {
	Login(context.Context, *DouyinUserLoginRequest, *DouyinUserLoginResponse) error
	Register(context.Context, *DouyinUserRegisterRequest, *DouyinUserRegisterResponse) error
	UserInfo(context.Context, *DouyinUserRequest, *DouyinUserResponse) error
}

func RegisterUserServiceHandler(s server.Server, hdlr UserServiceHandler, opts ...server.HandlerOption) error {
	type userService interface {
		Login(ctx context.Context, in *DouyinUserLoginRequest, out *DouyinUserLoginResponse) error
		Register(ctx context.Context, in *DouyinUserRegisterRequest, out *DouyinUserRegisterResponse) error
		UserInfo(ctx context.Context, in *DouyinUserRequest, out *DouyinUserResponse) error
	}
	type UserService struct {
		userService
	}
	h := &userServiceHandler{hdlr}
	return s.Handle(s.NewHandler(&UserService{h}, opts...))
}

type userServiceHandler struct {
	UserServiceHandler
}

func (h *userServiceHandler) Login(ctx context.Context, in *DouyinUserLoginRequest, out *DouyinUserLoginResponse) error {
	return h.UserServiceHandler.Login(ctx, in, out)
}

func (h *userServiceHandler) Register(ctx context.Context, in *DouyinUserRegisterRequest, out *DouyinUserRegisterResponse) error {
	return h.UserServiceHandler.Register(ctx, in, out)
}

func (h *userServiceHandler) UserInfo(ctx context.Context, in *DouyinUserRequest, out *DouyinUserResponse) error {
	return h.UserServiceHandler.UserInfo(ctx, in, out)
}
