Эх сурвалжийг харах

增加业务异常和系统日志

git-svn-id: https://192.168.57.71/svn/jsgkj@1080 931142cf-59ea-a443-aa0e-51397b428577
ld_zhouk 8 жил өмнө
parent
commit
02f0115027

+ 13 - 0
gkaqv2/trunk/modules/common/src/main/java/com/xt/js/gkaq/common/Constants.java

@@ -850,4 +850,17 @@ public class Constants {
      */
     public final static String GNMK_JYRJCXX = "1";
     public final static String GNMK_JYRJCXX_BW = "2";
+
+    /**
+     * 日志类型:普通
+     */
+    public static final String LOG_TYPE_0 = "0";
+    /**
+     * 日志类型:异常
+     */
+    public static final String LOG_TYPE_1 = "1";
+    /**
+     * 日志类型:业务
+     */
+    public static final String LOG_TYPE_2 = "2";
 }

+ 27 - 0
gkaqv2/trunk/modules/common/src/main/java/com/xt/js/gkaq/common/ex/BusinessException.java

@@ -0,0 +1,27 @@
+package com.xt.js.gkaq.common.ex;
+
+public class BusinessException extends RuntimeException {
+
+    private static final long serialVersionUID = -8018950052105842676L;
+    private String errorCode;
+    private String errorMsg;
+    
+    public BusinessException() {
+        super();
+    }
+
+    public BusinessException(String errorCode, String errorMsg) {
+        super();
+        this.errorCode = errorCode;
+        this.errorMsg = errorMsg;
+    }
+
+    public String getErrorCode() {
+        return errorCode;
+    }
+
+    public String getErrorMsg() {
+        return errorMsg;
+    }
+
+}

+ 22 - 0
gkaqv2/trunk/modules/common/src/main/java/com/xt/js/gkaq/common/log/annotation/SysLog.java

@@ -0,0 +1,22 @@
+package com.xt.js.gkaq.common.log.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import com.xt.js.gkaq.common.Constants;
+
+/**
+ * 系统日志自定义注解<br>
+ * 作用于方法上
+ */
+@Target({ ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface SysLog {
+
+    String type() default Constants.LOG_TYPE_0;
+    String description() default "";
+}