service

package
v0.0.0-...-0d7ea6f Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOCAL_URL          = "http://localhost:3000"
	VERIFY_EMAIL_ROUTE = "register/verify_email"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTService

type JWTService interface {
	GenerateToken(userId string, role string) string
	ValidateToken(token string) (*jwt.Token, error)
	GetUserIDByToken(token string) (string, string, error)
}

func NewJWTService

func NewJWTService() JWTService

type TaskService

type TaskService interface {
	CreateTask(ctx context.Context, req dto.TaskCreateRequest, userID string) (dto.TaskResponse, error)
	GetTaskByID(ctx context.Context, taskID uuid.UUID) (dto.TaskResponse, error)
	UpdateTask(ctx context.Context, taskID uuid.UUID, userID string, req dto.TaskUpdateRequest) (dto.TaskUpdateResponse, error)
	DeleteTask(ctx context.Context, taskID uuid.UUID, userID string) error
	GetTasksWithPagination(ctx context.Context, userID string, req dto.PaginationRequest) (dto.TaskPaginationResponse, error)
}

func NewTaskService

func NewTaskService(taskRepo repository.TaskRepository) TaskService

type UserService

type UserService interface {
	Register(ctx context.Context, req dto.UserCreateRequest) (dto.UserResponse, error)
	GetAllUserWithPagination(ctx context.Context, req dto.PaginationRequest) (dto.UserPaginationResponse, error)
	GetUserById(ctx context.Context, userId string, userRole string) (dto.UserResponse, error)
	GetUserByEmail(ctx context.Context, email string) (dto.UserResponse, error)
	SendVerificationEmail(ctx context.Context, req dto.SendVerificationEmailRequest) error
	VerifyEmail(ctx context.Context, req dto.VerifyEmailRequest) (dto.VerifyEmailResponse, error)
	Update(ctx context.Context, req dto.UserUpdateRequest, userId string) (dto.UserUpdateResponse, error)
	Delete(ctx context.Context, userId string) error
	Verify(ctx context.Context, req dto.UserLoginRequest) (dto.UserLoginResponse, error)
}

func NewUserService

func NewUserService(userRepo repository.UserRepository, jwtService JWTService) UserService

Jump to

Keyboard shortcuts

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