|
|
|
@ -8,11 +8,9 @@ import com.ruoyi.gysl.entity.Dpclgl;
|
|
|
|
|
import com.ruoyi.gysl.entity.request.DpclglPageReq;
|
|
|
|
|
import com.ruoyi.gysl.service.DpclglService;
|
|
|
|
|
import com.ruoyi.gysl.utils.HtmlToPdfConverter;
|
|
|
|
|
import com.ruoyi.gysl.utils.PdfUtils;
|
|
|
|
|
import com.ruoyi.web.controller.common.CommonController;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
@ -110,15 +108,12 @@ public class DpclglController extends BaseController {
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "副编辑器内容生成pdf文件url")
|
|
|
|
|
@GetMapping("/unloadPdf")
|
|
|
|
|
public AjaxResult unloadPdf(@RequestParam(defaultValue = "文章标题") String htmlArticleTitle, @RequestParam(defaultValue = "文章内容") String htmlContent) {
|
|
|
|
|
try {
|
|
|
|
|
public AjaxResult unloadPdf(@RequestParam(defaultValue = "文章标题") String htmlArticleTitle, @RequestParam(defaultValue = "文章内容") String htmlContent) throws Exception {
|
|
|
|
|
|
|
|
|
|
MultipartFile multipartFile = HtmlToPdfConverter.convertHtmlToPdf(htmlArticleTitle, htmlContent);
|
|
|
|
|
commonController.uploadFile(multipartFile);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success();
|
|
|
|
|
|
|
|
|
|
return AjaxResult.success(commonController.uploadFile(multipartFile));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|