This means we need to pass the user id into the various methods that call it. But, since it is a pointer, we can use nil if we don't have a user to check with (this is noted in the service).
12 lines
379 B
Go
12 lines
379 B
Go
package domain
|
|
|
|
type RecipeRepository interface {
|
|
CreateRecipe(recipe *Recipe) error
|
|
GetRecipe(id int, userId *int) (*Recipe, error)
|
|
SearchRecipes(filters SearchFilters) ([]Recipe, error)
|
|
CreateRecipeTags(recipe Recipe, tags []string) error
|
|
GetUserRecipes(id int) ([]Recipe, error)
|
|
GetRecipeTags(recipe *Recipe) error
|
|
GetRecipeFavorite(recipe *Recipe, userId int) error
|
|
}
|