Merge branch 'yaml_export' into feature/db_storage
This commit is contained in:
commit
c88f55427d
13
src/server/BreCal/api/berths.py
Normal file
13
src/server/BreCal/api/berths.py
Normal file
@ -0,0 +1,13 @@
|
||||
from flask import Blueprint, request
|
||||
from webargs.flaskparser import parser
|
||||
from marshmallow import Schema, fields
|
||||
from ..schemas import model
|
||||
from .. import impl
|
||||
|
||||
bp = Blueprint('berths', __name__)
|
||||
|
||||
|
||||
@bp.route('/berths', methods=['get'])
|
||||
def GetBerths():
|
||||
|
||||
return impl.berths.GetBerths()
|
||||
@ -1,3 +1,4 @@
|
||||
from . import berths
|
||||
from . import notifications
|
||||
from . import participant
|
||||
from . import shipcalls
|
||||
|
||||
19
src/server/BreCal/impl/berths.py
Normal file
19
src/server/BreCal/impl/berths.py
Normal file
@ -0,0 +1,19 @@
|
||||
import json
|
||||
|
||||
|
||||
def GetBerths():
|
||||
"""
|
||||
|
||||
"""
|
||||
|
||||
# Implement your business logic here
|
||||
# All the parameters are present in the options argument
|
||||
|
||||
return json.dumps([{
|
||||
"id": "<integer>",
|
||||
"name1": "<string>",
|
||||
"name2": "<string>",
|
||||
}]), 200
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
from marshmallow import Schema, fields
|
||||
|
||||
|
||||
class Berth(Schema):
|
||||
id = fields.Int()
|
||||
name1 = fields.String()
|
||||
name2 = fields.String()
|
||||
|
||||
|
||||
class Error(Schema):
|
||||
message = fields.String(required=True,)
|
||||
|
||||
@ -57,6 +63,10 @@ class TimesId(Schema):
|
||||
pass
|
||||
|
||||
|
||||
class BerthList(Berth):
|
||||
pass
|
||||
|
||||
|
||||
class NotificationList(Notification):
|
||||
pass
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user