service

package
v0.0.0-...-e2b7729 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyResetPassword     = "-forget-password"
	KeyAccountActivation = "-account-activation"
)

KeyResetPassword and KeyAccountActivation are used for addition key to get value from redis

Variables

This section is empty.

Functions

This section is empty.

Types

type UserService

type UserService interface {
	// no-auth
	Register(ctx context.Context, data model.UserRegister) (id int, err error)
	AccountActivation(ctx context.Context, data model.UserActivation) (err error)
	Login(ctx context.Context, data model.UserLogin) (token string, err error)
	ForgetPassword(ctx context.Context, user model.UserForgetPassword) (err error)
	ResetPassword(ctx context.Context, user model.UserResetPassword) (err error)
	// auth+admin
	GetAll(ctx context.Context, filter model.RequestGetAll) (users []model.User, total int, err error)
	SoftDelete(ctx context.Context, id int) (err error)
	// auth
	MyProfile(ctx context.Context, id int) (profile model.User, err error)
	Logout(c *fiber.Ctx) (err error)
	UpdateProfile(ctx context.Context, data model.UserUpdate) (err error)
	UpdatePassword(ctx context.Context, data model.UserPasswordUpdate) (err error)
	DeleteAccount(ctx context.Context, data model.UserDeleteAccount) (err error)
}

func NewUserService

func NewUserService() UserService

type UserServiceImpl

type UserServiceImpl struct {
	// contains filtered or unexported fields
}

func (*UserServiceImpl) AccountActivation

func (svc *UserServiceImpl) AccountActivation(ctx context.Context, data model.UserActivation) (err error)

func (*UserServiceImpl) DeleteAccount

func (svc *UserServiceImpl) DeleteAccount(ctx context.Context, data model.UserDeleteAccount) (err error)

func (*UserServiceImpl) ForgetPassword

func (svc *UserServiceImpl) ForgetPassword(ctx context.Context, data model.UserForgetPassword) (err error)

func (*UserServiceImpl) GetAll

func (svc *UserServiceImpl) GetAll(ctx context.Context, filter model.RequestGetAll) (users []model.User, total int, err error)

func (*UserServiceImpl) Login

func (svc *UserServiceImpl) Login(ctx context.Context, data model.UserLogin) (token string, err error)

func (*UserServiceImpl) Logout

func (svc *UserServiceImpl) Logout(c *fiber.Ctx) (err error)

func (*UserServiceImpl) MyProfile

func (svc *UserServiceImpl) MyProfile(ctx context.Context, id int) (profile model.User, err error)

func (*UserServiceImpl) Register

func (svc *UserServiceImpl) Register(ctx context.Context, data model.UserRegister) (id int, err error)

func (*UserServiceImpl) ResetPassword

func (svc *UserServiceImpl) ResetPassword(ctx context.Context, data model.UserResetPassword) (err error)

func (*UserServiceImpl) SoftDelete

func (svc *UserServiceImpl) SoftDelete(ctx context.Context, id int) (err error)

func (*UserServiceImpl) UpdatePassword

func (svc *UserServiceImpl) UpdatePassword(ctx context.Context, data model.UserPasswordUpdate) (err error)

func (*UserServiceImpl) UpdateProfile

func (svc *UserServiceImpl) UpdateProfile(ctx context.Context, data model.UserUpdate) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL