コード例 #1
0
        public JsonResult CatchUp(string accessToken)
        {
            if (HttpContext.Request.RequestType == "POST")
            {
                var newAccessToken = _accessTokenService.GenerateAccessToken(accessToken);

                if (newAccessToken == null)
                {
                    return(Json(new { status = "INVALID ACCESSTOKEN" }));
                }

                var userId = _accessTokenService.GetUserId(newAccessToken);

                var driver = _driverService.GetDriverByUserId(userId);
                var car    = _carService.GetCarByDriver(driver);
                return(Json(new { request = _requestService.CatchUpRequest(car), status = "OK", accessToken = newAccessToken }));
            }
            return(Json(new { }));
        }