feat: Config from env
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
// @Param data body models.CardRequest true "Card data"
|
||||
// @Produce application/pdf
|
||||
// @Router /cards [post]
|
||||
func GenerateCard(c *fiber.Ctx) error {
|
||||
func (h *DefaultHandler) GenerateCard(c *fiber.Ctx) error {
|
||||
cardRequest := new(models.CardRequest)
|
||||
if err := c.BodyParser(cardRequest); err != nil {
|
||||
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||
@@ -47,10 +47,10 @@ func GenerateCard(c *fiber.Ctx) error {
|
||||
|
||||
genConfig := &models.CardTemplateOptions{
|
||||
CardSegments: splitCardSegments(cardRequest.Cards),
|
||||
EventName: "Event name",
|
||||
CardSubtitle: "Card subtitle",
|
||||
BarcodeFormat: "ean13",
|
||||
BarcodePrefix: "",
|
||||
EventName: h.Config.EventName,
|
||||
CardSubtitle: h.Config.CardSubtitle,
|
||||
BarcodeFormat: h.Config.CardBarcodeFormat,
|
||||
BarcodePrefix: h.Config.CardBarcodePrefix,
|
||||
}
|
||||
|
||||
result, err := generator.Execute(template, genConfig)
|
||||
|
||||
Reference in New Issue
Block a user