|
@@ -5,13 +5,15 @@ import lombok.AllArgsConstructor;
|
|
|
import lombok.Builder;
|
|
|
import lombok.Data;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
+import org.springframework.data.mongodb.core.index.Indexed;
|
|
|
import org.springframework.data.mongodb.core.mapping.Document;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
@Data
|
|
|
@Builder
|
|
|
@Document
|
|
|
@AllArgsConstructor
|
|
|
-@NoArgsConstructor
|
|
|
public class ApiLog extends SuperEntity {
|
|
|
/**
|
|
|
* 请求id
|
|
@@ -21,8 +23,10 @@ public class ApiLog extends SuperEntity {
|
|
|
/**
|
|
|
* 接口
|
|
|
*/
|
|
|
+ @Indexed
|
|
|
private String service;
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 入参
|
|
|
*/
|
|
@@ -38,6 +42,11 @@ public class ApiLog extends SuperEntity {
|
|
|
*/
|
|
|
private String system;
|
|
|
|
|
|
+ @Indexed(expireAfterSeconds = 0)
|
|
|
+ private Date ttl;
|
|
|
|
|
|
|
|
|
+ public ApiLog() {
|
|
|
+ ttl = new Date(System.currentTimeMillis()+1000L*60*60*24*7);
|
|
|
+ }
|
|
|
}
|