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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* Copyright (c) 2018, yiboshi.com All Rights Reserved. */
package com.yiboshi.science.base;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yiboshi.science.Constants;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import java.io.Serializable;
import java.util.Date;
/**
* DTO基类
*
* @author NEGI
* @version 2018-08
*/
public class BaseDTO implements Serializable {
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "创建时间", position = 7)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date created;
@ApiModelProperty(value = "最后修改时间", hidden = true)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date updated;
@JsonIgnore
@ApiModelProperty(value = "操作人id", hidden = true)
private String operId;
@JsonIgnore
@ApiModelProperty(value = "有效性", hidden = true)
private Boolean validity;
public String getId() { return id; }
public void setId(String id) {
this.id = id;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getCreated() {
return created;
}
public void setUpdated(Date updated) {
this.updated = updated;
}
public Date getUpdated() {
return updated;
}
public String getOperId() {
return operId;
}
public void setOperId(String operId) {
this.operId = operId;
}
public Boolean getValidity() {
return validity;
}
public void setValidity(Boolean validity) {
this.validity = validity;
}
@Override
public String toString() {
return ReflectionToStringBuilder.toStringExclude(this, Constants.excludeFieldNames);
}
}