|
@@ -3,31 +3,28 @@ package cn.cslg.pas.controller;
|
|
|
|
|
|
import cn.cslg.pas.common.core.annotation.Permission;
|
|
|
import cn.cslg.pas.common.core.base.Constants;
|
|
|
+import cn.cslg.pas.common.model.vo.PatentInstructionVO;
|
|
|
+import cn.cslg.pas.common.utils.FileUtils;
|
|
|
+import cn.cslg.pas.common.utils.Response;
|
|
|
import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
|
|
|
import cn.cslg.pas.common.utils.auth.checkAuth;
|
|
|
import cn.cslg.pas.domain.PatentInstruction;
|
|
|
import cn.cslg.pas.service.PatentInstructionService;
|
|
|
-import cn.cslg.pas.service.TaskService;
|
|
|
-import cn.cslg.pas.common.utils.FileUtils;
|
|
|
-import cn.cslg.pas.common.utils.Response;
|
|
|
-import cn.cslg.pas.common.model.vo.PatentInstructionVO;
|
|
|
-import cn.dev33.satoken.stp.StpUtil;
|
|
|
-import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.io.IoUtil;
|
|
|
-import cn.hutool.core.util.IdUtil;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
-import java.util.Date;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -42,9 +39,7 @@ import java.util.Date;
|
|
|
@RequestMapping(Constants.API_VERSION_V2 + "/patent/instruction")
|
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
|
public class PatentInstructionController {
|
|
|
-
|
|
|
private final PatentInstructionService patentInstructionService;
|
|
|
- private final TaskService taskService;
|
|
|
private final FileUtils fileUtils;
|
|
|
private final LoginUtils loginUtils;
|
|
|
|
|
@@ -92,7 +87,7 @@ public class PatentInstructionController {
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + patentInstruction.getFileName());
|
|
|
ServletOutputStream out = response.getOutputStream();
|
|
|
// out.write(FileUtil.readBytes(fileUtils.getSystemPath(patentInstruction.getUrl())));
|
|
|
- String fil =fileUtils.getSystemPath()+patentInstruction.getUrl();
|
|
|
+ String fil = fileUtils.getSystemPath() + patentInstruction.getUrl();
|
|
|
out.write(FileUtil.readBytes(fil));
|
|
|
IoUtil.close(out);
|
|
|
}
|