From c0aea9b5e2491e9b96f339c01b81e79d3ed14d93 Mon Sep 17 00:00:00 2001 From: coco3x Date: Fri, 6 Dec 2024 18:21:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?sytle:=20validator=20=ED=8C=A8=ED=82=A4?= =?UTF-8?q?=EC=A7=80=20=EB=B3=80=EC=88=98=20=EC=88=98=EC=A0=95=20=EB=B0=8F?= =?UTF-8?q?=20=EC=A3=BC=EC=84=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/whoz_in/log_writer/common/validation/BiValidator.java | 2 +- .../log_writer/common/validation/ValidationException.java | 2 -- .../whoz_in/log_writer/common/validation/ValidationResult.java | 3 ++- .../com/whoz_in/log_writer/common/validation/Validator.java | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/BiValidator.java b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/BiValidator.java index a6e859d0..eadec0e1 100644 --- a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/BiValidator.java +++ b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/BiValidator.java @@ -2,7 +2,7 @@ @FunctionalInterface public interface BiValidator{ - ValidationResult getValidationResult(T t, U u); + ValidationResult getValidationResult(T target1, U target2); default void validate(T target1, U target2){ ValidationResult validationResult = getValidationResult(target1, target2); diff --git a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationException.java b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationException.java index 79ce5c7b..8b408f88 100644 --- a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationException.java +++ b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationException.java @@ -1,7 +1,5 @@ package com.whoz_in.log_writer.common.validation; -import java.util.stream.Collectors; - public class ValidationException extends RuntimeException{ public ValidationException(String message) { diff --git a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationResult.java b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationResult.java index 32519a62..9ceeaebf 100644 --- a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationResult.java +++ b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationResult.java @@ -4,7 +4,8 @@ import java.util.Collection; import java.util.List; -public class ValidationResult { +//Validator가 검증 실패한 내용을 담는 객체 +public final class ValidationResult { private final List errors; public ValidationResult() { diff --git a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/Validator.java b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/Validator.java index 5c8f143a..fab758ec 100644 --- a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/Validator.java +++ b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/Validator.java @@ -4,7 +4,7 @@ //검증 원인을 여러 개 담고 싶었는데, Spring Validator는 단일 객체를 대상으로 하는 필드 중심 검증이기 때문에 만듦 @FunctionalInterface public interface Validator { - ValidationResult getValidationResult(T t); + ValidationResult getValidationResult(T target); default void validate(T target){ ValidationResult validationResult = getValidationResult(target); From ae2abe2c2c2fec34658b676ec664f60b47088b5f Mon Sep 17 00:00:00 2001 From: coco3x Date: Fri, 6 Dec 2024 19:42:41 +0900 Subject: [PATCH 2/2] =?UTF-8?q?depend(log-w):=20mariadb=20=EC=9D=98?= =?UTF-8?q?=EC=A1=B4=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/infrastructure/log-writer/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/infrastructure/log-writer/build.gradle b/modules/infrastructure/log-writer/build.gradle index 026945d2..eb83b5b2 100644 --- a/modules/infrastructure/log-writer/build.gradle +++ b/modules/infrastructure/log-writer/build.gradle @@ -14,6 +14,7 @@ dependencies { implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2' runtimeOnly 'com.mysql:mysql-connector-j:8.3.0' + runtimeOnly 'org.mariadb.jdbc:mariadb-java-client:3.1.4' testImplementation platform('org.junit:junit-bom:5.10.0') testImplementation 'org.junit.jupiter:junit-jupiter'