Compare commits
4 Commits
1.0.0
...
1d068b2655
| Author | SHA1 | Date | |
|---|---|---|---|
|
1d068b2655
|
|||
|
ef25adf5ed
|
|||
|
c09c00ec68
|
|||
|
1f4981b0a9
|
@@ -312,18 +312,11 @@ const docTemplate = `{
|
||||
"models.Group": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"parent_group": {
|
||||
"$ref": "#/definitions/models.Group"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -303,18 +303,11 @@
|
||||
"models.Group": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"parent_group": {
|
||||
"$ref": "#/definitions/models.Group"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -94,14 +94,9 @@ definitions:
|
||||
type: object
|
||||
models.Group:
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
name:
|
||||
type: string
|
||||
parent_group:
|
||||
$ref: '#/definitions/models.Group'
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
type: object
|
||||
models.Runner:
|
||||
|
||||
@@ -69,6 +69,7 @@ func (h *DefaultHandler) GenerateCard(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
c.Set(fiber.HeaderContentType, "application/pdf")
|
||||
c.Set(fiber.HeaderContentDisposition, "attachment; filename=runner-cards.pdf")
|
||||
return c.Send(pdf)
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ func (h *DefaultHandler) GenerateCertificate(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
c.Set(fiber.HeaderContentType, "application/pdf")
|
||||
c.Set(fiber.HeaderContentDisposition, "attachment; filename=certificate.pdf")
|
||||
return c.Send(pdf)
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ func (h *DefaultHandler) GenerateContract(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
c.Set(fiber.HeaderContentType, "application/pdf")
|
||||
c.Set(fiber.HeaderContentDisposition, "attachment; filename=runner-contracts.pdf")
|
||||
return c.Send(pdf)
|
||||
}
|
||||
|
||||
|
||||
2
main.go
2
main.go
@@ -45,7 +45,7 @@ func loadEnv() error {
|
||||
viper.AutomaticEnv()
|
||||
err := viper.ReadInConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
log.Println("No .env file found")
|
||||
}
|
||||
|
||||
// Unmarshal the config from file and env into the config struct
|
||||
|
||||
@@ -14,9 +14,7 @@ type Runner struct {
|
||||
}
|
||||
|
||||
type Group struct {
|
||||
ID int `json:"id" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
ParentGroup *Group `json:"parent_group" validate:"optional"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
}
|
||||
|
||||
type ContractTemplateOptions struct {
|
||||
|
||||
Reference in New Issue
Block a user