Files
operationSystem-back/src/main/java/com/caliverse/admin/mongodb/domain/BusinessLog.java

56 lines
1.5 KiB
Java

package com.caliverse.admin.mongodb.domain;
import com.caliverse.admin.domain.entity.log.LogAction;
import com.caliverse.admin.domain.entity.log.LogCategory;
import com.caliverse.admin.domain.entity.log.LogStatus;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import java.time.LocalDateTime;
@Document(collection = "businessLog")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BusinessLog {
@Id
private String id;
@Indexed
private LocalDateTime logTime;
@Indexed
private LogCategory category;
@Indexed
private LogAction action;
@Indexed
private LogStatus status;
private String worker;
private String workerIp;
private String message;
private String procId;
@JsonIgnoreProperties(value = {"messageContent"}, allowSetters = true)
private Object domain;
@CompoundIndex(def = "{'category': 1, 'action': 1, 'logTime': -1}")
@CompoundIndex(def = "{'status': 1, 'logTime': -1}")
@CompoundIndex(def = "{'procId': 1, 'logTime': -1}")
@CompoundIndex(def = "{'category': 1, 'logTime': -1}")
@CompoundIndex(def = "{'action': 1, 'logTime': -1}")
public static class Indexes {}
}