Documentation
¶
Index ¶
Constants ¶
View Source
const ( LOCAL_URL = "http://localhost:3000" VERIFY_EMAIL_ROUTE = "register/verify_email" )
Variables ¶
This section is empty.
Functions ¶
func SafeRollback ¶
Types ¶
type BahanMakananService ¶
type BahanMakananService interface {
Create(ctx context.Context, req dto.BahanMakananCreateRequest) (dto.BahanMakananResponse, error)
GetByID(ctx context.Context, id string) (dto.BahanMakananResponse, error)
GetByNama(ctx context.Context, nama string) (dto.BahanMakananResponse, error)
GetAllWithPagination(ctx context.Context, req dto.PaginationRequest) (dto.BahanMakananPaginationResponse, error)
Update(ctx context.Context, req dto.BahanMakananUpdateRequest, id string) (dto.BahanMakananResponse, error)
Delete(ctx context.Context, id string) error
}
func NewBahanMakananService ¶
func NewBahanMakananService(bahanMakananRepo repository.BahanMakananRepository, db *gorm.DB) BahanMakananService
type BeritaService ¶
type BeritaService interface {
Create(ctx context.Context, req dto.BeritaCreateRequest) (dto.BeritaResponse, error)
GetByID(ctx context.Context, id string) (dto.BeritaResponse, error)
GetByKategori(ctx context.Context, kategoriID string, req dto.PaginationRequest) (dto.BeritaPaginationResponse, error)
GetAllWithPagination(ctx context.Context, req dto.PaginationRequest) (dto.BeritaPaginationResponse, error)
Update(ctx context.Context, req dto.BeritaUpdateRequest, id string) (dto.BeritaResponse, error)
Delete(ctx context.Context, id string) error
}
func NewBeritaService ¶
func NewBeritaService( beritaRepo repository.BeritaRepository, kategoriBeritaRepo repository.KategoriBeritaRepository, db *gorm.DB, ) BeritaService
type JWTService ¶
type JWTService interface {
GenerateAccessToken(userId string, role string) string
GenerateRefreshToken() (string, time.Time)
ValidateToken(token string) (*jwt.Token, error)
GetUserIDByToken(token string) (string, error)
}
func NewJWTService ¶
func NewJWTService() JWTService
type KategoriBeritaService ¶
type KategoriBeritaService interface {
Create(ctx context.Context, req dto.KategoriBeritaCreateRequest) (dto.KategoriBeritaResponse, error)
GetByID(ctx context.Context, id string) (dto.KategoriBeritaResponse, error)
GetByNama(ctx context.Context, nama string) (dto.KategoriBeritaResponse, error)
GetAll(ctx context.Context) ([]dto.KategoriBeritaResponse, error)
Update(ctx context.Context, req dto.KategoriBeritaUpdateRequest, id string) (dto.KategoriBeritaResponse, error)
Delete(ctx context.Context, id string) error
}
func NewKategoriBeritaService ¶
func NewKategoriBeritaService( kategoriBeritaRepo repository.KategoriBeritaRepository, db *gorm.DB, ) KategoriBeritaService
type MakananService ¶
type MakananService interface {
Create(ctx context.Context, req dto.MakananCreateRequest) (dto.MakananResponse, error)
GetByID(ctx context.Context, id string) (dto.MakananResponse, error)
GetByNama(ctx context.Context, nama string) (dto.MakananResponse, error)
GetAllWithPagination(ctx context.Context, req dto.PaginationRequest) (dto.MakananPaginationResponse, error)
GetByBahanMakanan(ctx context.Context, bahanID string, req dto.PaginationRequest) (dto.MakananPaginationResponse, error)
Update(ctx context.Context, req dto.MakananUpdateRequest, id string) (dto.MakananResponse, error)
Delete(ctx context.Context, id string) error
}
func NewMakananService ¶
func NewMakananService( makananRepo repository.MakananRepository, bahanMakananRepo repository.BahanMakananRepository, db *gorm.DB, ) MakananService
type StuntingService ¶
type StuntingService interface {
Create(ctx context.Context, req dto.StuntingCreateRequest) (dto.StuntingResponse, error)
GetByID(ctx context.Context, id string) (dto.StuntingResponse, error)
GetByUserID(ctx context.Context, userID string, req dto.PaginationRequest) (dto.StuntingPaginationResponse, error)
GetLatestByUserID(ctx context.Context, userID string) (dto.StuntingResponse, error)
Update(ctx context.Context, id string, req dto.StuntingUpdateRequest) (dto.StuntingResponse, error)
Delete(ctx context.Context, id string) error
Predict(ctx context.Context, req dto.StuntingPredictRequest) (dto.StuntingPredictResponse, error)
GetForCalendar(ctx context.Context, userID string, req dto.StuntingCalendarRequest) ([]dto.StuntingResponse, error)
}
func NewStuntingService ¶
func NewStuntingService(stuntingRepo repository.StuntingRepository, db *gorm.DB, mlApiUrl string) StuntingService
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) (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)
UpdatePassword(ctx context.Context, req dto.UserUpdatePasswordRequest, userId string) error
Delete(ctx context.Context, userId string) error
Verify(ctx context.Context, req dto.UserLoginRequest) (dto.TokenResponse, error)
RefreshToken(ctx context.Context, req dto.RefreshTokenRequest) (dto.TokenResponse, error)
RevokeRefreshToken(ctx context.Context, userID string) error
}
func NewUserService ¶
func NewUserService( userRepo repository.UserRepository, refreshTokenRepo repository.RefreshTokenRepository, jwtService JWTService, db *gorm.DB, ) UserService
Click to show internal directories.
Click to hide internal directories.