예제 #1
0
def getAllClothes():
    if request.method == 'POST':
        return ClothHandler().insertCloth(request.json)
    else:
        if not request.args:
            return ClothHandler().getAllClothes()
        else:
            return ClothHandler().searchClothes(request.args)
예제 #2
0
def getClothById(cloth_id):
    if request.method == 'GET':
        return ClothHandler().getClothById(cloth_id)
    elif request.method == 'PUT':
        return ClothHandler().updateCloth(cloth_id, request.json)
    elif request.method == 'DELETE':
        return ClothHandler().deleteCloth(cloth_id)
    else:
        return jsonify(Error="Method not allowed."), 405
예제 #3
0
 def getResourceFullInfo(self, resource_id):
     resource_dao = ResourceDAO()
     category = resource_dao.getResourceById(resource_id)[2]
     if category == 1:
         return FuelHandler().getFuelByResourceId(resource_id)
     elif category == 2:
         return FoodHandler().getFoodByResourceId(resource_id)
     elif category == 3:
         return MedicineHandler().getMedicineByResourceId(resource_id)
     elif category == 4:
         return ToolHandler().getToolByResourceId(resource_id)
     elif category == 5:
         return ClothHandler().getClothByResourceId(resource_id)
     elif category == 6:
         return HeavyEquipHandler().getHeavyEquipByResourceId(resource_id)
     elif category == 7:
         return WaterHandler().getWaterByResourceId(resource_id)
     elif category == 8:
         return MedDeviceHandler().getMedDeviceByResourceId(resource_id)
     elif category == 9:
         return BatteryHandler().getBatteryByResourceId(resource_id)
     elif category == 10:
         return GeneratorHandler().getGeneratorByResourceId(resource_id)
     elif category == 11:
         return IceHandler().getIceByResourceId(resource_id)
     else:
         return jsonify(Error="Invalid category"), 400
예제 #4
0
def getAllReservedClothesBySupplierId(supplier_id):
    return ClothHandler().getAllReservedClothesBySupplierId(supplier_id)
예제 #5
0
def getAllReservedClothes():
    return ClothHandler().getAllReservedClothes()
예제 #6
0
def getAllAvailableClothesBySupplierId(supplier_id):
    return ClothHandler().getAllAvailableClothesBySupplierId(supplier_id)
예제 #7
0
def getAllAvailableClothes():
    return ClothHandler().getAllAvailableClothes()
예제 #8
0
def getClothAddress(cloth_id):
    return ClothHandler().getClothAddress(cloth_id)
예제 #9
0
def getClothesBySupplierId(supplier_id):
    return ClothHandler().getClothesBySupplierId(supplier_id)