Still having the stupid ass nil dereferences, I think I might need to migrate to using success returns instead of pointers. Because they're fucked. And even more so now.
17 lines
593 B
Go
17 lines
593 B
Go
package domain
|
|
|
|
import "time"
|
|
|
|
type RecipeRepository interface {
|
|
CreateRecipe(recipe *Recipe) error
|
|
GetRecipe(id int, userId *int) (*Recipe, error)
|
|
GetRecipes(ids []int, userId *int) ([]Recipe, error)
|
|
SearchRecipes(filters SearchFilters, userId *int, favorites bool) ([]Recipe, error)
|
|
CreateRecipeTags(recipe Recipe, tags []string) error
|
|
GetUserRecipes(id int) ([]Recipe, error)
|
|
GetUserFavoriteRecipes(id int) ([]Recipe, error)
|
|
GetRecipeTags(recipe *Recipe) error
|
|
GetRecipeFavorite(recipe *Recipe, userId int) error
|
|
GetRecipeOfTheWeek(userId *int, date time.Time) (*Recipe, error)
|
|
}
|