Helius
2021-06-21 5812839f3e23bb09e1a9b100b63273a646155709
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.xzx.log.entity;
 
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
 
import javax.validation.constraints.NotBlank;
import java.util.Date;
 
@Data
@Document(indexName =  "sysprogramlog")
public class SysProgramLog {
 
    @Id
    private String id;
 
    @NotBlank(message = "消息内容不能为空")
    @Field(type = FieldType.Keyword)
    private String msg;
 
    @Field(type = FieldType.Date,format =DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
 
}