Добавлены DTO для всех entity
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package ru.serega6531.packmate.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
@@ -28,10 +27,12 @@ public class FoundPattern {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "found_pattern_generator")
|
||||
@JsonIgnore
|
||||
private int id;
|
||||
|
||||
private int patternId;
|
||||
|
||||
private int startPosition;
|
||||
|
||||
private int endPosition;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package ru.serega6531.packmate.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -32,16 +31,13 @@ public class Packet {
|
||||
private Long id;
|
||||
|
||||
@Transient
|
||||
@JsonIgnore
|
||||
private Long tempId;
|
||||
|
||||
@Transient
|
||||
@JsonIgnore
|
||||
private byte ttl;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "stream_id", nullable = false)
|
||||
@JsonIgnore
|
||||
private Stream stream;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
@@ -60,7 +56,6 @@ public class Packet {
|
||||
private byte[] content;
|
||||
|
||||
@Transient
|
||||
@JsonIgnore
|
||||
public String getContentString() {
|
||||
return new String(content);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package ru.serega6531.packmate.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
@@ -41,7 +40,6 @@ public class Pattern {
|
||||
private PatternDirectionType directionType;
|
||||
|
||||
@ManyToMany(mappedBy = "foundPatterns", fetch = FetchType.LAZY)
|
||||
@JsonIgnore
|
||||
private List<Stream> matchedStreams;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package ru.serega6531.packmate.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
@@ -34,7 +33,6 @@ public class Stream {
|
||||
private Protocol protocol;
|
||||
|
||||
@OneToMany(mappedBy = "stream", cascade = CascadeType.ALL)
|
||||
@JsonIgnore
|
||||
@OrderBy("id")
|
||||
private List<Packet> packets;
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package ru.serega6531.packmate.model.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FoundPatternDto {
|
||||
|
||||
private int patternId;
|
||||
private int startPosition;
|
||||
private int endPosition;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package ru.serega6531.packmate.model.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Data
|
||||
public class PacketDto {
|
||||
|
||||
private Long id;
|
||||
private Set<FoundPatternDto> matches;
|
||||
private long timestamp;
|
||||
private boolean incoming;
|
||||
private boolean ungzipped;
|
||||
private boolean webSocketParsed;
|
||||
private boolean tlsDecrypted;
|
||||
private byte[] content;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package ru.serega6531.packmate.model.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import ru.serega6531.packmate.model.enums.PatternDirectionType;
|
||||
import ru.serega6531.packmate.model.enums.PatternSearchType;
|
||||
|
||||
@Data
|
||||
public class PatternDto {
|
||||
|
||||
private int id;
|
||||
private boolean enabled;
|
||||
private String name;
|
||||
private String value;
|
||||
private String color; // для вставки в css
|
||||
private PatternSearchType searchType;
|
||||
private PatternDirectionType directionType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package ru.serega6531.packmate.model.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ServiceDto {
|
||||
|
||||
private int port;
|
||||
private String name;
|
||||
private boolean decryptTls;
|
||||
private boolean processChunkedEncoding;
|
||||
private boolean ungzipHttp;
|
||||
private boolean urldecodeHttpRequests;
|
||||
private boolean mergeAdjacentPackets;
|
||||
private boolean parseWebSockets;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package ru.serega6531.packmate.model.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import ru.serega6531.packmate.model.enums.Protocol;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Data
|
||||
public class StreamDto {
|
||||
|
||||
private Long id;
|
||||
private int service;
|
||||
private Protocol protocol;
|
||||
private long startTimestamp;
|
||||
private long endTimestamp;
|
||||
private Set<PatternDto> foundPatterns;
|
||||
private boolean favorite;
|
||||
private byte ttl;
|
||||
private String userAgentHash;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user