mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-12-16 13:21:58 +09:00
0.1.0
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package tech.ailef.dbadmin.internal.model;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import org.springframework.format.datetime.standard.DateTimeFormatterFactory;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Lob;
|
||||
|
||||
@Entity
|
||||
public class UserAction {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Lob
|
||||
@Column(nullable = false)
|
||||
private String sql;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String onTable;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String primaryKey;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String actionType;
|
||||
|
||||
public UserAction() {
|
||||
}
|
||||
|
||||
public UserAction(String onTable, String primaryKey, String actionType) {
|
||||
this.createdAt = LocalDateTime.now();
|
||||
this.sql = "SQL TODO";
|
||||
this.onTable = onTable;
|
||||
this.actionType = actionType;
|
||||
this.primaryKey = primaryKey;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public String getOnTable() {
|
||||
return onTable;
|
||||
}
|
||||
|
||||
public void setOnTable(String onTable) {
|
||||
this.onTable = onTable;
|
||||
}
|
||||
|
||||
public String getPrimaryKey() {
|
||||
return primaryKey;
|
||||
}
|
||||
|
||||
public void setPrimaryKey(String primaryKey) {
|
||||
this.primaryKey = primaryKey;
|
||||
}
|
||||
|
||||
public String getActionType() {
|
||||
return actionType;
|
||||
}
|
||||
|
||||
public void setActionType(String actionType) {
|
||||
this.actionType = actionType;
|
||||
}
|
||||
|
||||
public String getFormattedDate() {
|
||||
return new DateTimeFormatterFactory("YYYY-MM-dd HH:mm:ss").createDateTimeFormatter().format(createdAt);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package tech.ailef.dbadmin.internal.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class UserSetting {
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
private String settingValue;
|
||||
|
||||
public UserSetting() {
|
||||
}
|
||||
|
||||
public UserSetting(String id, String settingValue) {
|
||||
this.id = id;
|
||||
this.settingValue = settingValue;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSettingValue() {
|
||||
return settingValue;
|
||||
}
|
||||
|
||||
public void setSettingValue(String settingValue) {
|
||||
this.settingValue = settingValue;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user