savedsearches

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	DbClient *db.Manager
}

func New

func New(dbManager *db.Manager) *Manager

func (*Manager) Delete

func (m *Manager) Delete(w http.ResponseWriter, r *http.Request)

Delete saved search by ID not done (note - I don't have the user auth stuff here)

@Summary		Delete saved search by ID
@Description	delete a saved search for user
@Tags			saved_searches
@Accept			json
@Produce		json
@Success		200	{object}	savedsearches.SavedSearch
@Router			/saved_searches/{id} [delete]

func (*Manager) Get

func (m *Manager) Get(w http.ResponseWriter, r *http.Request)

Get lists saved searches for current user (note - I don't have the user auth stuff here)

@Summary		Get Saved Searches for current User
@Description	get saved searches for user
@Tags			saved_searches
@Accept			json
@Produce		json
@Success		200	{array}	savedsearches.SavedSearches
@Router			/saved_searches [get]

func (*Manager) GetByID

func (m *Manager) GetByID(w http.ResponseWriter, r *http.Request)

Get saved searches for current user (note - I don't have the user auth stuff here)

@Summary		Get Saved Search for current User
@Description	get saved searches for user
@Tags			saved_searches
@Accept			json
@Produce		json
@Success		200	{array}	savedsearches.SavedSearch
@Router			/saved_searches [get]

func (*Manager) Post

func (m *Manager) Post(w http.ResponseWriter, r *http.Request)

Create saved search for current user (note - I don't have the user auth stuff here)

@Summary		Create SavedSearch for current User
@Description	new saved search for user
@Tags			saved_searches
@Accept			json
@Produce		json
@Success		200	{object}	savedsearches.SavedSearch
@Router			/saved_searches [post]

type SavedSearch

type SavedSearch struct {
	Id     int              `json:"id"`
	UserId int              `json:"user_id"`
	Name   string           `json:"name"`
	Search SavedSearchQuery `json:"search"`
}

func FromDBType

func FromDBType(dbSavedSearch *db.SavedSearch, eligibilityIdToName map[int]string, categoryIdToName map[int]string) *SavedSearch

Convert DB SavedSearch to API SavedSearch

func FromDBTypeArray

func FromDBTypeArray(dbSavedSearches []*db.SavedSearch, eligibilityIdToName map[int]string, categoryIdToName map[int]string) []*SavedSearch

type SavedSearchQuery

type SavedSearchQuery struct {
	Eligibilities []string `json:"eligibilities"`
	Categories    []string `json:"categories"`
	Lat           *float64 `json:"lat"`
	Lng           *float64 `json:"lng"`
	Query         string   `json:"query"`
}

type SavedSearches

type SavedSearches struct {
	SavedSearches []*SavedSearch `json:"saved_searches"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL