// Code generated by goctl. DO NOT EDIT.
// Source: user.proto

package callbackservice

import (
	"context"

	"github.com/cherish-chat/xxim-server/common/pb"

	"github.com/zeromicro/go-zero/zrpc"
	"google.golang.org/grpc"
)

type (
	CreateRobotReq             = pb.CreateRobotReq
	CreateRobotResp            = pb.CreateRobotResp
	GetSelfUserInfoReq         = pb.GetSelfUserInfoReq
	GetSelfUserInfoResp        = pb.GetSelfUserInfoResp
	GetUserInfoReq             = pb.GetUserInfoReq
	GetUserInfoResp            = pb.GetUserInfoResp
	GetUserModelByIdReq        = pb.GetUserModelByIdReq
	GetUserModelByIdReq_Opt    = pb.GetUserModelByIdReq_Opt
	GetUserModelByIdResp       = pb.GetUserModelByIdResp
	GetUserModelByIdsReq       = pb.GetUserModelByIdsReq
	GetUserModelByIdsReq_Opt   = pb.GetUserModelByIdsReq_Opt
	GetUserModelByIdsResp      = pb.GetUserModelByIdsResp
	RefreshUserAccessTokenReq  = pb.RefreshUserAccessTokenReq
	RefreshUserAccessTokenResp = pb.RefreshUserAccessTokenResp
	ResetUserAccountMapReq     = pb.ResetUserAccountMapReq
	ResetUserAccountMapResp    = pb.ResetUserAccountMapResp
	RevokeUserAccessTokenReq   = pb.RevokeUserAccessTokenReq
	RevokeUserAccessTokenResp  = pb.RevokeUserAccessTokenResp
	UpdateUserAccountMapReq    = pb.UpdateUserAccountMapReq
	UpdateUserAccountMapResp   = pb.UpdateUserAccountMapResp
	UpdateUserCountMapReq      = pb.UpdateUserCountMapReq
	UpdateUserCountMapResp     = pb.UpdateUserCountMapResp
	UpdateUserExtraMapReq      = pb.UpdateUserExtraMapReq
	UpdateUserExtraMapResp     = pb.UpdateUserExtraMapResp
	UpdateUserProfileMapReq    = pb.UpdateUserProfileMapReq
	UpdateUserProfileMapResp   = pb.UpdateUserProfileMapResp
	UserAccessTokenReq         = pb.UserAccessTokenReq
	UserAccessTokenResp        = pb.UserAccessTokenResp
	UserAfterKeepAliveReq      = pb.UserAfterKeepAliveReq
	UserAfterKeepAliveResp     = pb.UserAfterKeepAliveResp
	UserAfterOfflineReq        = pb.UserAfterOfflineReq
	UserAfterOfflineResp       = pb.UserAfterOfflineResp
	UserAfterOnlineReq         = pb.UserAfterOnlineReq
	UserAfterOnlineResp        = pb.UserAfterOnlineResp
	UserBeforeConnectReq       = pb.UserBeforeConnectReq
	UserBeforeConnectResp      = pb.UserBeforeConnectResp
	UserBeforeRequestReq       = pb.UserBeforeRequestReq
	UserBeforeRequestResp      = pb.UserBeforeRequestResp
	UserDestroyReq             = pb.UserDestroyReq
	UserDestroyResp            = pb.UserDestroyResp
	UserRegisterReq            = pb.UserRegisterReq
	UserRegisterResp           = pb.UserRegisterResp

	CallbackService interface {
		// UserAfterOnline 用户上线回调
		UserAfterOnline(ctx context.Context, in *UserAfterOnlineReq, opts ...grpc.CallOption) (*UserAfterOnlineResp, error)
		// UserAfterOffline 用户下线回调
		UserAfterOffline(ctx context.Context, in *UserAfterOfflineReq, opts ...grpc.CallOption) (*UserAfterOfflineResp, error)
		// UserBeforeConnect 用户连接前的回调
		UserBeforeConnect(ctx context.Context, in *UserBeforeConnectReq, opts ...grpc.CallOption) (*UserBeforeConnectResp, error)
		// UserBeforeRequest 用户请求前的回调
		UserBeforeRequest(ctx context.Context, in *UserBeforeRequestReq, opts ...grpc.CallOption) (*UserBeforeRequestResp, error)
		// UserAfterKeepAlive 用户保活回调
		UserAfterKeepAlive(ctx context.Context, in *UserAfterKeepAliveReq, opts ...grpc.CallOption) (*UserAfterKeepAliveResp, error)
	}

	defaultCallbackService struct {
		cli zrpc.Client
	}
)

func NewCallbackService(cli zrpc.Client) CallbackService {
	return &defaultCallbackService{
		cli: cli,
	}
}

// UserAfterOnline 用户上线回调
func (m *defaultCallbackService) UserAfterOnline(ctx context.Context, in *UserAfterOnlineReq, opts ...grpc.CallOption) (*UserAfterOnlineResp, error) {
	client := pb.NewCallbackServiceClient(m.cli.Conn())
	return client.UserAfterOnline(ctx, in, opts...)
}

// UserAfterOffline 用户下线回调
func (m *defaultCallbackService) UserAfterOffline(ctx context.Context, in *UserAfterOfflineReq, opts ...grpc.CallOption) (*UserAfterOfflineResp, error) {
	client := pb.NewCallbackServiceClient(m.cli.Conn())
	return client.UserAfterOffline(ctx, in, opts...)
}

// UserBeforeConnect 用户连接前的回调
func (m *defaultCallbackService) UserBeforeConnect(ctx context.Context, in *UserBeforeConnectReq, opts ...grpc.CallOption) (*UserBeforeConnectResp, error) {
	client := pb.NewCallbackServiceClient(m.cli.Conn())
	return client.UserBeforeConnect(ctx, in, opts...)
}

// UserBeforeRequest 用户请求前的回调
func (m *defaultCallbackService) UserBeforeRequest(ctx context.Context, in *UserBeforeRequestReq, opts ...grpc.CallOption) (*UserBeforeRequestResp, error) {
	client := pb.NewCallbackServiceClient(m.cli.Conn())
	return client.UserBeforeRequest(ctx, in, opts...)
}

// UserAfterKeepAlive 用户保活回调
func (m *defaultCallbackService) UserAfterKeepAlive(ctx context.Context, in *UserAfterKeepAliveReq, opts ...grpc.CallOption) (*UserAfterKeepAliveResp, error) {
	client := pb.NewCallbackServiceClient(m.cli.Conn())
	return client.UserAfterKeepAlive(ctx, in, opts...)
}
