45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
package repositories
|
|
|
|
import (
|
|
"database/sql"
|
|
"errors"
|
|
"go-cook/api/models"
|
|
)
|
|
|
|
type IRecipeTable interface {
|
|
Create(models.RecipeModel) error
|
|
List() ([]models.RecipeModel, error)
|
|
Get(id int) (models.RecipeModel, error)
|
|
Update(id int, entity models.RecipeModel) error
|
|
Delete(id int) error
|
|
}
|
|
|
|
type RecipeRepository struct {
|
|
client *sql.DB
|
|
}
|
|
|
|
func NewRecipeRepository(client *sql.DB) RecipeRepository {
|
|
return RecipeRepository{
|
|
client: client,
|
|
}
|
|
}
|
|
|
|
func (rr RecipeRepository) Create(models.RecipeModel) error {
|
|
return errors.New("not implemented")
|
|
}
|
|
|
|
func (rr RecipeRepository) List() ([]models.RecipeModel, error) {
|
|
return []models.RecipeModel{}, errors.New("not implemented")
|
|
}
|
|
|
|
func (rr RecipeRepository) Get(id int) (models.RecipeModel, error) {
|
|
return models.RecipeModel{}, errors.New("not implemented")
|
|
}
|
|
|
|
func (rr RecipeRepository) Update(id int, entity models.RecipeModel) error {
|
|
return errors.New("not implemented")
|
|
}
|
|
|
|
func (rr RecipeRepository) Delete(id int) error {
|
|
return errors.New("not implemented")
|
|
} |