コード例 #1
0
ファイル: routes.py プロジェクト: sneyd321/Homeower-Gateway
def lease_complete(province, houseId):
    leaseService = zookeeper.get_service("lease-service")
    if leaseService:
        leaseManager = RequestManager(request, leaseService)
        return leaseManager.post_html("/lease/v1/LeaseComplete/" + province +
                                      "/" + str(houseId))
    return Response(response="Error: Lease Not Available", status=503)
コード例 #2
0
ファイル: routes.py プロジェクト: sneyd321/Homeower-Gateway
def create_rental_unit_location(province, houseId):
    houseService = zookeeper.get_service("house-service")
    if houseService:
        houseManager = RequestManager(request, houseService)
        return houseManager.post_html("/house/v1/RentalUnitLocation/" +
                                      province + "/" + str(houseId))
    return Response(response="Error: House Not Available", status=503)
コード例 #3
0
ファイル: routes.py プロジェクト: sneyd321/Homeower-Gateway
def house_complete(houseId):
    houseService = zookeeper.get_service("house-service")
    if houseService:
        houseManager = RequestManager(request, houseService)
        return houseManager.post_html("/house/v1/HouseComplete/" +
                                      str(houseId))
    return Response(response="Error: House Service Currently Unavailable",
                    status=503)
コード例 #4
0
ファイル: routes.py プロジェクト: sneyd321/Homeower-Gateway
def create_homeowner_location(province, arrangement, homeownerId, houseId):
    houseService = zookeeper.get_service("house-service")
    if houseService:
        houseManager = RequestManager(request, houseService)
        return houseManager.post_html("/house/v1/HomeownerLocation/" +
                                      province + "/" + arrangement + "/" +
                                      str(homeownerId) + "/" + str(houseId))
    return Response(response="Error: House Not Available", status=503)
コード例 #5
0
ファイル: routes.py プロジェクト: sneyd321/Homeower-Gateway
def create_arrangement():
    homeownerService = zookeeper.get_service("homeowner-service")
    if homeownerService:
        headers = {"Authorization": "Bearer " + request.form.get("token")}
        homeownerManager = RequestManager(request, homeownerService)
        homeownerId = homeownerManager.authenticate(headers=headers)
        if homeownerId:
            houseService = zookeeper.get_service("house-service")
            if houseService:
                houseManager = RequestManager(request, houseService)
                return houseManager.post_html("/house/v1/House/" +
                                              str(homeownerId),
                                              headers=headers)
            return Response(
                response="Error: House Service Currently Unavailable",
                status=503)
        return Response(response="Not Authorized", status=401)
    return Response(response="Error: Homeowner Not Available", status=503)
コード例 #6
0
ファイル: routes.py プロジェクト: sneyd321/Homeower-Gateway
def create_rent_details(province, houseId):
    homeownerService = zookeeper.get_service("homeowner-service")
    if homeownerService:
        headers = {"Authorization": "Bearer " + request.form.get("token")}
        homeownerManager = RequestManager(request, homeownerService)
        homeownerId = homeownerManager.authenticate(headers=headers)
        if homeownerId:
            leaseService = zookeeper.get_service("lease-service")
            if leaseService:
                leaseManager = RequestManager(request, leaseService)
                return leaseManager.post_html("/lease/v1/RentDetails/" +
                                              province + "/" + str(houseId),
                                              headers=headers)
            return Response(
                response="Error: House Service Currently Unavailable",
                status=503)
        return Response(response="Not Authorized", status=401)
    return Response(response="Error: Lease Not Available", status=503)
コード例 #7
0
ファイル: routes.py プロジェクト: sneyd321/Homeower-Gateway
def create_homeowner_account():
    service = zookeeper.get_service("homeowner-service")
    if service:
        manager = RequestManager(request, service)
        return manager.post_html("/homeowner/v1/")
    return Response(response="Error: Zookeeper down", status=503)