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).
11 lines
280 B
Go
11 lines
280 B
Go
package domain
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
type RecipeService interface {
|
|
CreateRecipe(ctx *gin.Context) (*Recipe, error)
|
|
GetRecipe(id int, userId *int) (*Recipe, error)
|
|
SearchRecipes(filters SearchFilters) ([]Recipe, error)
|
|
GetUserRecipes(id int) ([]Recipe, error)
|
|
}
|