feat(docs): New swagger doc
This commit is contained in:
parent
11a9b51197
commit
f5debf58fc
117
docs/docs.go
117
docs/docs.go
@ -42,6 +42,33 @@ const docTemplate = `{
|
|||||||
"responses": {}
|
"responses": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/certificates": {
|
||||||
|
"post": {
|
||||||
|
"description": "Generate certificates based on the provided data",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/pdf"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"certificates"
|
||||||
|
],
|
||||||
|
"summary": "Generate runner certificates",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Certificate data",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.CertificateRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/contracts": {
|
"/contracts": {
|
||||||
"post": {
|
"post": {
|
||||||
"description": "Generate a contract based on the provided data",
|
"description": "Generate a contract based on the provided data",
|
||||||
@ -106,6 +133,24 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.CertificateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"locale": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"en",
|
||||||
|
"de"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"runners": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/models.RunnerWithDonations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.ContractRequest": {
|
"models.ContractRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -124,6 +169,43 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.DistanceDonation": {
|
||||||
|
"type": "object",
|
||||||
|
"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",
|
||||||
|
"properties": {
|
||||||
|
"first_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"last_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"middle_name": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.Group": {
|
"models.Group": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -157,6 +239,41 @@ const docTemplate = `{
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"models.RunnerWithDonations": {
|
||||||
|
"type": "object",
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`
|
}`
|
||||||
|
@ -33,6 +33,33 @@
|
|||||||
"responses": {}
|
"responses": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/certificates": {
|
||||||
|
"post": {
|
||||||
|
"description": "Generate certificates based on the provided data",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/pdf"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"certificates"
|
||||||
|
],
|
||||||
|
"summary": "Generate runner certificates",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Certificate data",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.CertificateRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/contracts": {
|
"/contracts": {
|
||||||
"post": {
|
"post": {
|
||||||
"description": "Generate a contract based on the provided data",
|
"description": "Generate a contract based on the provided data",
|
||||||
@ -97,6 +124,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.CertificateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"locale": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"en",
|
||||||
|
"de"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"runners": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/models.RunnerWithDonations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.ContractRequest": {
|
"models.ContractRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -115,6 +160,43 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.DistanceDonation": {
|
||||||
|
"type": "object",
|
||||||
|
"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",
|
||||||
|
"properties": {
|
||||||
|
"first_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"last_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"middle_name": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.Group": {
|
"models.Group": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -148,6 +230,41 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"models.RunnerWithDonations": {
|
||||||
|
"type": "object",
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,6 +22,18 @@ definitions:
|
|||||||
- de
|
- de
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
models.CertificateRequest:
|
||||||
|
properties:
|
||||||
|
locale:
|
||||||
|
enum:
|
||||||
|
- en
|
||||||
|
- de
|
||||||
|
type: string
|
||||||
|
runners:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/models.RunnerWithDonations'
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
models.ContractRequest:
|
models.ContractRequest:
|
||||||
properties:
|
properties:
|
||||||
locale:
|
locale:
|
||||||
@ -34,6 +46,30 @@ definitions:
|
|||||||
$ref: '#/definitions/models.Runner'
|
$ref: '#/definitions/models.Runner'
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
|
models.DistanceDonation:
|
||||||
|
properties:
|
||||||
|
amount:
|
||||||
|
type: integer
|
||||||
|
amount_per_distance:
|
||||||
|
type: integer
|
||||||
|
donor:
|
||||||
|
$ref: '#/definitions/models.Donor'
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
paid_amount:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
models.Donor:
|
||||||
|
properties:
|
||||||
|
first_name:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
last_name:
|
||||||
|
type: string
|
||||||
|
middle_name:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
models.Group:
|
models.Group:
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
@ -56,6 +92,29 @@ definitions:
|
|||||||
middle_name:
|
middle_name:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
models.RunnerWithDonations:
|
||||||
|
properties:
|
||||||
|
distance:
|
||||||
|
type: integer
|
||||||
|
distance_donations:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/models.DistanceDonation'
|
||||||
|
type: array
|
||||||
|
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
|
||||||
|
type: object
|
||||||
info:
|
info:
|
||||||
contact: {}
|
contact: {}
|
||||||
description: This is the API documentation for the LfK Document Server - a tool
|
description: This is the API documentation for the LfK Document Server - a tool
|
||||||
@ -80,6 +139,24 @@ paths:
|
|||||||
summary: Generate runner cards
|
summary: Generate runner cards
|
||||||
tags:
|
tags:
|
||||||
- cards
|
- cards
|
||||||
|
/certificates:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Generate certificates based on the provided data
|
||||||
|
parameters:
|
||||||
|
- description: Certificate data
|
||||||
|
in: body
|
||||||
|
name: data
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/models.CertificateRequest'
|
||||||
|
produces:
|
||||||
|
- application/pdf
|
||||||
|
responses: {}
|
||||||
|
summary: Generate runner certificates
|
||||||
|
tags:
|
||||||
|
- certificates
|
||||||
/contracts:
|
/contracts:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user