From 58a0beab86cbedf62b68c84510dd0275db792557 Mon Sep 17 00:00:00 2001 From: TheWhiteDog9487 Date: Fri, 26 Sep 2025 11:40:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8@JsonProperty=E4=BD=BFJPA?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=87=BA=E7=9A=84=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?Key=E4=BF=9D=E6=8C=81=E5=90=8C=E6=A0=B7=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WebAPI/Data/Entity/AccessLog.java | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/src/main/java/xyz/thewhitedog9487/WebAPI/Data/Entity/AccessLog.java b/src/main/java/xyz/thewhitedog9487/WebAPI/Data/Entity/AccessLog.java index 03f1595..89c3ddb 100644 --- a/src/main/java/xyz/thewhitedog9487/WebAPI/Data/Entity/AccessLog.java +++ b/src/main/java/xyz/thewhitedog9487/WebAPI/Data/Entity/AccessLog.java @@ -1,5 +1,6 @@ package xyz.thewhitedog9487.WebAPI.Data.Entity; +import com.fasterxml.jackson.annotation.JsonProperty; import jakarta.persistence.*; import lombok.AllArgsConstructor; import lombok.Getter; @@ -18,17 +19,44 @@ public class AccessLog{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(nullable = false) + @JsonProperty("ID") Long ID; + @JsonProperty("RequestID") String RequestID; - @Column(name = "\"CF-Connecting-IP\"") String CF_Connecting_IP; - @Column(name = "\"X-Forwarded-For\"") String X_Forwarded_For; + + @JsonProperty("CF_Connecting_IP") + @Column(name = "\"CF-Connecting-IP\"") + String CF_Connecting_IP; + + @JsonProperty("X_Forwarded_For") + @Column(name = "\"X-Forwarded-For\"") + String X_Forwarded_For; + + @JsonProperty("RemoteAddress") String RemoteAddress; - @Column(name = "\"CF-IPCountry\"") String CF_IPCountry; + + @JsonProperty("CF_IPCountry") + @Column(name = "\"CF-IPCountry\"") + String CF_IPCountry; + + @JsonProperty("ISO3166") String ISO3166; + + @JsonProperty("UserAgent") String UserAgent; + + @JsonProperty("HttpMethod") String HttpMethod; + @JsonProperty("URL") String URL; + + @JsonProperty("QueryString") String QueryString; - @Column(columnDefinition = "text") String Header; - Instant Timestamp; } \ No newline at end of file + + @JsonProperty("Header") + @Column(columnDefinition = "text") + String Header; + + @JsonProperty("Timestamp") + Instant Timestamp; \ No newline at end of file