additional endpoint mechanism and overhead advance mapping by flat method
This commit is contained in:
parent
cf35af9c1e
commit
1335f0f059
29
api/additional_endpoints.yaml
Normal file
29
api/additional_endpoints.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
# -------------------------------------------------------------------
|
||||
# ATTENTION: This file will not be parsed by Cheetah
|
||||
# Use plain openapi/yaml syntax, no Cheetah
|
||||
# escaping
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
|
||||
/v1/overhead_advance_flat_mappings/flat/{flatId}:
|
||||
get:
|
||||
tags: [ "overhead_advance_flat_mapping", "flat" ]
|
||||
summary: Returns all overhead advance mappings for a given flat
|
||||
operationId: additional_methods.get_overhead_advance_flat_mapping_by_flat
|
||||
parameters:
|
||||
- name: flatId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
responses:
|
||||
'200':
|
||||
description: $table.name response
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
||||
security:
|
||||
- jwt: ['secret']
|
19
api/additional_methods.py
Normal file
19
api/additional_methods.py
Normal file
@ -0,0 +1,19 @@
|
||||
from db import dbGetMany, dbGetOne, dbInsert, dbUpdate
|
||||
from loguru import logger
|
||||
import werkzeug
|
||||
|
||||
|
||||
def get_overhead_advance_flat_mapping_by_flat(user, token_info, flatId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
SELECT
|
||||
id
|
||||
,overhead_advance
|
||||
,flat
|
||||
FROM overhead_advance_flat_mapping_t
|
||||
WHERE flat = %s
|
||||
""",
|
||||
"params": (flatId, )
|
||||
}
|
||||
)
|
||||
|
@ -971,6 +971,36 @@ paths:
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# ATTENTION: This file will not be parsed by Cheetah
|
||||
# Use plain openapi/yaml syntax, no Cheetah
|
||||
# escaping
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
|
||||
/v1/overhead_advance_flat_mappings/flat/{flatId}:
|
||||
get:
|
||||
tags: [ "overhead_advance_flat_mapping", "flat" ]
|
||||
summary: Returns all overhead advance mappings for a given flat
|
||||
operationId: additional_methods.get_overhead_advance_flat_mapping_by_flat
|
||||
parameters:
|
||||
- name: flatId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
responses:
|
||||
'200':
|
||||
description: $table.name response
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
jwt:
|
||||
|
@ -105,6 +105,8 @@ paths:
|
||||
#end if
|
||||
#end for
|
||||
|
||||
#include raw "./api/additional_endpoints.yaml"
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
jwt:
|
||||
|
Loading…
x
Reference in New Issue
Block a user