more endpoints and types

This commit is contained in:
2021-12-02 14:28:53 +01:00
parent ca3d6c690b
commit b5d20b185f

View File

@ -6,21 +6,6 @@ info:
paths:
/pdb/v2/test1:
get:
tags: [ "Regular" ]
operationId: Regular.test1all
summary: Returns all entries from table test1
responses:
200:
description: Here are your test1 items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/test1"
404:
description: No test1 items available
# post:
# tags: [ "Regular" ]
# operationId: Regular.test1insert
@ -34,34 +19,6 @@ paths:
# responses:
# 201:
# description: Your items has been inserted
/pdb/v2/test1/specificSelectName/{txt}:
get:
tags: [ "Regular" ]
operationId: Regular.test1specificSelectName
summary: Returns entries from table test1 using a dedicated select statement
description:
STATEMENTBEGIN
select nr, txt
from test1
where txt = @txt
STATEMENTEND
parameters:
- name: txt
in: path
required: true
schema:
type: string
responses:
200:
description: Here are your test1 items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/specificResultType"
404:
description: No such test1 item available
/pdb/v2/productionOrder/{productionOrderNumber}:
get:
tags: [ "Regular" ]
@ -70,7 +27,7 @@ paths:
description:
STATEMENTBEGIN
SELECT produktionsauftrag AS productionOrderNumber,
C_Nummer AS cNumber,
C_Nummer AS cgNumber,
artikelcode AS articleCode,
stueckzahl AS numOfParts,
IX AS ix,
@ -123,8 +80,229 @@ paths:
type: array
items:
$ref: "#/components/schemas/baseData"
404:
description: No such baseData entries available
400:
$ref: "#/components/responses/clientSideError"
500:
$ref: "#/components/responses/serverSideError"
/pdb/v2/productionItem/{serialNumber}:
get:
tags: [ "Regular" ]
operationId: Regular.productionItem
summary: Returns productionItem entries
description:
STATEMENTBEGIN
SELECT seriennummer AS serialNumber,
produktionsauftrag AS productionOrder,
ERev_geplant AS eRevPlanned,
ERev_gefertigt AS eRevDone,
ergebnis_erstinbetriebnahme AS resultFirstStartup,
kalibrierung_ergebnis AS resultCalibration,
ausliefer_datum AS deliveryDate,
sn_lp1 AS snlp1,
sn_lp2 AS snlp2,
sn_lp3 AS snlp3,
sn_lp4 AS snlp4,
sn_lp5 AS snlp5,
sn_lp6 AS snlp6,
sn_lp7 AS snlp7,
sn_lp8 AS snlp8,
sn_lp9 AS snlp9,
sn_lp10 AS snlp10
FROM geraete_daten
WHERE seriennummer = @serialNumber
STATEMENTEND
parameters:
- name: serialNumber
in: path
required: true
schema:
type: string
responses:
200:
description: Here are your productionItem items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/productionItem"
400:
$ref: "#/components/responses/clientSideError"
500:
$ref: "#/components/responses/serverSideError"
/pdb/v2/productionItemReference/{serialNumber}:
get:
tags: [ "Regular" ]
operationId: Regular.productionItemReference
summary: Returns productionOrderItem entries
description:
STATEMENTBEGIN
SELECT produktionsauftrag AS productionOrder,
seriennummer AS serialNumber,
n AS batchIndex
FROM sn
WHERE seriennummer = @serialNumber
STATEMENTEND
parameters:
- name: serialNumber
in: path
required: true
schema:
type: integer
responses:
200:
description: Here are your productionOrderItem items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/productionOrderItem"
400:
$ref: "#/components/responses/clientSideError"
500:
$ref: "#/components/responses/serverSideError"
/pdb/v2/productionOrderItemList/{productionOrder}:
get:
tags: [ "Regular" ]
operationId: Regular.productionOrderItemList
summary: Returns productionOrderItem entries
description:
STATEMENTBEGIN
SELECT produktionsauftrag AS productionOrder,
seriennummer as serialNumber,
n as batchIndex
FROM sn
WHERE produktionsauftrag = @productionOrder
STATEMENTEND
parameters:
- name: productionOrder
in: path
required: true
schema:
type: string
responses:
200:
description: Here are your productionOrderItem items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/productionOrderItem"
400:
$ref: "#/components/responses/clientSideError"
500:
$ref: "#/components/responses/serverSideError"
# /pdb/v2/runDataById/{runId}:
# get:
# tags: [ "Regular" ]
# operationId: Regular.runDataById
# summary: Returns runData entries
# description:
# STATEMENTBEGIN
# SELECT run_id,
# message,
# system_serial_number,
# electronic_serial_number,
# timestamp,
# machine_name,
# appname,
# appversion
# FROM pdb_doc.runs
# WHERE run_id = @runId
# STATEMENTEND
# parameters:
# - name: runId
# in: path
# required: true
# schema:
# type: string
# responses:
# 200:
# description: Here are your runData items
# content:
# application/json:
# schema:
# type: array
# items:
# $ref: "#/components/schemas/runData"
# 400:
# $ref: "#/components/responses/clientSideError"
# 500:
# $ref: "#/components/responses/serverSideError"
# /pdb/v2/resultsDataById/{runId}:
# get:
# tags: [ "Regular" ]
# operationId: Regular.resultsDataById
# summary: Returns resultsData entries
# description:
# STATEMENTBEGIN
# SELECT run_Id,
# name,
# type,
# objNr,
# subNr,
# value
# FROM pdb_doc.results
# WHERE run_id = @runId
# STATEMENTEND
# parameters:
# - name: runId
# in: path
# required: true
# schema:
# type: string
# responses:
# 200:
# description: Here are your resultsData items
# content:
# application/json:
# schema:
# type: array
# items:
# $ref: "#/components/schemas/resultsData"
# 400:
# $ref: "#/components/responses/clientSideError"
# 500:
# $ref: "#/components/responses/serverSideError"
# /pdb/v2/runDataBySystemSerialNumber/{runId}:
# get:
# tags: [ "Regular" ]
# operationId: Regular.runDataBySystemSerialNumber
# summary: Returns runData entries
# description:
# STATEMENTBEGIN
# SELECT run_id,
# message,
# system_serial_number,
# electronic_serial_number,
# timestamp,
# machine_name,
# appname,
# appversion
# FROM pdb_doc.runs
# WHERE system_serial_number = @systemSerialNumber
# STATEMENTEND
# parameters:
# - name: runId
# in: path
# required: true
# schema:
# type: string
# responses:
# 200:
# description: Here are your runData items
# content:
# application/json:
# schema:
# type: array
# items:
# $ref: "#/components/schemas/runData"
# 400:
# $ref: "#/components/responses/clientSideError"
# 500:
# $ref: "#/components/responses/serverSideError"
components:
responses:
@ -159,33 +337,13 @@ components:
offensiveData:
description: Input data which causes this error
type: string
test1:
description: A test1 item
type: object
required:
- id
properties:
id:
type: integer
txt:
type: string
nr:
type: integer
specificResultType:
description: Specific result type to defintion select clause
type: object
properties:
txt:
type: string
nr:
type: integer
productionOrder:
description: Selecting columns of the auftraege table from pdb_el
type: object
properties:
productionOrderNumber:
type: string
cNumber:
cgNumber:
type: string
nullable: true
articleCode:
@ -206,3 +364,49 @@ components:
type: string
description:
type: string
productionItem:
type: object
properties:
serialNumber:
type: integer
productionOrder:
type: string
eRevPlanned:
type: string
eRevDone:
type: string
resultFirstStartup:
type: string
resultCalibration:
type: string
deliveryDate:
type: datetime
snlp1:
type: integer
snlp2:
type: integer
snlp3:
type: integer
snlp4:
type: integer
snlp5:
type: integer
snlp6:
type: integer
snlp7:
type: integer
snlp8:
type: integer
snlp9:
type: integer
snlp10:
type: integer
productionOrderItem:
type: object
properties:
productionOrder:
type: string
serialNumber:
type: integer
batchIndex:
type: integer