go-cook/internal/repositories/recipe.go

47 lines
1.1 KiB
Go
Raw Normal View History

2024-03-26 17:52:38 -07:00
package repositories
import (
"database/sql"
"errors"
2024-04-05 17:51:02 -07:00
"git.jamestombleson.com/jtom38/go-cook/internal/domain"
2024-03-26 17:52:38 -07:00
)
type IRecipeTable interface {
2024-03-31 17:46:40 -07:00
Create(domain.RecipeEntity) error
List() ([]domain.RecipeEntity, error)
Get(id int) (domain.RecipeEntity, error)
Update(id int, entity domain.RecipeEntity) error
2024-04-05 17:51:02 -07:00
Delete(id int) error
2024-03-26 17:52:38 -07:00
}
type RecipeRepository struct {
client *sql.DB
}
func NewRecipeRepository(client *sql.DB) RecipeRepository {
return RecipeRepository{
client: client,
}
}
2024-03-31 17:46:40 -07:00
func (rr RecipeRepository) Create(domain.RecipeEntity) error {
2024-03-26 17:52:38 -07:00
return errors.New("not implemented")
}
2024-03-31 17:46:40 -07:00
func (rr RecipeRepository) List() ([]domain.RecipeEntity, error) {
return []domain.RecipeEntity{}, errors.New("not implemented")
2024-03-26 17:52:38 -07:00
}
2024-03-31 17:46:40 -07:00
func (rr RecipeRepository) Get(id int) (domain.RecipeEntity, error) {
return domain.RecipeEntity{}, errors.New("not implemented")
2024-03-26 17:52:38 -07:00
}
2024-03-31 17:46:40 -07:00
func (rr RecipeRepository) Update(id int, entity domain.RecipeEntity) error {
2024-03-26 17:52:38 -07:00
return errors.New("not implemented")
}
func (rr RecipeRepository) Delete(id int) error {
return errors.New("not implemented")
2024-03-31 17:46:40 -07:00
}