Ejemplo n.º 1
0
        public async Task <IActionResult> Generate([FromBody] GenerateRequest generateRequest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var getOSSObjectResult = m_PreviewManager.GetOSSObject(generateRequest.OSSPath);

            if (!getOSSObjectResult.IsSuccess)
            {
                return(Json(getOSSObjectResult));
            }

            var ossObjectDto = getOSSObjectResult.Data;
            var result       = ossObjectDto.IsHtml
                ? await m_HtmlPreviewManager.GenerateAsync(ossObjectDto, generateRequest.IsRegenerate)
                : await m_PreviewManager.GenerateAsync(ossObjectDto, generateRequest.IsRegenerate);

            return(Json(result));
        }