From ed67f78a55577795eebdf7f752aba5140e5910a1 Mon Sep 17 00:00:00 2001 From: Askill Date: Mon, 16 Mar 2020 00:31:07 +0100 Subject: [PATCH] . --- application/__init__.py | 2 +- application/endpoints.py | 9 ++++----- run.py | 2 +- test.sqlite | Bin 16384 -> 16384 bytes 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/application/__init__.py b/application/__init__.py index da900d0..4a2b19b 100644 --- a/application/__init__.py +++ b/application/__init__.py @@ -12,7 +12,7 @@ app = Flask(__name__) api = Api(app, version='1', contact={"name":""}, license={"name":"Online Dienst Dokumentation"}, api_spec_url='/api/swagger') -api.add_resource(endpoints.PersonList,'/api/v1/person/') +api.add_resource(endpoints.PersonList,'/api/v1/person/', '/api/v1/person/') @app.route("/") def index(): diff --git a/application/endpoints.py b/application/endpoints.py index 1352fa8..725e2b1 100644 --- a/application/endpoints.py +++ b/application/endpoints.py @@ -6,7 +6,7 @@ import json from application.db import Session, Person, Fingerprint class PersonList(Resource): - def post(self, id): + def post(self, id = None): """ """ try: data = "" @@ -15,7 +15,7 @@ class PersonList(Resource): print("error: -", e) return flask.make_response(flask.jsonify({'error': str(e)}), 400) - def get(self, id): + def get(self, id = None): """ """ try: session = Session() @@ -23,7 +23,6 @@ class PersonList(Resource): person = Person(fname="hi", fingerprints=[fingerprint]) session.add(fingerprint) session.add(person) - session.commit() data = list(session.query(Person).all()) @@ -37,7 +36,7 @@ class PersonList(Resource): print("error: -", e) return flask.make_response(flask.jsonify({'error': str(e)}), 400) - def put(self, id): + def put(self, id = None): """ """ try: data = "" @@ -46,7 +45,7 @@ class PersonList(Resource): print("error: -", e) return flask.make_response(flask.jsonify({'error': str(e)}), 400) - def delete(self, id): + def delete(self, id = None): """ """ try: data = "" diff --git a/run.py b/run.py index eacc87a..f644a58 100644 --- a/run.py +++ b/run.py @@ -1,6 +1,6 @@ from application import app -app.run(host="0.0.0.0",port='10024', debug=True) +app.run(host="localhost",port='10024', debug=True) diff --git a/test.sqlite b/test.sqlite index a15cd6616ed037a53e68697aaadfa91ba44537e1..12d8db9dabe266e82b2c5e40b94c146a7dcb7574 100644 GIT binary patch delta 241 zcmZo@U~Fh$oFL7}I#I@%k#%Fj5`Hdb{yql&Tl`!2`!)*-H1PYVFmo_C3NiqJk%5tc zu7RM8^QwvLT1tzcxCJYrIqs>hW%nT>r*H;A^{FZ_LH~$y@x0?kG X?(++?u`qHnGBblICMFgZPEJk$2Kg|m delta 79 zcmZo@U~Fh$oFL7}JWAqJT;OL?VVpccUTpFwc_E