WEB/Praktikum3/bt/app/error.py
2017-01-16 23:32:28 +01:00

140 lines
4.6 KiB
Python

# coding: utf-8
import json
import cherrypy
#from .database import SourceDatabase_cl, EvaluatedDatabase_cl
# Method-Dispatching!
# Übersicht Anforderungen / Methoden
# (beachte: / relativ zu /navigation, siehe Konfiguration Server!)
"""
Anforderung GET PUT POST DELETE
-----------------------------------------------------------------------------------------
/katfehler/ alle Fehlerkategorien
/katfehler/:katfehler-id
einzelne Fehlerkategorien Fehler löschen
/katfehler/+Daten neue FK speichern
/katfehler/:katfehler-id+Daten Fehler ändern
"""
#----------------------------------------------------------
class KatFehler_cl(object):
#----------------------------------------------------------
exposed = True # gilt für alle Methoden
#-------------------------------------------------------
def __init__(self):
#-------------------------------------------------------
pass
#-------------------------------------------------------
def GET(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
#-------------------------------------------------------
def PUT(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
#-------------------------------------------------------
def POST(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
#-------------------------------------------------------
def DELETE(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
"""
Anforderung GET PUT POST DELETE
-----------------------------------------------------------------------------------------
/katursache/ alle Fehlerkategorien
/katursache/:katursache-id
einzelne Fehlerkategorien Fehler löschen
/katursache/+Daten neue FK speichern
/katursache/:katursache-id+Daten Fehler ändern
"""
#----------------------------------------------------------
class KatUrsache_cl(object):
#----------------------------------------------------------
exposed = True # gilt für alle Methoden
#-------------------------------------------------------
def __init__(self):
#-------------------------------------------------------
pass
#-------------------------------------------------------
def GET(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
#-------------------------------------------------------
def PUT(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
#-------------------------------------------------------
def POST(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
#-------------------------------------------------------
def DELETE(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
"""
Anforderung GET PUT POST DELETE
-----------------------------------------------------------------------------------------
/fehler/ alle Fehler
/fehler/?type=erkannt alle erkannten Fehler
/fehler/?type=behoben alle behobenen Fehler
/fehler/:fehler-id einzelner Fehler
/fehler/+Daten Fehler speichern
Rückgabe Id
/fehler/:fehler-id+Daten Fehler ändern
"""
#----------------------------------------------------------
class Fehler_cl(object):
#----------------------------------------------------------
exposed = True # gilt für alle Methoden
#-------------------------------------------------------
def __init__(self):
#-------------------------------------------------------
pass
#-------------------------------------------------------
def GET(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
#-------------------------------------------------------
def PUT(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
#-------------------------------------------------------
def POST(self):
#-------------------------------------------------------
return json.dumps(retVal_o)
# EOF