This commit is contained in:
2026-01-06 21:44:36 +09:00
parent ceec1ad7a9
commit 716cf63f73
98 changed files with 6997 additions and 538 deletions

View File

@@ -0,0 +1,55 @@
package research.loghunter.entity;
import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;
@Entity
@Table(name = "patterns")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Pattern {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String name; // 패턴명 (예: NullPointer, DB Connection)
@Column(nullable = false, length = 1000)
private String regex; // 정규식
@Column(nullable = false)
private String severity; // CRITICAL, ERROR, WARN
@Column(nullable = false)
private Integer contextLines; // 에러 전후 캡처할 라인 수
private String description; // 설명
@Column(nullable = false)
private Boolean active;
@Column(nullable = false, updatable = false)
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
@PrePersist
protected void onCreate() {
createdAt = LocalDateTime.now();
updatedAt = LocalDateTime.now();
if (active == null) active = true;
if (contextLines == null) contextLines = 5;
if (severity == null) severity = "ERROR";
}
@PreUpdate
protected void onUpdate() {
updatedAt = LocalDateTime.now();
}
}