Spring MVC 在线预览
2021-01-16 16:12
标签:cat row ret tps post res cte gre 在线 Spring MVC 在线预览 标签:cat row ret tps post res cte gre 在线 原文地址:https://www.cnblogs.com/houyl/p/12923965.html/**
* 合同URL转换-空白合同(服务器加了白名单)
* @return
* @throws IOException
*/
@RequestMapping(value = "/yunji/agreement/get_template", method = RequestMethod.GET)
public void get_template(String s, HttpServletResponse response) {
String path = formsOpenapiConfig.getZd_post_url()+"api/v1/yunji/agreement/get_template?s="+s;
try {
byte[] html = yunJiService.createHtml(path);
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("utf-8");
response.getWriter().write(new String(html));
} catch (IOException e) {
e.printStackTrace();
}
response.setStatus(HttpServletResponse.SC_OK);
}
/**
* 合同URL转换-PDF(服务器加了白名单)
* @return
* @throws IOException
*/
@RequestMapping(value = "/link", method = RequestMethod.GET)
public void link(String s, HttpServletResponse response) {
String path = formsOpenapiConfig.getZd_post_url()+"api/v1/link?s="+s;
try {
byte[] html = yunJiService.createHtml(path);
response.setContentType("application/pdf;charset=UTF-8");
response.setCharacterEncoding("utf-8");
response.getOutputStream().write(html);
} catch (IOException e) {
e.printStackTrace();
}
response.setStatus(HttpServletResponse.SC_OK);
}