restructure application, add get endpoint
This commit is contained in:
parent
51a34008f1
commit
4ebc663d3b
16 changed files with 266 additions and 165 deletions
19
internal/application/handlers.go
Normal file
19
internal/application/handlers.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package application
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (a *Application) GetClaimsHandler(c *gin.Context) {
|
||||
system := c.DefaultQuery("system", "upc")
|
||||
barcode := c.Query("barcode")
|
||||
|
||||
productClaims, err := a.GetClaims(system, barcode)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, nil)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, productClaims)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue