def getAllAnnouncements(): if request.method == 'POST': return AnnouncementHandler().insertAnnouncement(request.form) else: if not request.args: return AnnouncementHandler().getAllAnnouncements() else: return AnnouncementHandler().searchAnnouncements(request.args)
def getAnnouncementByID(a_id): if request.method == 'GET': return AnnouncementHandler().getAnnouncementByID(a_id) elif request.method == 'PUT': return AnnouncementHandler().putAnnouncementByID(request.form, a_id) elif request.method == 'DELETE': return AnnouncementHandler().deleteAnnouncementByID(a_id) else: return jsonify(Error="Method not allowed"), 405
def getResourcestByAnnouncements(): return AnnouncementHandler().getResourcesByAnnouncements()
def getAllAvailableResources(): if request.args: return AnnouncementHandler().searchAvailableResources(request.args) else: return AnnouncementHandler().getAllAvailableResources()
def getAvailableAnnouncements(): return AnnouncementHandler().getAvailableAnnouncements()
def getSellerByAnnouncementId(a_id): return AnnouncementHandler().getSellerByAnnouncementId(a_id)
def getResourcesByAnnouncementId(a_id): return AnnouncementHandler().getResourcesByAnnouncementId(a_id)