Documentation ¶
Index ¶
- func CORS() gin.HandlerFunc
- type Server
- func (s Server) NewRouter() *gin.Engine
- func (s Server) PurchaseGet(c *gin.Context)
- func (s Server) PurchaseGetArticlesByVendor(c *gin.Context)
- func (s Server) PurchaseGetByArticleId(c *gin.Context)
- func (s Server) PurchaseGetByTime(c *gin.Context)
- func (s Server) PurchasePlotPriceOverTime(c *gin.Context)
- func (s Server) PurchaseSave(c *gin.Context)
- func (s Server) PurchaseVendorSearch(c *gin.Context)
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) PurchaseGet ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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