영상관리 -> 폴더조회, 파일리스트 조회 POST로 변경
This commit is contained in:
@@ -5,7 +5,8 @@ import com.kamco.cd.kamcoback.code.service.CommonCodeService;
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFoldersDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.service.MapSheetMngService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -57,10 +58,9 @@ public class MapSheetMngApiController {
|
||||
})
|
||||
@PostMapping("/getFolders")
|
||||
public ApiResponseDto<List<FileDto.FolderDto>> getDir(
|
||||
@RequestParam String dirPath
|
||||
@RequestBody SrchFoldersDto srchDto
|
||||
) {
|
||||
|
||||
return ApiResponseDto.createOK(mapSheetMngService.getFolderAll(dirPath));
|
||||
return ApiResponseDto.createOK(mapSheetMngService.getFolderAll(srchDto));
|
||||
}
|
||||
|
||||
@Operation(summary = "파일목록 조회", description = "파일목록 조회")
|
||||
@@ -78,7 +78,7 @@ public class MapSheetMngApiController {
|
||||
})
|
||||
@PostMapping("/getFiles")
|
||||
public ApiResponseDto<FilesDto> getFiles(
|
||||
@RequestBody SrchDto srchDto
|
||||
@RequestBody SrchFilesDto srchDto
|
||||
) {
|
||||
|
||||
return ApiResponseDto.createOK(mapSheetMngService.getFilesAll(srchDto));
|
||||
|
||||
@@ -17,16 +17,20 @@ public class FileDto {
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class SrchDto {
|
||||
public static class SrchFoldersDto {
|
||||
@NotNull private String dirPath;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class SrchFilesDto {
|
||||
@NotNull private String dirPath;
|
||||
@NotNull private String extension;
|
||||
@NotNull private String sortType;
|
||||
@NotNull private Integer startPos;
|
||||
@NotNull private Integer endPos;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Schema(name = "FolderDto", description = "폴더 정보")
|
||||
|
||||
@@ -3,7 +3,8 @@ package com.kamco.cd.kamcoback.mapsheet.service;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FolderDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFoldersDto;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
@@ -30,9 +31,11 @@ public class MapSheetMngService {
|
||||
|
||||
//private final MapSheetAnalDataCoreService mapSheetAnalDataCoreService;
|
||||
|
||||
public List<FolderDto> getFolderAll(String dirPath) {
|
||||
public List<FolderDto> getFolderAll(SrchFoldersDto srchDto) {
|
||||
|
||||
Path startPath = Paths.get(srchDto.getDirPath());
|
||||
String dirPath = srchDto.getDirPath();
|
||||
|
||||
Path startPath = Paths.get(dirPath);
|
||||
int maxDepth = 1;
|
||||
|
||||
List<FolderDto> folderDtoList = List.of();
|
||||
@@ -48,6 +51,7 @@ public class MapSheetMngService {
|
||||
.map(path -> {
|
||||
|
||||
int depth = path.getNameCount();
|
||||
|
||||
String folderNm = path.getFileName().toString();
|
||||
String parentFolderNm = path.getParent().getFileName().toString();
|
||||
String parentPath = path.getParent().toString();
|
||||
@@ -70,6 +74,7 @@ public class MapSheetMngService {
|
||||
|
||||
String lastModified = dttmFormat.format(new Date(time.toMillis()));
|
||||
|
||||
|
||||
FolderDto folderDto = new FolderDto(
|
||||
folderNm,
|
||||
parentFolderNm,
|
||||
@@ -98,7 +103,7 @@ public class MapSheetMngService {
|
||||
}
|
||||
|
||||
|
||||
public FilesDto getFilesAll(SrchDto srchDto) {
|
||||
public FilesDto getFilesAll(SrchFilesDto srchDto) {
|
||||
|
||||
String dirPath = srchDto.getDirPath();
|
||||
String extension = srchDto.getExtension();
|
||||
|
||||
Reference in New Issue
Block a user