feat(我的绩效): 开发我的绩效功能。
This commit is contained in:
@@ -6,7 +6,6 @@ import com.njcn.rdms.module.system.api.dept.dto.DeptRespDTO;
|
||||
import com.njcn.rdms.module.system.dal.dataobject.dept.DeptDO;
|
||||
import com.njcn.rdms.module.system.service.dept.DeptService;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@@ -26,4 +26,23 @@ public class FileApiImpl implements FileApi {
|
||||
return success(BeanUtils.toBean(file, FileRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<FileRespDTO> getFile(Long id) {
|
||||
FileDO file = fileService.getFile(id);
|
||||
return success(BeanUtils.toBean(file, FileRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<byte[]> getFileContent(Long id) {
|
||||
try {
|
||||
FileDO file = fileService.getFile(id);
|
||||
if (file == null) {
|
||||
return success(null);
|
||||
}
|
||||
return success(fileService.getFileContent(file.getConfigId(), file.getPath()));
|
||||
} catch (Exception ex) {
|
||||
throw new IllegalStateException("读取文件内容失败", ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class FileController {
|
||||
@GetMapping("/download")
|
||||
@Operation(summary = "下载文件")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:file:query')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:file:query')")
|
||||
public void downloadFile(@RequestParam("id") Long id, HttpServletResponse response) throws Exception {
|
||||
FileDO file = fileService.getFile(id);
|
||||
byte[] content = fileService.getFileContent(file.getConfigId(), file.getPath());
|
||||
|
||||
Reference in New Issue
Block a user