router

package
v0.0.0-...-4e10d40 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS

func CORS() gin.HandlerFunc

Types

type Server

type Server struct {
	DotAlter  *dotsql.DotSql
	DotSelect *dotsql.DotSql
	DB        *sql.DB
	// contains filtered or unexported fields
}

func (Server) NewRouter

func (s Server) NewRouter() *gin.Engine

NewRouter returns a new router.

func (Server) PurchaseGet

func (s Server) PurchaseGet(c *gin.Context)

API endpoint that returns all saved purchases

@Summary Returns all saved purchases @Produce json @Success 200 {array} models.Purchase @Router /purchases [get] @Tags Purchase

func (Server) PurchaseGetArticlesByVendor

func (s Server) PurchaseGetArticlesByVendor(c *gin.Context)

API endpoint that lists articleIDs by vendor

@Summary Returns articleIDs by vendor @Produce json @Success 200 {array} int @Param x query string true "Vendor" @Router /articlesForLieferant [get] @Tags Purchase

func (Server) PurchaseGetByArticleId

func (s Server) PurchaseGetByArticleId(c *gin.Context)

API endpoint that returns all saved purchases for a given article

@Summary Returns all saved purchases for a given article @Produce json @Success 200 {array} models.Purchase @Param x query int true "ID of article to query" @Router /purchasesForArticle [get] @Tags Purchase

func (Server) PurchaseGetByTime

func (s Server) PurchaseGetByTime(c *gin.Context)

API endpoint that returns all saved purchases between two points in time

@Summary Returns all saved purchases between two points in time @Produce json @Success 200 {array} models.Purchase @Failure 400 {} {} "Invalid points in time" @Param x query string true "Starting point in time in the format 13.03.2021 13:59:58" @Param y query string true "Ending point in time in the format 20.03.2021 15:59:58" @Router /purchasesBetween [get] @Tags Purchase

func (Server) PurchasePlotPriceOverTime

func (s Server) PurchasePlotPriceOverTime(c *gin.Context)

API endpoint that plots the price of an article over time

@Summary Returns a plot of the price of an article over time @Produce png @Success 200 @Failure 404 @Param x query string true "Article ID" @Router /plot [get] @Tags Purchase

func (Server) PurchaseSave

func (s Server) PurchaseSave(c *gin.Context)

API endpoint that saves a purchase

@Summary Save a purchase @Success 204 @Failure 400 {} {} "Invalid purchase" @Accept json @Param purchase body models.Purchase true "Purchase to save" @Router /purchase [post] @Tags Purchase

func (Server) PurchaseVendorSearch

func (s Server) PurchaseVendorSearch(c *gin.Context)

API endpoint that returns a list of vendors similar to a query

@Summary Returns a list of vendors similar to a query @Produce json @Success 200 {array} models.Vendor @Param x query string true "Vendor query" @Router /searchLieferant [get] @Tags Purchase

Jump to

Keyboard shortcuts

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