410 lines
12 KiB
JSON
410 lines
12 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "This is the API documentation for the LfK Document Server - a tool for pdf generation.",
|
|
"title": "LfK Document Server API",
|
|
"termsOfService": "https://lauf-fuer-kaya.de/datenschutz",
|
|
"contact": {
|
|
"name": "ODIT.Services UG (haftungsbeschränkt)",
|
|
"url": "https://odit.services",
|
|
"email": "info@odit.services"
|
|
},
|
|
"license": {
|
|
"name": "CC BY-NC-SA 4.0"
|
|
}
|
|
},
|
|
"paths": {
|
|
"/v1/barcodes/{type}/{content}": {
|
|
"get": {
|
|
"description": "Generate barcodes based on the provided data",
|
|
"produces": [
|
|
"image/png"
|
|
],
|
|
"tags": [
|
|
"barcodes"
|
|
],
|
|
"summary": "Generate barcodes",
|
|
"parameters": [
|
|
{
|
|
"enum": [
|
|
"ean13",
|
|
"code128"
|
|
],
|
|
"type": "string",
|
|
"description": "Barcode type",
|
|
"name": "type",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"minLength": 1,
|
|
"type": "string",
|
|
"description": "Barcode content",
|
|
"name": "content",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"maximum": 10000,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 1000,
|
|
"description": "Barcode width",
|
|
"name": "width",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"maximum": 10000,
|
|
"minimum": 1,
|
|
"type": "integer",
|
|
"default": 1000,
|
|
"description": "Barcode height",
|
|
"name": "height",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"maximum": 100,
|
|
"minimum": 0,
|
|
"type": "integer",
|
|
"default": 10,
|
|
"description": "Padding around the barcode (included in image size)",
|
|
"name": "padding",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/v1/pdfs/cards": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Generate cards based on the provided data",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/pdf"
|
|
],
|
|
"tags": [
|
|
"pdfs"
|
|
],
|
|
"summary": "Generate runner cards",
|
|
"parameters": [
|
|
{
|
|
"description": "Card data",
|
|
"name": "data",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/models.CardRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/v1/pdfs/certificates": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Generate certificates based on the provided data",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/pdf"
|
|
],
|
|
"tags": [
|
|
"pdfs"
|
|
],
|
|
"summary": "Generate runner certificates",
|
|
"parameters": [
|
|
{
|
|
"description": "Certificate data",
|
|
"name": "data",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/models.CertificateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/v1/pdfs/contracts": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Generate a contract based on the provided data",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/pdf"
|
|
],
|
|
"tags": [
|
|
"pdfs"
|
|
],
|
|
"summary": "Generate a contract",
|
|
"parameters": [
|
|
{
|
|
"description": "Contract data",
|
|
"name": "data",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/models.ContractRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"models.Card": {
|
|
"type": "object",
|
|
"required": [
|
|
"code",
|
|
"id",
|
|
"runner"
|
|
],
|
|
"properties": {
|
|
"code": {
|
|
"type": "string"
|
|
},
|
|
"enabled": {
|
|
"type": "boolean",
|
|
"default": true
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"runner": {
|
|
"$ref": "#/definitions/models.Runner"
|
|
}
|
|
}
|
|
},
|
|
"models.CardRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"cards",
|
|
"locale"
|
|
],
|
|
"properties": {
|
|
"cards": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Card"
|
|
}
|
|
},
|
|
"locale": {
|
|
"type": "string",
|
|
"enum": [
|
|
"en",
|
|
"de"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"models.CertificateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"locale",
|
|
"runners"
|
|
],
|
|
"properties": {
|
|
"locale": {
|
|
"type": "string",
|
|
"enum": [
|
|
"en",
|
|
"de"
|
|
]
|
|
},
|
|
"runners": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.RunnerWithDonations"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"models.ContractRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"locale",
|
|
"runners"
|
|
],
|
|
"properties": {
|
|
"locale": {
|
|
"type": "string",
|
|
"enum": [
|
|
"en",
|
|
"de"
|
|
]
|
|
},
|
|
"runners": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.Runner"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"models.DistanceDonation": {
|
|
"type": "object",
|
|
"required": [
|
|
"amount_per_distance",
|
|
"donor",
|
|
"id"
|
|
],
|
|
"properties": {
|
|
"amount": {
|
|
"type": "integer"
|
|
},
|
|
"amount_per_distance": {
|
|
"type": "integer"
|
|
},
|
|
"donor": {
|
|
"$ref": "#/definitions/models.Donor"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"paid_amount": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"models.Donor": {
|
|
"type": "object",
|
|
"required": [
|
|
"first_name",
|
|
"id",
|
|
"last_name"
|
|
],
|
|
"properties": {
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"middle_name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.Group": {
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"parent_group": {
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"models.Runner": {
|
|
"type": "object",
|
|
"required": [
|
|
"first_name",
|
|
"group",
|
|
"id",
|
|
"last_name"
|
|
],
|
|
"properties": {
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"group": {
|
|
"$ref": "#/definitions/models.Group"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"middle_name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.RunnerWithDonations": {
|
|
"type": "object",
|
|
"required": [
|
|
"distance",
|
|
"first_name",
|
|
"group",
|
|
"id",
|
|
"last_name"
|
|
],
|
|
"properties": {
|
|
"distance": {
|
|
"type": "integer"
|
|
},
|
|
"distance_donations": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.DistanceDonation"
|
|
}
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"group": {
|
|
"$ref": "#/definitions/models.Group"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"middle_name": {
|
|
"type": "string"
|
|
},
|
|
"total_donations": {
|
|
"type": "integer"
|
|
},
|
|
"total_per_distance": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"ApiKeyAuth": {
|
|
"type": "apiKey",
|
|
"name": "key",
|
|
"in": "query"
|
|
}
|
|
}
|
|
} |