스타일 적용

This commit is contained in:
2025-12-26 16:42:53 +09:00
parent aee4735717
commit 9bcbc7c5e5
5 changed files with 46 additions and 47 deletions

View File

@@ -20,14 +20,14 @@ public class CsvFileProcessor implements ZipEntryProcessor {
public void process(String fileName, InputStream is) throws IOException { public void process(String fileName, InputStream is) throws IOException {
try (BufferedReader br = new BufferedReader(new InputStreamReader(is))) { try (BufferedReader br = new BufferedReader(new InputStreamReader(is))) {
br.lines() br.lines()
.forEach( .forEach(
line -> { line -> {
String[] cols = line.split(","); String[] cols = line.split(",");
// CSV 처리 // CSV 처리
for (String col : cols) { for (String col : cols) {
log.info(col); //TODO : 추후에 csv 파일 읽어서 작업 필요할 때 정의하기 log.info(col); // TODO : 추후에 csv 파일 읽어서 작업 필요할 때 정의하기
} }
}); });
} }
} }
} }

View File

@@ -46,7 +46,7 @@ public class JsonStreamingFileProcessor implements ZipEntryProcessor {
if (token == JsonToken.FIELD_NAME) { if (token == JsonToken.FIELD_NAME) {
String fieldName = parser.getCurrentName(); String fieldName = parser.getCurrentName();
//TODO: json 파일 읽어야 할 내용 정의되면 항목 확정하기 // TODO: json 파일 읽어야 할 내용 정의되면 항목 확정하기
switch (fieldName) { switch (fieldName) {
case "type" -> { case "type" -> {
parser.nextToken(); parser.nextToken();

View File

@@ -21,7 +21,7 @@ public class TextFileProcessor implements ZipEntryProcessor {
BufferedReader br = new BufferedReader(new InputStreamReader(is)); BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line; String line;
while ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) {
log.info(line); //TODO : 추후 txt 파일 읽어서 작업할 때 정의하기 log.info(line); // TODO : 추후 txt 파일 읽어서 작업할 때 정의하기
} }
} }
} }

View File

@@ -31,16 +31,16 @@ public class ZipUtils {
String fileName = entry.getName(); String fileName = entry.getName();
processors.stream() processors.stream()
.filter(p -> p.supports(fileName)) .filter(p -> p.supports(fileName))
.findFirst() .findFirst()
.ifPresent( .ifPresent(
processor -> { processor -> {
try { try {
processor.process(fileName, zis); processor.process(fileName, zis);
} catch (IOException ioe) { } catch (IOException ioe) {
throw new UncheckedIOException(ioe); throw new UncheckedIOException(ioe);
} }
}); });
zis.closeEntry(); zis.closeEntry();
} }

View File

@@ -36,48 +36,47 @@ public class ModelMngApiController {
private final ModelMngService modelMngService; private final ModelMngService modelMngService;
@Autowired @Autowired private ZipUtils zipUtils;
private ZipUtils zipUtils;
@Operation(summary = "모델관리 목록") @Operation(summary = "모델관리 목록")
@GetMapping @GetMapping
public ApiResponseDto<Page<ModelMngDto.ModelList>> findModelMgmtList( public ApiResponseDto<Page<ModelMngDto.ModelList>> findModelMgmtList(
@RequestParam(required = false) LocalDate startDate, @RequestParam(required = false) LocalDate startDate,
@RequestParam(required = false) LocalDate endDate, @RequestParam(required = false) LocalDate endDate,
@RequestParam(required = false, defaultValue = "createCompleteDttm") String sortColumn, @RequestParam(required = false, defaultValue = "createCompleteDttm") String sortColumn,
@RequestParam(required = false) String modelType, @RequestParam(required = false) String modelType,
@RequestParam(required = false) String searchVal, @RequestParam(required = false) String searchVal,
@RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "20") int size) { @RequestParam(defaultValue = "20") int size) {
ModelMngDto.searchReq searchReq = new ModelMngDto.searchReq(page, size, sortColumn + ",desc"); ModelMngDto.searchReq searchReq = new ModelMngDto.searchReq(page, size, sortColumn + ",desc");
Page<ModelMngDto.ModelList> result = Page<ModelMngDto.ModelList> result =
modelMngService.findModelMgmtList(searchReq, startDate, endDate, modelType, searchVal); modelMngService.findModelMgmtList(searchReq, startDate, endDate, modelType, searchVal);
return ApiResponseDto.ok(result); return ApiResponseDto.ok(result);
} }
@Operation(summary = "삭제", description = "모델을 삭제 합니다.") @Operation(summary = "삭제", description = "모델을 삭제 합니다.")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
responseCode = "204", responseCode = "204",
description = "모델 삭제 성공", description = "모델 삭제 성공",
content = content =
@Content( @Content(
mediaType = "application/json", mediaType = "application/json",
schema = @Schema(implementation = Long.class))), schema = @Schema(implementation = Long.class))),
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
}) })
@DeleteMapping("/{modelVer}") @DeleteMapping("/{modelVer}")
public ApiResponseDto<ApiResponseDto.ResponseObj> removeModel( public ApiResponseDto<ApiResponseDto.ResponseObj> removeModel(
@io.swagger.v3.oas.annotations.parameters.RequestBody( @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "모델 삭제 요청 정보", description = "모델 삭제 요청 정보",
required = true) required = true)
@PathVariable @PathVariable
String modelVer) { String modelVer) {
return ApiResponseDto.okObject(modelMngService.removeModel(modelVer)); return ApiResponseDto.okObject(modelMngService.removeModel(modelVer));
} }