added ship endpoint

This commit is contained in:
Daniel Schick 2023-04-08 18:19:26 +02:00
parent d44671dfa9
commit a833863761
2 changed files with 55 additions and 5 deletions

View File

@ -21,19 +21,19 @@ paths:
# tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step4_paths_object.html # tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step4_paths_object.html
/verify: /verify:
get: get:
summary: Get the user id if successful summary: Returns a session key if successful
responses: responses:
200: 200:
description: Successful response description: Successful response
content: content:
application/json: application/json:
schema: schema:
title: Verify user token title: Session key
type: integer type: string
400: 400:
$ref: '#/components/responses/400' $ref: '#/components/responses/400'
401: 403:
$ref: '#/components/responses/401' $ref: '#/components/responses/403'
500: 500:
$ref: '#/components/responses/500' $ref: '#/components/responses/500'
503: 503:
@ -102,6 +102,25 @@ paths:
503: 503:
$ref: '#/components/responses/503' $ref: '#/components/responses/503'
/ships:
get:
summary: gets a list of registered shipcalls
responses:
200:
description: list of ships
content:
application/json:
schema:
$ref: '#/components/schemas/ship_list'
400:
$ref: '#/components/responses/400'
401:
$ref: '#/components/responses/401'
500:
$ref: '#/components/responses/500'
503:
$ref: '#/components/responses/503'
/participant: /participant:
get: get:
summary: gets a particular participant entry corresponding to user id summary: gets a particular participant entry corresponding to user id
@ -343,6 +362,36 @@ components:
items: items:
$ref: '#/components/schemas/berth' $ref: '#/components/schemas/berth'
ship:
type: object
description: a ship
properties:
id:
type: integer
name:
type: string
imo:
type: integer
callsign:
type: string
length:
type: number
format: float
width:
type: number
format: float
created:
type: string
format: date-time
modified:
type: string
format: date-time
ship_list:
type: array
items:
$ref: '#/components/schemas/ship'
notification: notification:
type: object type: object
description: a notification created by the engine if a times entry violates a rule description: a notification created by the engine if a times entry violates a rule

View File

@ -20,6 +20,7 @@ def GetTimes(options):
"shipcall_id": "<integer>", "shipcall_id": "<integer>",
"start_actual": "<date-time>", "start_actual": "<date-time>",
"start_planned": "<date-time>", "start_planned": "<date-time>",
"remark":"<string>"
}]), 200 }]), 200