service

package
v0.0.0-...-cf27996 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 11 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)
	GetPayloadInsideToken(token string) (string, string, error)
}

func NewJWTService

func NewJWTService() JWTService

type TransaksiService

type TransaksiService interface {
	CreateTransaksi(userId string, req dto.CreateTransaksiRequest) (dto.CreateTransaksiResponse, error)
	GetAllTransaksi(ownerId string, role string) (dto.GetAllTransaksiResponse, error)
	GetDetailTransaksi(transaksiId string) (dto.GetDetailTransaksiResponse, error)
	UpdateTransaksi(transaksiId string, req dto.UpdateTransaksiRequest) (dto.UpdateTransaksiResponse, error)
	DeleteTransaksi(transaksiId string) error
}

func NewTransaksiService

func NewTransaksiService(transaksiRepo repository.TransaksiRepository, jwtService JWTService) TransaksiService

type UserService

type UserService interface {
	RegisterUser(ctx context.Context, req dto.UserCreateRequest) (dto.UserResponse, error)
	GetUserById(ctx context.Context, userId string) (dto.UserResponse, 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