go #49
@ -15,11 +15,11 @@ import (
|
||||
// @Description Generate a contract based on the provided data
|
||||
// @Tags contracts
|
||||
// @Accept json
|
||||
// @Param data body models.Contract true "Contract data"
|
||||
// @Param data body models.ContractRequest true "Contract data"
|
||||
// @Produce application/pdf
|
||||
// @Router /contracts [post]
|
||||
func GenerateContract(c *fiber.Ctx) error {
|
||||
contract := new(models.Contract)
|
||||
contract := new(models.ContractRequest)
|
||||
if err := c.BodyParser(contract); err != nil {
|
||||
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||
"error": err.Error(),
|
||||
|
@ -1,6 +1,6 @@
|
||||
package models
|
||||
|
||||
type Contract struct {
|
||||
type ContractRequest struct {
|
||||
Runners []Runner `json:"runners"`
|
||||
Locale string `json:"locale" enums:"en,de"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user