add ResponseView
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.imyeyu.spring.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
import com.imyeyu.spring.annotation.table.DeleteColumn;
|
||||
import com.imyeyu.spring.util.ResponseView;
|
||||
import com.imyeyu.utils.Time;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -16,15 +18,19 @@ import java.io.Serializable;
|
||||
public class BaseEntity implements Serializable, Creatable, Updatable, Deletable {
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonView(ResponseView.Public.class)
|
||||
protected Long createdAt;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonView(ResponseView.Public.class)
|
||||
protected Long updatedAt;
|
||||
|
||||
/** 删除时间 */
|
||||
@DeleteColumn
|
||||
@JsonView(ResponseView.Admin.class)
|
||||
protected Long deletedAt;
|
||||
|
||||
@JsonView(ResponseView.Admin.class)
|
||||
@Override
|
||||
public boolean isDeleted() {
|
||||
return deletedAt != null && deletedAt < Time.now();
|
||||
|
||||
Reference in New Issue
Block a user