Exemplo n.º 1
0
        public HttpResponseMessage OfferedRentAppraiseProperty([FromBody] OfferedRentInput offeredRentInput)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, ModelState));
                }

                apiManager = new APIManager(token);

                string userAgent = String.Empty;

                if (Request.Headers.UserAgent != null)
                {
                    userAgent = Convert.ToString(Request.Headers.UserAgent);
                }

                AppServiceApi.Models.OfferedRentOutput offeredRentOutput = apiManager.processOfferedRentInput(offeredRentInput, userAgent);

                return(Request.CreateResponse(HttpStatusCode.OK, offeredRentOutput));
            }
            catch (Exception ex)
            {
                ErrorAsync(ex, Request.RequestUri.AbsoluteUri.ToString());
                return(Request.CreateResponse(HttpStatusCode.BadRequest, new { message = "Bad Request" }));
            }
        }
Exemplo n.º 2
0
        public HttpResponseMessage ImageProcessingForRent([FromBody] OfferedRentApiInput apiInput)
        {
            try
            {
                //if (!IsAuthorised(out errorMessage))
                //    return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, errorMessage);

                if (!ModelState.IsValid)
                {
                    return(Request.CreateResponse(HttpStatusCode.BadRequest, ModelState));
                }

                string userAgent = String.Empty;

                if (Request.Headers.UserAgent != null)
                {
                    userAgent = Convert.ToString(Request.Headers.UserAgent);
                }

                apiManager = new APIManager(token);
                AppServiceApi.Models.OfferedRentOutput offeredRentOutput = apiManager.processImageLatLonForOfferedRent(apiInput.imageBase64, apiInput.lat, apiInput.lng, apiInput.deviceId, userAgent);

                return(Request.CreateResponse(HttpStatusCode.OK, offeredRentOutput));
            }

            catch (Exception ex)
            {
                ErrorAsync(ex, Request.RequestUri.AbsoluteUri.ToString());
                return(Request.CreateResponse(HttpStatusCode.BadRequest, new { message = "Bad Request" }));
            }
        }