...
Code Block | ||||
---|---|---|---|---|
| ||||
load("nashorn:mozilla_compat.js"); importPackage(java.lang); importPackage(org.apache.commons.lang3.time); importPackage(org.apache.commons.lang3); importPackage(com.alibaba.fastjson); var reportService = beanService.getBean("reportServiceImpl"); var reportDao = beanService.getBean("reportDaoImpl"); var userDao = beanService.getBean("userDaoImpl"); var userService = beanService.getBean("userServiceImpl"); try{ var reportId = request.getParameter("reportId"); try var report = reportDao.findById(reportId); if(report == null) { throw new Exception("没有找到报表"); } var reportOwner = userDao.findById(report.getAppId()); userService.userLoginWithUser(reportOwner); reportService.refreshMetadata(reportId); result.setSuccess(true); }catch(e){ result.setSuccess(false); result.setMessage(e.getMessage()message); } finally { var securityService = beanService.getBean("amsSecurityService"); securityService.logout(); } |
Info | ||
---|---|---|
| ||
http://x.x.x.x:端口/plugin/api/report/refresh.do?reportId=xxxxxx |
Warning | ||
---|---|---|
| ||
注意: /plugin/** 路径是公开访问路径,因此需要配合token来验证接口调用的合法性 |