package users

import (
	userv1 "quyun/v2/pkg/proto/user/v1"
	"quyun/v2/providers/grpc"

	"go.ipao.vip/atom"
	"go.ipao.vip/atom/container"
	"go.ipao.vip/atom/contracts"
	"go.ipao.vip/atom/opt"
)

func Provide(opts ...opt.Option) error {
	if err := container.Container.Provide(func(
		__grpc *grpc.Grpc,
	) (contracts.Initial, error) {
		obj := &Users{}
		userv1.RegisterUserServiceServer(__grpc.Server, obj)

		return obj, nil
	}, atom.GroupInitial); err != nil {
		return err
	}
	return nil
}
