|
@@ -1,6 +1,6 @@
|
|
|
package com.dayou.controller;
|
|
|
|
|
|
-import cn.hutool.core.lang.UUID;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckLogin;
|
|
|
import com.dayou.config.FileNetConfig;
|
|
|
import com.dayou.entity.TmplAssetCalculate;
|
|
|
import com.dayou.entity.TmplAssetCalculateSection;
|
|
@@ -45,6 +45,7 @@ public class FileController {
|
|
|
* @param multipartFile 文件
|
|
|
* @return Result<Map<String, String>> 文件信息
|
|
|
*/
|
|
|
+ @SaCheckLogin
|
|
|
@PostMapping("/assets/uploadCalculateTmpl")
|
|
|
public Result<Map<String, String>> uploadAssetsCalculateTmpl(MultipartFile multipartFile){
|
|
|
// 判断文件类型
|
|
@@ -60,6 +61,7 @@ public class FileController {
|
|
|
* @param multipartFile 文件
|
|
|
* @return Result<Map<String, String>> 文件信息
|
|
|
*/
|
|
|
+ @SaCheckLogin
|
|
|
@PostMapping("/assets/uploadReportTmpl")
|
|
|
public Result<Map<String, String>> uploadAssetsReportTmpl(MultipartFile multipartFile){
|
|
|
// 判断文件类型
|
|
@@ -101,6 +103,7 @@ public class FileController {
|
|
|
* 上传图片
|
|
|
* @param file 文件
|
|
|
*/
|
|
|
+ @SaCheckLogin
|
|
|
@PostMapping("/upload/image")
|
|
|
public Result<String> uploadImage(MultipartFile file) {
|
|
|
String contentType = file.getContentType();
|
|
@@ -122,6 +125,7 @@ public class FileController {
|
|
|
* @param fileDiskPath 文件在磁盘的路径
|
|
|
* @param fileName 文件名
|
|
|
*/
|
|
|
+ @SaCheckLogin
|
|
|
@GetMapping("/download")
|
|
|
public void downloadFile(HttpServletRequest request, HttpServletResponse response, String fileDiskPath, String fileName){
|
|
|
File file = new File(fileNetConfig.getBaseDir() + fileDiskPath);
|
|
@@ -135,6 +139,7 @@ public class FileController {
|
|
|
* @param tmplCode 模板code
|
|
|
* @param tmplType 模板类型(MAIN:主模板,SECTION:段落模板)
|
|
|
*/
|
|
|
+ @SaCheckLogin
|
|
|
@GetMapping("/download/assets/tmpl")
|
|
|
public void downloadAnalysisMain(HttpServletRequest request, HttpServletResponse response, String tmplCode, String tmplType){
|
|
|
// 获取模板
|