mirror of
https://github.com/dataease/dataease.git
synced 2026-05-21 04:00:55 +08:00
feat: 日志模块
This commit is contained in:
33
sdk/common/src/main/java/io/dataease/constant/LogOT.java
Normal file
33
sdk/common/src/main/java/io/dataease/constant/LogOT.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package io.dataease.constant;
|
||||
|
||||
public enum LogOT {
|
||||
CREATE(1, "OPERATE_TYPE_CREATE"),
|
||||
MODIFY(2, "OPERATE_TYPE_MODIFY"),
|
||||
DELETE(3, "OPERATE_TYPE_DELETE"),
|
||||
READ(4, "OPERATE_TYPE_READ"),
|
||||
EXPORT(5, "OPERATE_TYPE_EXPORT"),
|
||||
AUTHORIZE(6, "OPERATE_TYPE_AUTHORIZE"),
|
||||
UNAUTHORIZE(7, "OPERATE_TYPE_UNAUTHORIZE"),
|
||||
CREATELINK(8, "OPERATE_TYPE_CREATELINK"),
|
||||
DELETELINK(9, "OPERATE_TYPE_DELETELINK"),
|
||||
MODIFYLINK(10, "OPERATE_TYPE_MODIFYLINK"),
|
||||
UPLOADFILE(11, "OPERATE_TYPE_UPLOADFILE"),
|
||||
BIND(12, "OPERATE_TYPE_BIND"),
|
||||
UNBIND(13, "OPERATE_TYPE_UNBIND"),
|
||||
LOGIN(14, "OPERATE_TYPE_LOGIN");
|
||||
private Integer value;
|
||||
private String name;
|
||||
|
||||
LogOT(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
36
sdk/common/src/main/java/io/dataease/constant/LogST.java
Normal file
36
sdk/common/src/main/java/io/dataease/constant/LogST.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package io.dataease.constant;
|
||||
|
||||
public enum LogST {
|
||||
PANEL(1, "SOURCE_TYPE_PANEL"),
|
||||
SCREEN(2, "SOURCE_TYPE_SCREEN"),
|
||||
DATASET(3, "SOURCE_TYPE_DATASET"),
|
||||
DATASOURCE(4, "SOURCE_TYPE_DATASOURCE"),
|
||||
USER(5, "SOURCE_TYPE_USER"),
|
||||
ROLE(6, "SOURCE_TYPE_ROLE"),
|
||||
ORG(7, "SOURCE_TYPE_DEPT"),
|
||||
VIEW(8, "SOURCE_TYPE_VIEW"),
|
||||
LINK(9, "SOURCE_TYPE_LINK"),
|
||||
DRIVER(10, "SOURCE_TYPE_DRIVER"),
|
||||
DRIVER_FILE(11, "SOURCE_TYPE_DRIVER_FILE"),
|
||||
MENU(12, "SOURCE_TYPE_MENU"),
|
||||
APIKEY(13, "SOURCE_TYPE_APIKEY");
|
||||
private Integer value;
|
||||
|
||||
private String name;
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
LogST(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
LogST() {
|
||||
}
|
||||
}
|
||||
19
sdk/common/src/main/java/io/dataease/log/DeLog.java
Normal file
19
sdk/common/src/main/java/io/dataease/log/DeLog.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package io.dataease.log;
|
||||
|
||||
import io.dataease.constant.LogOT;
|
||||
import io.dataease.constant.LogST;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface DeLog {
|
||||
String id() default "";
|
||||
|
||||
String pid() default "";
|
||||
|
||||
LogST st();
|
||||
|
||||
LogOT ot();
|
||||
}
|
||||
16
sdk/common/src/main/java/io/dataease/model/LogItemModel.java
Normal file
16
sdk/common/src/main/java/io/dataease/model/LogItemModel.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package io.dataease.model;
|
||||
|
||||
import io.dataease.constant.LogST;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class LogItemModel implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private LogST st;
|
||||
}
|
||||
@@ -35,4 +35,12 @@ public class CommonBeanFactory implements ApplicationContextAware {
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public static <T> T proxy(Class<T> className) {
|
||||
try {
|
||||
return context != null && className != null ? context.getBean(className) : null;
|
||||
} catch (BeansException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user