feat(contracts): Baseline handler
This commit is contained in:
parent
13e9c88a8e
commit
145ebd8346
@ -1,6 +1,11 @@
|
||||
package handlers
|
||||
|
||||
import "github.com/gofiber/fiber/v2"
|
||||
import (
|
||||
"log"
|
||||
|
||||
"git.odit.services/lfk/document-server/models"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
// GenerateContract godoc
|
||||
// @Summary Generate a contract
|
||||
@ -11,5 +16,12 @@ import "github.com/gofiber/fiber/v2"
|
||||
// @Produce application/pdf
|
||||
// @Router /contracts [post]
|
||||
func GenerateContract(c *fiber.Ctx) error {
|
||||
return c.SendString("Generate Contract")
|
||||
contract := new(models.Contract)
|
||||
if err := c.BodyParser(contract); err != nil {
|
||||
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||
"error": err.Error(),
|
||||
})
|
||||
}
|
||||
log.Println(contract.Runners[0].Group.ParentGroup)
|
||||
return c.SendString("Contract generated")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user