diff --git a/backend/src/main/java/io/dataease/controller/handler/annotation/I18n.java b/backend/src/main/java/io/dataease/controller/handler/annotation/I18n.java new file mode 100644 index 0000000000..f22d6c4b98 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/handler/annotation/I18n.java @@ -0,0 +1,14 @@ +package io.dataease.controller.handler.annotation; + + +import io.dataease.commons.constants.I18nConstants; + +import java.lang.annotation.*; + +@Documented +@Inherited +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface I18n { + String value() default I18nConstants.LANG_COOKIE_NAME; +} diff --git a/backend/src/main/java/io/dataease/exception/DataEaseException.java b/backend/src/main/java/io/dataease/exception/DataEaseException.java new file mode 100644 index 0000000000..882ac0f3c7 --- /dev/null +++ b/backend/src/main/java/io/dataease/exception/DataEaseException.java @@ -0,0 +1,24 @@ +package io.dataease.exception; + +public class DataEaseException extends RuntimeException { + + private DataEaseException(String message) { + super(message); + } + + private DataEaseException(Throwable t) { + super(t); + } + + public static void throwException(String message) { + throw new DataEaseException(message); + } + + public static DataEaseException getException(String message) { + throw new DataEaseException(message); + } + + public static void throwException(Throwable t) { + throw new DataEaseException(t); + } +}