Basic JWT is now working #12
45
api/repositories/recipe.go
Normal file
45
api/repositories/recipe.go
Normal file
@ -0,0 +1,45 @@
|
||||
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")
|
||||
}
|
Loading…
Reference in New Issue
Block a user