From d3e4202e067c20c9b91fe511b190d4aafdcb3118 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Tue, 1 Apr 2025 20:46:16 +0200 Subject: [PATCH] commit gen.go too to conform with go get --- .gitignore | 2 +- apps/db-adapter/pkg/api/api.gen.go | 1333 ++++++++++++++++++++++++++++ 2 files changed, 1334 insertions(+), 1 deletion(-) create mode 100644 apps/db-adapter/pkg/api/api.gen.go diff --git a/.gitignore b/.gitignore index 8337173..c373e59 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ frontend/package !.env.example frontend/vite.config.js.timestamp-* frontend/vite.config.ts.timestamp-* -*.gen.go + # Backend gitignore: ## Binaries for programs and plugins backend/*.exe diff --git a/apps/db-adapter/pkg/api/api.gen.go b/apps/db-adapter/pkg/api/api.gen.go new file mode 100644 index 0000000..403a5c9 --- /dev/null +++ b/apps/db-adapter/pkg/api/api.gen.go @@ -0,0 +1,1333 @@ +// Package api provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. +package api + +import ( + "fmt" + "net/http" + + "github.com/gin-gonic/gin" + "github.com/oapi-codegen/runtime" + openapi_types "github.com/oapi-codegen/runtime/types" +) + +// Defines values for CreatePersonAndRelationshipJSONBodyType. +const ( + CreatePersonAndRelationshipJSONBodyTypeChild CreatePersonAndRelationshipJSONBodyType = "child" + CreatePersonAndRelationshipJSONBodyTypeParent CreatePersonAndRelationshipJSONBodyType = "parent" + CreatePersonAndRelationshipJSONBodyTypeSibling CreatePersonAndRelationshipJSONBodyType = "sibling" + CreatePersonAndRelationshipJSONBodyTypeSpouse CreatePersonAndRelationshipJSONBodyType = "spouse" +) + +// Defines values for CreateRelationshipJSONBodyType. +const ( + CreateRelationshipJSONBodyTypeChild CreateRelationshipJSONBodyType = "child" + CreateRelationshipJSONBodyTypeParent CreateRelationshipJSONBodyType = "parent" + CreateRelationshipJSONBodyTypeSibling CreateRelationshipJSONBodyType = "sibling" + CreateRelationshipJSONBodyTypeSpouse CreateRelationshipJSONBodyType = "spouse" +) + +// FamilyRelationship defines model for FamilyRelationship. +type FamilyRelationship struct { + From *openapi_types.Date `json:"from"` + Notes *string `json:"notes"` + To *openapi_types.Date `json:"to"` + Verified *bool `json:"verified"` +} + +// FamilyTree defines model for FamilyTree. +type FamilyTree struct { + Ancestors *[]OptimizedPersonNode `json:"ancestors,omitempty"` + Children *[]OptimizedPersonNode `json:"children,omitempty"` + Prel1 *Relationship `json:"prel1,omitempty"` + Prel2 *Relationship `json:"prel2,omitempty"` + Spouses *string `json:"spouses,omitempty"` + Srel *Relationship `json:"srel,omitempty"` + User *string `json:"user,omitempty"` +} + +// Likes defines model for Likes. +type Likes struct { + End *string `json:"end,omitempty"` + Id *int `json:"id,omitempty"` + Label *string `json:"label,omitempty"` + Properties *LikesProperties `json:"properties,omitempty"` + Start *string `json:"start,omitempty"` +} + +// LikesProperties defines model for LikesProperties. +type LikesProperties struct { + CouldMakeIt *bool `json:"could_make_it"` + Favourite *bool `json:"favourite"` + LikeIt *bool `json:"like_it"` +} + +// OptimizedPersonNode defines model for OptimizedPersonNode. +type OptimizedPersonNode struct { + Born *openapi_types.Date `json:"born,omitempty"` + Died *openapi_types.Date `json:"died"` + FirstName *string `json:"first_name,omitempty"` + Id *int `json:"id,omitempty"` + Labels *[]string `json:"labels,omitempty"` + LastName *string `json:"last_name,omitempty"` + MiddleName *string `json:"middle_name,omitempty"` + Type *string `json:"type"` +} + +// Person defines model for Person. +type Person struct { + Id *int `json:"id,omitempty"` + Labels *[]string `json:"labels,omitempty"` + Properties *PersonProperties `json:"properties,omitempty"` + Type *string `json:"type"` +} + +// PersonProperties defines model for PersonProperties. +type PersonProperties struct { + Aliases *[]string `json:"aliases"` + Allergies *[]string `json:"allergies"` + AllowAdminAccess *[]struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + } `json:"allow_admin_access"` + Audios *[]struct { + Date *openapi_types.Date `json:"date,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Url *string `json:"url,omitempty"` + } `json:"audios"` + Baptized *string `json:"baptized"` + BloodType *string `json:"blood_type"` + Born *openapi_types.Date `json:"born"` + Died *openapi_types.Date `json:"died"` + Email *string `json:"email"` + ExtraNames *[]string `json:"extra_names"` + EyeColour *string `json:"eye_colour"` + FirstName *string `json:"first_name"` + GoogleId *string `json:"google_id"` + HairColour *string `json:"hair_colour"` + Height *float32 `json:"height"` + Hobbies *[]string `json:"hobbies"` + Ideologies *[]string `json:"ideologies"` + Interests *[]string `json:"interests"` + InviteCode *string `json:"invite_code"` + Languages *[]struct { + Language *string `json:"language,omitempty"` + Level *string `json:"level"` + } `json:"languages"` + LastName *string `json:"last_name"` + LifeEvents *[]struct { + Description *string `json:"description,omitempty"` + From *openapi_types.Date `json:"from,omitempty"` + To *openapi_types.Date `json:"to,omitempty"` + } `json:"life_events"` + Limit *int `json:"limit"` + MedicalConditions *[]map[string]interface{} `json:"medical_conditions"` + Medications *[]struct { + Components *string `json:"components"` + Description *string `json:"description"` + Dosage *string `json:"dosage"` + From *openapi_types.Date `json:"from"` + Name *string `json:"name,omitempty"` + To *openapi_types.Date `json:"to"` + } `json:"medications"` + MiddleName *string `json:"middle_name"` + MothersFirstName *string `json:"mothers_first_name"` + MothersLastName *string `json:"mothers_last_name"` + Notes *[]struct { + Date *openapi_types.Date `json:"date"` + Note *string `json:"note,omitempty"` + Title *string `json:"title"` + Url *string `json:"url"` + } `json:"notes"` + OccupationToDisplay *string `json:"occupation_to_display"` + Occupations *[]string `json:"occupations"` + OthersSaid *[]struct { + Description *string `json:"description,omitempty"` + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Relationship *string `json:"relationship,omitempty"` + Url *string `json:"url"` + } `json:"others_said"` + Phone *string `json:"phone"` + Photos *[]struct { + Date *openapi_types.Date `json:"date,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Url *string `json:"url,omitempty"` + } `json:"photos"` + PlaceOfBirth *string `json:"place_of_birth"` + PlaceOfDeath *string `json:"place_of_death"` + ProfilePicture *string `json:"profile_picture"` + Religion *string `json:"religion"` + Residence *struct { + AddressLine1 *string `json:"address_line_1,omitempty"` + AddressLine2 *string `json:"address_line_2,omitempty"` + City *string `json:"city,omitempty"` + Country *string `json:"country,omitempty"` + ZipCode *string `json:"zip_code,omitempty"` + } `json:"residence"` + SkinColour *string `json:"skin_colour"` + Sports *[]string `json:"sports"` + Suffixes *[]string `json:"suffixes"` + Titles *[]string `json:"titles"` + Verified *bool `json:"verified"` + Videos *[]struct { + Date *openapi_types.Date `json:"date,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Url *string `json:"url,omitempty"` + } `json:"videos"` + Weight *float32 `json:"weight"` +} + +// PersonRegistration defines model for PersonRegistration. +type PersonRegistration struct { + Born openapi_types.Date `json:"born"` + Email *openapi_types.Email `json:"email"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Limit int `json:"limit"` + MothersFirstName string `json:"mothers_first_name"` + MothersLastName string `json:"mothers_last_name"` +} + +// Recipe defines model for Recipe. +type Recipe struct { + Id *int `json:"id,omitempty"` + Labels *[]string `json:"labels,omitempty"` + Properties *RecipeProperties `json:"properties,omitempty"` +} + +// RecipeProperties defines model for RecipeProperties. +type RecipeProperties struct { + AllowAdminAccess *[]struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + } `json:"allow_admin_access,omitempty"` + Category *string `json:"category"` + Description *string `json:"description"` + FirstRecorded *openapi_types.Date `json:"first_recorded"` + Ingredients *[]string `json:"ingredients"` + Instructions *[]string `json:"instructions"` + Name *string `json:"name"` + Notes *string `json:"notes"` + Origin *string `json:"origin"` + OthersSaid *[]struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Said *string `json:"said,omitempty"` + } `json:"others_said"` + Photo *string `json:"photo"` +} + +// Relationship defines model for Relationship. +type Relationship struct { + End *int `json:"end,omitempty"` + Id *int `json:"id,omitempty"` + Label *string `json:"label,omitempty"` + Properties *FamilyRelationship `json:"properties,omitempty"` + Start *int `json:"start,omitempty"` + Type *string `json:"type"` +} + +// CreatePersonParams defines parameters for CreatePerson. +type CreatePersonParams struct { + XUserID int `json:"X-User-ID"` + XUserName string `json:"X-User-Name"` +} + +// CreatePersonByGoogleIdAndInviteCodeJSONBody defines parameters for CreatePersonByGoogleIdAndInviteCode. +type CreatePersonByGoogleIdAndInviteCodeJSONBody struct { + InviteCode string `json:"invite_code"` + Person PersonRegistration `json:"person"` +} + +// SoftDeletePersonParams defines parameters for SoftDeletePerson. +type SoftDeletePersonParams struct { + XUserID int `json:"X-User-ID"` +} + +// GetPersonByIdParams defines parameters for GetPersonById. +type GetPersonByIdParams struct { + XUserID int `json:"X-User-ID"` +} + +// UpdatePersonParams defines parameters for UpdatePerson. +type UpdatePersonParams struct { + XUserID int `json:"X-User-ID"` +} + +// HardDeletePersonParams defines parameters for HardDeletePerson. +type HardDeletePersonParams struct { + XUserID int `json:"X-User-ID"` +} + +// GetRecipesByPersonIdParams defines parameters for GetRecipesByPersonId. +type GetRecipesByPersonIdParams struct { + XUserID int `json:"X-User-ID"` +} + +// CreatePersonAndRelationshipJSONBody defines parameters for CreatePersonAndRelationship. +type CreatePersonAndRelationshipJSONBody struct { + Person PersonRegistration `json:"person"` + Relationship FamilyRelationship `json:"relationship"` + Type *CreatePersonAndRelationshipJSONBodyType `json:"type,omitempty"` +} + +// CreatePersonAndRelationshipParams defines parameters for CreatePersonAndRelationship. +type CreatePersonAndRelationshipParams struct { + XUserID int `json:"X-User-ID"` +} + +// CreatePersonAndRelationshipJSONBodyType defines parameters for CreatePersonAndRelationship. +type CreatePersonAndRelationshipJSONBodyType string + +// SoftDeleteRecipeParams defines parameters for SoftDeleteRecipe. +type SoftDeleteRecipeParams struct { + XUserID int `json:"X-User-ID"` +} + +// UpdateRecipeParams defines parameters for UpdateRecipe. +type UpdateRecipeParams struct { + XUserID int `json:"X-User-ID"` +} + +// HardDeleteRecipeParams defines parameters for HardDeleteRecipe. +type HardDeleteRecipeParams struct { + XUserID int `json:"X-User-ID"` +} + +// DeleteRecipeRelationshipParams defines parameters for DeleteRecipeRelationship. +type DeleteRecipeRelationshipParams struct { + PersonId int `form:"personId" json:"personId"` + XUserID int `json:"X-User-ID"` +} + +// CreateRecipeRelationshipJSONBody defines parameters for CreateRecipeRelationship. +type CreateRecipeRelationshipJSONBody struct { + Id int `json:"id"` + Relationship struct { + Schema *LikesProperties `json:"schema,omitempty"` + } `json:"relationship"` +} + +// CreateRecipeRelationshipParams defines parameters for CreateRecipeRelationship. +type CreateRecipeRelationshipParams struct { + XUserID int `json:"X-User-ID"` +} + +// CreateRelationshipJSONBody defines parameters for CreateRelationship. +type CreateRelationshipJSONBody struct { + Id1 *string `json:"id1,omitempty"` + Id2 *string `json:"id2,omitempty"` + Relationship *FamilyRelationship `json:"relationship,omitempty"` + Type *CreateRelationshipJSONBodyType `json:"type,omitempty"` +} + +// CreateRelationshipParams defines parameters for CreateRelationship. +type CreateRelationshipParams struct { + XUserID int `json:"X-User-ID"` +} + +// CreateRelationshipJSONBodyType defines parameters for CreateRelationship. +type CreateRelationshipJSONBodyType string + +// GetRelationshipParams defines parameters for GetRelationship. +type GetRelationshipParams struct { + XUserID int `json:"X-User-ID"` +} + +// CreatePersonJSONRequestBody defines body for CreatePerson for application/json ContentType. +type CreatePersonJSONRequestBody = PersonRegistration + +// CreatePersonByGoogleIdAndInviteCodeJSONRequestBody defines body for CreatePersonByGoogleIdAndInviteCode for application/json ContentType. +type CreatePersonByGoogleIdAndInviteCodeJSONRequestBody CreatePersonByGoogleIdAndInviteCodeJSONBody + +// CreatePersonByGoogleIdJSONRequestBody defines body for CreatePersonByGoogleId for application/json ContentType. +type CreatePersonByGoogleIdJSONRequestBody = PersonRegistration + +// UpdatePersonJSONRequestBody defines body for UpdatePerson for application/json ContentType. +type UpdatePersonJSONRequestBody = PersonProperties + +// CreatePersonAndRelationshipJSONRequestBody defines body for CreatePersonAndRelationship for application/json ContentType. +type CreatePersonAndRelationshipJSONRequestBody CreatePersonAndRelationshipJSONBody + +// UpdateRecipeJSONRequestBody defines body for UpdateRecipe for application/json ContentType. +type UpdateRecipeJSONRequestBody = RecipeProperties + +// CreateRecipeRelationshipJSONRequestBody defines body for CreateRecipeRelationship for application/json ContentType. +type CreateRecipeRelationshipJSONRequestBody CreateRecipeRelationshipJSONBody + +// CreateRelationshipJSONRequestBody defines body for CreateRelationship for application/json ContentType. +type CreateRelationshipJSONRequestBody CreateRelationshipJSONBody + +// ServerInterface represents all server handlers. +type ServerInterface interface { + // Check the health of the server + // (GET /health) + HealthCheck(c *gin.Context) + // Create a new person + // (POST /person) + CreatePerson(c *gin.Context, params CreatePersonParams) + // Get a person by Google ID + // (GET /person/google/{google_id}) + GetPersonByGoogleId(c *gin.Context, googleId string) + // Create a new person by Google ID with invite code + // (PATCH /person/google/{google_id}) + CreatePersonByGoogleIdAndInviteCode(c *gin.Context, googleId string) + // Create a new person by Google ID + // (POST /person/google/{google_id}) + CreatePersonByGoogleId(c *gin.Context, googleId string) + // Soft delete a person by ID + // (DELETE /person/{id}) + SoftDeletePerson(c *gin.Context, id int, params SoftDeletePersonParams) + // Get a person by ID + // (GET /person/{id}) + GetPersonById(c *gin.Context, id int, params GetPersonByIdParams) + // Update a person by ID + // (PATCH /person/{id}) + UpdatePerson(c *gin.Context, id int, params UpdatePersonParams) + // Get family tree by person ID + // (GET /person/{id}/family-tree) + GetFamilyTreeById(c *gin.Context, id int) + // Hard delete a person by ID + // (DELETE /person/{id}/hard-delete) + HardDeletePerson(c *gin.Context, id int, params HardDeletePersonParams) + // Get recipes by person ID + // (GET /person/{id}/recipes) + GetRecipesByPersonId(c *gin.Context, id int, params GetRecipesByPersonIdParams) + // Create a person and relationship + // (POST /person_and_relationship/{id}) + CreatePersonAndRelationship(c *gin.Context, id int, params CreatePersonAndRelationshipParams) + // Soft delete a recipe by ID + // (DELETE /recipe/{id}) + SoftDeleteRecipe(c *gin.Context, id int, params SoftDeleteRecipeParams) + // Update a recipe by ID + // (PATCH /recipe/{id}) + UpdateRecipe(c *gin.Context, id int, params UpdateRecipeParams) + // Hard delete a recipe by ID + // (DELETE /recipe/{id}/hard-delete) + HardDeleteRecipe(c *gin.Context, id int, params HardDeleteRecipeParams) + // Delete a relationship with a recipe + // (DELETE /recipe/{recipeId}/relationship) + DeleteRecipeRelationship(c *gin.Context, recipeId int, params DeleteRecipeRelationshipParams) + // Create a relationship with an existing recipe + // (POST /recipe/{recipeId}/relationship) + CreateRecipeRelationship(c *gin.Context, recipeId int, params CreateRecipeRelationshipParams) + // Create a relationship between two persons + // (POST /relationship) + CreateRelationship(c *gin.Context, params CreateRelationshipParams) + // Get relationship between two persons + // (GET /relationship/{id1}/{id2}) + GetRelationship(c *gin.Context, id1 int, id2 int, params GetRelationshipParams) +} + +// ServerInterfaceWrapper converts contexts to parameters. +type ServerInterfaceWrapper struct { + Handler ServerInterface + HandlerMiddlewares []MiddlewareFunc + ErrorHandler func(*gin.Context, error, int) +} + +type MiddlewareFunc func(c *gin.Context) + +// HealthCheck operation middleware +func (siw *ServerInterfaceWrapper) HealthCheck(c *gin.Context) { + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.HealthCheck(c) +} + +// CreatePerson operation middleware +func (siw *ServerInterfaceWrapper) CreatePerson(c *gin.Context) { + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params CreatePersonParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + // ------------- Required header parameter "X-User-Name" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-Name")]; found { + var XUserName string + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-Name, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-Name", valueList[0], &XUserName, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-Name: %w", err), http.StatusBadRequest) + return + } + + params.XUserName = XUserName + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-Name is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.CreatePerson(c, params) +} + +// GetPersonByGoogleId operation middleware +func (siw *ServerInterfaceWrapper) GetPersonByGoogleId(c *gin.Context) { + + var err error + + // ------------- Path parameter "google_id" ------------- + var googleId string + + err = runtime.BindStyledParameterWithOptions("simple", "google_id", c.Param("google_id"), &googleId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter google_id: %w", err), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.GetPersonByGoogleId(c, googleId) +} + +// CreatePersonByGoogleIdAndInviteCode operation middleware +func (siw *ServerInterfaceWrapper) CreatePersonByGoogleIdAndInviteCode(c *gin.Context) { + + var err error + + // ------------- Path parameter "google_id" ------------- + var googleId string + + err = runtime.BindStyledParameterWithOptions("simple", "google_id", c.Param("google_id"), &googleId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter google_id: %w", err), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.CreatePersonByGoogleIdAndInviteCode(c, googleId) +} + +// CreatePersonByGoogleId operation middleware +func (siw *ServerInterfaceWrapper) CreatePersonByGoogleId(c *gin.Context) { + + var err error + + // ------------- Path parameter "google_id" ------------- + var googleId string + + err = runtime.BindStyledParameterWithOptions("simple", "google_id", c.Param("google_id"), &googleId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter google_id: %w", err), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.CreatePersonByGoogleId(c, googleId) +} + +// SoftDeletePerson operation middleware +func (siw *ServerInterfaceWrapper) SoftDeletePerson(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params SoftDeletePersonParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.SoftDeletePerson(c, id, params) +} + +// GetPersonById operation middleware +func (siw *ServerInterfaceWrapper) GetPersonById(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params GetPersonByIdParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.GetPersonById(c, id, params) +} + +// UpdatePerson operation middleware +func (siw *ServerInterfaceWrapper) UpdatePerson(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params UpdatePersonParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.UpdatePerson(c, id, params) +} + +// GetFamilyTreeById operation middleware +func (siw *ServerInterfaceWrapper) GetFamilyTreeById(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.GetFamilyTreeById(c, id) +} + +// HardDeletePerson operation middleware +func (siw *ServerInterfaceWrapper) HardDeletePerson(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params HardDeletePersonParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.HardDeletePerson(c, id, params) +} + +// GetRecipesByPersonId operation middleware +func (siw *ServerInterfaceWrapper) GetRecipesByPersonId(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params GetRecipesByPersonIdParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.GetRecipesByPersonId(c, id, params) +} + +// CreatePersonAndRelationship operation middleware +func (siw *ServerInterfaceWrapper) CreatePersonAndRelationship(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params CreatePersonAndRelationshipParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.CreatePersonAndRelationship(c, id, params) +} + +// SoftDeleteRecipe operation middleware +func (siw *ServerInterfaceWrapper) SoftDeleteRecipe(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params SoftDeleteRecipeParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.SoftDeleteRecipe(c, id, params) +} + +// UpdateRecipe operation middleware +func (siw *ServerInterfaceWrapper) UpdateRecipe(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params UpdateRecipeParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.UpdateRecipe(c, id, params) +} + +// HardDeleteRecipe operation middleware +func (siw *ServerInterfaceWrapper) HardDeleteRecipe(c *gin.Context) { + + var err error + + // ------------- Path parameter "id" ------------- + var id int + + err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params HardDeleteRecipeParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.HardDeleteRecipe(c, id, params) +} + +// DeleteRecipeRelationship operation middleware +func (siw *ServerInterfaceWrapper) DeleteRecipeRelationship(c *gin.Context) { + + var err error + + // ------------- Path parameter "recipeId" ------------- + var recipeId int + + err = runtime.BindStyledParameterWithOptions("simple", "recipeId", c.Param("recipeId"), &recipeId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter recipeId: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params DeleteRecipeRelationshipParams + + // ------------- Required query parameter "personId" ------------- + + if paramValue := c.Query("personId"); paramValue != "" { + + } else { + siw.ErrorHandler(c, fmt.Errorf("Query argument personId is required, but not found"), http.StatusBadRequest) + return + } + + err = runtime.BindQueryParameter("form", true, true, "personId", c.Request.URL.Query(), ¶ms.PersonId) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter personId: %w", err), http.StatusBadRequest) + return + } + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.DeleteRecipeRelationship(c, recipeId, params) +} + +// CreateRecipeRelationship operation middleware +func (siw *ServerInterfaceWrapper) CreateRecipeRelationship(c *gin.Context) { + + var err error + + // ------------- Path parameter "recipeId" ------------- + var recipeId int + + err = runtime.BindStyledParameterWithOptions("simple", "recipeId", c.Param("recipeId"), &recipeId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter recipeId: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params CreateRecipeRelationshipParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.CreateRecipeRelationship(c, recipeId, params) +} + +// CreateRelationship operation middleware +func (siw *ServerInterfaceWrapper) CreateRelationship(c *gin.Context) { + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params CreateRelationshipParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.CreateRelationship(c, params) +} + +// GetRelationship operation middleware +func (siw *ServerInterfaceWrapper) GetRelationship(c *gin.Context) { + + var err error + + // ------------- Path parameter "id1" ------------- + var id1 int + + err = runtime.BindStyledParameterWithOptions("simple", "id1", c.Param("id1"), &id1, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id1: %w", err), http.StatusBadRequest) + return + } + + // ------------- Path parameter "id2" ------------- + var id2 int + + err = runtime.BindStyledParameterWithOptions("simple", "id2", c.Param("id2"), &id2, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id2: %w", err), http.StatusBadRequest) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params GetRelationshipParams + + headers := c.Request.Header + + // ------------- Required header parameter "X-User-ID" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found { + var XUserID int + n := len(valueList) + if n != 1 { + siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest) + return + } + + params.XUserID = XUserID + + } else { + siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.GetRelationship(c, id1, id2, params) +} + +// GinServerOptions provides options for the Gin server. +type GinServerOptions struct { + BaseURL string + Middlewares []MiddlewareFunc + ErrorHandler func(*gin.Context, error, int) +} + +// RegisterHandlers creates http.Handler with routing matching OpenAPI spec. +func RegisterHandlers(router gin.IRouter, si ServerInterface) { + RegisterHandlersWithOptions(router, si, GinServerOptions{}) +} + +// RegisterHandlersWithOptions creates http.Handler with additional options +func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions) { + errorHandler := options.ErrorHandler + if errorHandler == nil { + errorHandler = func(c *gin.Context, err error, statusCode int) { + c.JSON(statusCode, gin.H{"msg": err.Error()}) + } + } + + wrapper := ServerInterfaceWrapper{ + Handler: si, + HandlerMiddlewares: options.Middlewares, + ErrorHandler: errorHandler, + } + + router.GET(options.BaseURL+"/health", wrapper.HealthCheck) + router.POST(options.BaseURL+"/person", wrapper.CreatePerson) + router.GET(options.BaseURL+"/person/google/:google_id", wrapper.GetPersonByGoogleId) + router.PATCH(options.BaseURL+"/person/google/:google_id", wrapper.CreatePersonByGoogleIdAndInviteCode) + router.POST(options.BaseURL+"/person/google/:google_id", wrapper.CreatePersonByGoogleId) + router.DELETE(options.BaseURL+"/person/:id", wrapper.SoftDeletePerson) + router.GET(options.BaseURL+"/person/:id", wrapper.GetPersonById) + router.PATCH(options.BaseURL+"/person/:id", wrapper.UpdatePerson) + router.GET(options.BaseURL+"/person/:id/family-tree", wrapper.GetFamilyTreeById) + router.DELETE(options.BaseURL+"/person/:id/hard-delete", wrapper.HardDeletePerson) + router.GET(options.BaseURL+"/person/:id/recipes", wrapper.GetRecipesByPersonId) + router.POST(options.BaseURL+"/person_and_relationship/:id", wrapper.CreatePersonAndRelationship) + router.DELETE(options.BaseURL+"/recipe/:id", wrapper.SoftDeleteRecipe) + router.PATCH(options.BaseURL+"/recipe/:id", wrapper.UpdateRecipe) + router.DELETE(options.BaseURL+"/recipe/:id/hard-delete", wrapper.HardDeleteRecipe) + router.DELETE(options.BaseURL+"/recipe/:recipeId/relationship", wrapper.DeleteRecipeRelationship) + router.POST(options.BaseURL+"/recipe/:recipeId/relationship", wrapper.CreateRecipeRelationship) + router.POST(options.BaseURL+"/relationship", wrapper.CreateRelationship) + router.GET(options.BaseURL+"/relationship/:id1/:id2", wrapper.GetRelationship) +}