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.
19 lines
555 B
Go
19 lines
555 B
Go
package domain
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type RecipeService interface {
|
|
CreateRecipe(ctx *gin.Context) (*Recipe, error)
|
|
GetRecipe(id int, userId *int) (*Recipe, error)
|
|
SearchRecipes(filters SearchFilters, userId *int, favorites bool) ([]Recipe, error)
|
|
GetUserRecipes(id int) ([]Recipe, error)
|
|
GetUserFavoriteRecipes(id int) ([]Recipe, error)
|
|
GetUserViewedRecipes(userId, limit int) ([]Recipe, error)
|
|
GetUserMadeRecipes(userId, limit int) ([]Recipe, error)
|
|
GetRecipeOfTheWeek(userId *int, date time.Time) (*Recipe, error)
|
|
}
|