chore: Formatting

This commit is contained in:
Nicolai Ort 2024-12-12 16:33:23 +01:00
parent 69f4de6739
commit c5da33f10f
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
5 changed files with 41 additions and 41 deletions

View File

@ -5,13 +5,13 @@ import (
) )
// GenerateBarcode godoc // GenerateBarcode godoc
// @Summary Generate barcodes // @Summary Generate barcodes
// @Description Generate barcodes based on the provided data // @Description Generate barcodes based on the provided data
// @Tags barcodes // @Tags barcodes
// @Param type path string true "Barcode type" Enums(ean13, code128) // @Param type path string true "Barcode type" Enums(ean13, code128)
// @Param content path string true "Barcode content" MinLength(1) // @Param content path string true "Barcode content" MinLength(1)
// @Produce image/png // @Produce image/png
// @Router /v1/barcodes/{type}/{content} [get] // @Router /v1/barcodes/{type}/{content} [get]
func (h *DefaultHandler) GenerateBarcode(c *fiber.Ctx) error { func (h *DefaultHandler) GenerateBarcode(c *fiber.Ctx) error {
c.Set(fiber.HeaderContentType, "text/plain") c.Set(fiber.HeaderContentType, "text/plain")
return c.Send([]byte("Hello, World!")) return c.Send([]byte("Hello, World!"))

View File

@ -10,14 +10,14 @@ import (
) )
// GenerateCard godoc // GenerateCard godoc
// @Summary Generate runner cards // @Summary Generate runner cards
// @Description Generate cards based on the provided data // @Description Generate cards based on the provided data
// @Tags pdfs // @Tags pdfs
// @Accept json // @Accept json
// @Param data body models.CardRequest true "Card data" // @Param data body models.CardRequest true "Card data"
// @Produce application/pdf // @Produce application/pdf
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Router /v1/pdfs/cards [post] // @Router /v1/pdfs/cards [post]
func (h *DefaultHandler) GenerateCard(c *fiber.Ctx) error { func (h *DefaultHandler) GenerateCard(c *fiber.Ctx) error {
cardRequest := new(models.CardRequest) cardRequest := new(models.CardRequest)
if err := c.BodyParser(cardRequest); err != nil { if err := c.BodyParser(cardRequest); err != nil {

View File

@ -10,14 +10,14 @@ import (
) )
// GenerateCertificate godoc // GenerateCertificate godoc
// @Summary Generate runner certificates // @Summary Generate runner certificates
// @Description Generate certificates based on the provided data // @Description Generate certificates based on the provided data
// @Tags pdfs // @Tags pdfs
// @Accept json // @Accept json
// @Param data body models.CertificateRequest true "Certificate data" // @Param data body models.CertificateRequest true "Certificate data"
// @Produce application/pdf // @Produce application/pdf
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Router /v1/pdfs/certificates [post] // @Router /v1/pdfs/certificates [post]
func (h *DefaultHandler) GenerateCertificate(c *fiber.Ctx) error { func (h *DefaultHandler) GenerateCertificate(c *fiber.Ctx) error {
certificateRequest := new(models.CertificateRequest) certificateRequest := new(models.CertificateRequest)
if err := c.BodyParser(certificateRequest); err != nil { if err := c.BodyParser(certificateRequest); err != nil {

View File

@ -10,14 +10,14 @@ import (
) )
// GenerateContract godoc // GenerateContract godoc
// @Summary Generate a contract // @Summary Generate a contract
// @Description Generate a contract based on the provided data // @Description Generate a contract based on the provided data
// @Tags pdfs // @Tags pdfs
// @Accept json // @Accept json
// @Param data body models.ContractRequest true "Contract data" // @Param data body models.ContractRequest true "Contract data"
// @Produce application/pdf // @Produce application/pdf
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Router /v1/pdfs/contracts [post] // @Router /v1/pdfs/contracts [post]
func (h *DefaultHandler) GenerateContract(c *fiber.Ctx) error { func (h *DefaultHandler) GenerateContract(c *fiber.Ctx) error {
contract := new(models.ContractRequest) contract := new(models.ContractRequest)
if err := c.BodyParser(contract); err != nil { if err := c.BodyParser(contract); err != nil {

20
main.go
View File

@ -55,16 +55,16 @@ func loadEnv() error {
return nil return nil
} }
// @title LfK Document Server API // @title LfK Document Server API
// @description This is the API documentation for the LfK Document Server - a tool for pdf generation. // @description This is the API documentation for the LfK Document Server - a tool for pdf generation.
// @license.name CC BY-NC-SA 4.0 // @license.name CC BY-NC-SA 4.0
// @termsOfService https://lauf-fuer-kaya.de/datenschutz // @termsOfService https://lauf-fuer-kaya.de/datenschutz
// @contact.name ODIT.Services UG (haftungsbeschränkt) // @contact.name ODIT.Services UG (haftungsbeschränkt)
// @contact.url https://odit.services // @contact.url https://odit.services
// @contact.email info@odit.services // @contact.email info@odit.services
// @securityDefinitions.apiKey ApiKeyAuth // @securityDefinitions.apiKey ApiKeyAuth
// @in query // @in query
// @name key // @name key
func main() { func main() {
err := loadEnv() err := loadEnv()