update url qrcode table
This commit is contained in:
@@ -19,14 +19,14 @@ import (
|
||||
type TableHandler struct {
|
||||
tableService TableService
|
||||
tableValidator *validator.TableValidator
|
||||
baseURL string
|
||||
selfOrderURL string
|
||||
}
|
||||
|
||||
func NewTableHandler(tableService TableService, tableValidator *validator.TableValidator, baseURL string) *TableHandler {
|
||||
func NewTableHandler(tableService TableService, tableValidator *validator.TableValidator, selfOrderURL string) *TableHandler {
|
||||
return &TableHandler{
|
||||
tableService: tableService,
|
||||
tableValidator: tableValidator,
|
||||
baseURL: baseURL,
|
||||
selfOrderURL: selfOrderURL,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ func (h *TableHandler) GenerateQRCode(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
selfOrderURL := fmt.Sprintf("%s/api/v1/self-order/table/%s", h.baseURL, token)
|
||||
selfOrderURLResult := fmt.Sprintf("%s/menu?token=%s", h.selfOrderURL, token)
|
||||
|
||||
size := 256
|
||||
if sizeStr := c.Query("size"); sizeStr != "" {
|
||||
@@ -321,7 +321,7 @@ func (h *TableHandler) GenerateQRCode(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
pngBytes, err := qrcode.GeneratePNG(selfOrderURL, size)
|
||||
pngBytes, err := qrcode.GeneratePNG(selfOrderURLResult, size)
|
||||
if err != nil {
|
||||
logger.FromContext(ctx).WithError(err).Error("TableHandler::GenerateQRCode -> QR generation failed")
|
||||
validationResponseError := contract.NewResponseError(constants.InternalServerErrorCode, constants.TableEntity, "Failed to generate QR code")
|
||||
|
||||
Reference in New Issue
Block a user