ProductBarcode: refactoring Go method

This commit is contained in:
Crumb Owl
2025-07-02 22:28:39 +02:00
parent 66c2de22ed
commit 24923f2a83
2 changed files with 2 additions and 2 deletions

View File

@@ -96,7 +96,7 @@ type BARCODESPIDER_COMResponse struct {
// @Success 200 {object} []repo.BarcodeProduct // @Success 200 {object} []repo.BarcodeProduct
// @Router /v1/getproductfromean [GET] // @Router /v1/getproductfromean [GET]
// @Security Bearer // @Security Bearer
func (ctrl *V1Controller) HandleProductSearchFromEAN(conf config.BarcodeAPIConf) errchain.HandlerFunc { func (ctrl *V1Controller) HandleProductSearchFromBarcode(conf config.BarcodeAPIConf) errchain.HandlerFunc {
type query struct { type query struct {
// 4,296 characters is the maximum length of a QR code // 4,296 characters is the maximum length of a QR code
EAN string `schema:"productEAN" validate:"required,max=4296"` EAN string `schema:"productEAN" validate:"required,max=4296"`

View File

@@ -158,7 +158,7 @@ func (a *app) mountRoutes(r *chi.Mux, chain *errchain.ErrChain, repos *repo.AllR
} }
r.Get("/qrcode", chain.ToHandlerFunc(v1Ctrl.HandleGenerateQRCode(), assetMW...)) r.Get("/qrcode", chain.ToHandlerFunc(v1Ctrl.HandleGenerateQRCode(), assetMW...))
r.Get("/getproductfromean", chain.ToHandlerFunc(v1Ctrl.HandleProductSearchEAN(a.conf.Barcode), userMW...)) r.Get("/getproductfromean", chain.ToHandlerFunc(v1Ctrl.HandleProductSearchFromBarcode(a.conf.Barcode), userMW...))
r.Get( r.Get(
"/items/{id}/attachments/{attachment_id}", "/items/{id}/attachments/{attachment_id}",
chain.ToHandlerFunc(v1Ctrl.HandleItemAttachmentGet(), assetMW...), chain.ToHandlerFunc(v1Ctrl.HandleItemAttachmentGet(), assetMW...),