repository

package
v0.0.0-...-0c11fba Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFoundMoreThanOne error = errors.New("found more than one row in db")
View Source
var ErrNotFound error = errors.New("not found in db")

Functions

func NewFacultyRepository

func NewFacultyRepository(db *sqlx.DB) *facultyRepository

func NewFormRepository

func NewFormRepository(db *sqlx.DB) *formRepository

func NewMenuRepository

func NewMenuRepository(db *sqlx.DB) *menuRepository

func NewRatioRepository

func NewRatioRepository(db *sqlx.DB) *ratioRepository

func NewRestaurantRepository

func NewRestaurantRepository(db *sqlx.DB) *restaurantRepository

Types

type FacultyRepository

type FacultyRepository interface {
	QueryAllFaculty() ([]model.Faculty, error)
}

type FormRepository

type FormRepository interface {
	InsertForm(model.Form) error
}
type MenuRepository interface {
	InsertMenu(model.Menu) error
	QueryRecommendedMenu(foodType string, spicyNess bool, price float64) (model.Menu, error)
	QueryAllFoodType() ([]model.Menu, error)
	QueryMenuMinPrice() ([]model.MenuMinPrice, error)
}

type RatioRepository

type RatioRepository interface {
	QueryIsSpicyRatio() ([]model.SpicynessRatio, error)
	QuerySubmitFormPrice() ([]model.SubmitFormPrice, error)
	QueryFoodTypeRatio() ([]model.FoodTypeRatio, error)
	QueryPopularityFromAverageMenuPrice() ([]model.PopularityFromAverageMenuPrice, error)
	QueryAveragePopularityFromPrice() ([]model.AveragePopularityFromPrice, error)
}

type RestaurantRepository

type RestaurantRepository interface {
	InsertRestarant(model.Restaurant) error
	QueryPopularRestaurant() ([]model.Restaurant, error)
	InsertRestaurantPopularity(restaurantId int64) error
	UpdateRestaurantPopularity(restaurantId int64) error
	QueryRestaurantPopularity(restaurantId int64) (model.RestaurantPopularity, error)
	QueryNearestRestaurants(restaurantId int64) ([]model.NearestRestaurant, error)
	QueryRestaurantById(id int64) (model.Restaurant, error)
}

Jump to

Keyboard shortcuts

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