public IActionResult Generate(FileGenerate file) { var res = new RequestHelper(factory).PostRequest("api/FillDocx/Generate", file); if (res.StatusCode == 200) { return(Download(new FileDownload { filename = res.Content.ToString() })); } return(BadRequest()); }
public Response Generate(FileGenerate file) { try { info.ProcessDocxJson(file.templatename, file.content); return(new Response { StatusCode = 200, Content = info.TimeStamp + ".Report.docx", Message = "Generate Success" }); } catch (Exception ex) { return(new Response { StatusCode = 404, Content = ex.Message, Message = "Fail To Generate" }); } }