| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | import com.smartor.domain.Question; |
| | | import com.smartor.domain.SvyLibTemplate; |
| | | import freemarker.template.Configuration; |
| | | import com.ruoyi.template.domain.SvyLibTemplate;import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | | import freemarker.template.TemplateException; |
| | | import io.swagger.annotations.Api; |
| | |
| | | public String generateStaticHtml(@PathVariable("reqid") String reqid, @PathVariable("userid") String userid) throws IOException, TemplateException { |
| | | // 创建Freemarker配置 |
| | | Configuration configuration = new Configuration(Configuration.VERSION_2_3_31); |
| | | configuration.setClassForTemplateLoading(SvyLibTemplateController.class, "/template"); |
| | | // ⚠️ 原写法是 `setClassForTemplateLoading(SvyLibTemplateController.class, "/template")`, |
| | | // 那是拿它当**类路径锚点**(模板在 ruoyi-template 的 resources/template 下)。 |
| | | // 该 Controller 已随模板模块化搬进 ruoyi-template,类路径根**没变** |
| | | // (同一个 jar),所以等价地改用同为 ruoyi-template 里的 SvyLibTemplate 作锚点 |
| | | // —— 避免 smartor 侧去引用模块的 controller 包。 |
| | | configuration.setClassForTemplateLoading(SvyLibTemplate.class, "/template"); |
| | | configuration.setDefaultEncoding("UTF-8"); |
| | | |
| | | try { |