12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package com.rongwei.controller;
- import com.rongwei.bscommon.sys.service.impl.FileFormatConversionServiceImpl;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import javax.servlet.http.HttpServletResponse;
- /**
- * FileFormatConversionController class
- *
- * @author XH
- * @date 2025/08/01
- */
- @RestController
- @RequestMapping("/file")
- public class FileFormatConversionController {
- private static final Logger log = LoggerFactory.getLogger(FileFormatConversionController.class);
- @Autowired
- private FileFormatConversionServiceImpl fileFormatConversionService;
- /**
- * 文件转为pdf 预览
- *
- * @param id
- * @param response
- */
- @GetMapping("/format/conversion/{id}")
- public void fileFormatConversion(@PathVariable String id, HttpServletResponse response) {
- log.info("文件预览接口入参为:{}", id);
- fileFormatConversionService.fileFormatConversion(id, response,false);
- }
- /**
- * 文件转为pdf 预览带水印
- *
- * @param id
- * @param response
- */
- @GetMapping("/preview/waterMark/{id}")
- public void fileFormatConversionAndWaterMark(@PathVariable String id, HttpServletResponse response) {
- log.info("文件预览接口入参为:{}", id);
- fileFormatConversionService.fileFormatConversion(id, response,true);
- }
- }
|