스타일 적용
This commit is contained in:
@@ -20,14 +20,14 @@ public class CsvFileProcessor implements ZipEntryProcessor {
|
||||
public void process(String fileName, InputStream is) throws IOException {
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(is))) {
|
||||
br.lines()
|
||||
.forEach(
|
||||
line -> {
|
||||
String[] cols = line.split(",");
|
||||
// CSV 처리
|
||||
for (String col : cols) {
|
||||
log.info(col); //TODO : 추후에 csv 파일 읽어서 작업 필요할 때 정의하기
|
||||
}
|
||||
});
|
||||
.forEach(
|
||||
line -> {
|
||||
String[] cols = line.split(",");
|
||||
// CSV 처리
|
||||
for (String col : cols) {
|
||||
log.info(col); // TODO : 추후에 csv 파일 읽어서 작업 필요할 때 정의하기
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class JsonStreamingFileProcessor implements ZipEntryProcessor {
|
||||
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
String fieldName = parser.getCurrentName();
|
||||
//TODO: json 파일 읽어야 할 내용 정의되면 항목 확정하기
|
||||
// TODO: json 파일 읽어야 할 내용 정의되면 항목 확정하기
|
||||
switch (fieldName) {
|
||||
case "type" -> {
|
||||
parser.nextToken();
|
||||
|
||||
@@ -21,7 +21,7 @@ public class TextFileProcessor implements ZipEntryProcessor {
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
log.info(line); //TODO : 추후 txt 파일 읽어서 작업할 때 정의하기
|
||||
log.info(line); // TODO : 추후 txt 파일 읽어서 작업할 때 정의하기
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,16 +31,16 @@ public class ZipUtils {
|
||||
|
||||
String fileName = entry.getName();
|
||||
processors.stream()
|
||||
.filter(p -> p.supports(fileName))
|
||||
.findFirst()
|
||||
.ifPresent(
|
||||
processor -> {
|
||||
try {
|
||||
processor.process(fileName, zis);
|
||||
} catch (IOException ioe) {
|
||||
throw new UncheckedIOException(ioe);
|
||||
}
|
||||
});
|
||||
.filter(p -> p.supports(fileName))
|
||||
.findFirst()
|
||||
.ifPresent(
|
||||
processor -> {
|
||||
try {
|
||||
processor.process(fileName, zis);
|
||||
} catch (IOException ioe) {
|
||||
throw new UncheckedIOException(ioe);
|
||||
}
|
||||
});
|
||||
|
||||
zis.closeEntry();
|
||||
}
|
||||
|
||||
@@ -36,48 +36,47 @@ public class ModelMngApiController {
|
||||
|
||||
private final ModelMngService modelMngService;
|
||||
|
||||
@Autowired
|
||||
private ZipUtils zipUtils;
|
||||
@Autowired private ZipUtils zipUtils;
|
||||
|
||||
@Operation(summary = "모델관리 목록")
|
||||
@GetMapping
|
||||
public ApiResponseDto<Page<ModelMngDto.ModelList>> findModelMgmtList(
|
||||
@RequestParam(required = false) LocalDate startDate,
|
||||
@RequestParam(required = false) LocalDate endDate,
|
||||
@RequestParam(required = false, defaultValue = "createCompleteDttm") String sortColumn,
|
||||
@RequestParam(required = false) String modelType,
|
||||
@RequestParam(required = false) String searchVal,
|
||||
@RequestParam(defaultValue = "0") int page,
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
@RequestParam(required = false) LocalDate startDate,
|
||||
@RequestParam(required = false) LocalDate endDate,
|
||||
@RequestParam(required = false, defaultValue = "createCompleteDttm") String sortColumn,
|
||||
@RequestParam(required = false) String modelType,
|
||||
@RequestParam(required = false) String searchVal,
|
||||
@RequestParam(defaultValue = "0") int page,
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
ModelMngDto.searchReq searchReq = new ModelMngDto.searchReq(page, size, sortColumn + ",desc");
|
||||
|
||||
Page<ModelMngDto.ModelList> result =
|
||||
modelMngService.findModelMgmtList(searchReq, startDate, endDate, modelType, searchVal);
|
||||
modelMngService.findModelMgmtList(searchReq, startDate, endDate, modelType, searchVal);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "삭제", description = "모델을 삭제 합니다.")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "204",
|
||||
description = "모델 삭제 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Long.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "204",
|
||||
description = "모델 삭제 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Long.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@DeleteMapping("/{modelVer}")
|
||||
public ApiResponseDto<ApiResponseDto.ResponseObj> removeModel(
|
||||
@io.swagger.v3.oas.annotations.parameters.RequestBody(
|
||||
description = "모델 삭제 요청 정보",
|
||||
required = true)
|
||||
@PathVariable
|
||||
String modelVer) {
|
||||
@io.swagger.v3.oas.annotations.parameters.RequestBody(
|
||||
description = "모델 삭제 요청 정보",
|
||||
required = true)
|
||||
@PathVariable
|
||||
String modelVer) {
|
||||
return ApiResponseDto.okObject(modelMngService.removeModel(modelVer));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user