package com.crm.rely.backend.core.entity.base;

import lombok.Data;

import java.util.Date;
@Data
public class BaseDelete implements BaseInterfaceEntity {
    private Date deleteTime;

    private Long deleteUser;

    private String deleteIp;

    private Date modifyTime;

    private Long modifyUser;

    private String modifyIp;

    private String note;

    @Override
    public void populateMetadata(String ip, Long userId, String location, Date dateTime) {
        modifyTime = dateTime;
        modifyUser = userId;
        modifyIp = ip;
        deleteTime = dateTime;
        deleteUser = userId;
        deleteIp = ip;

        if (location != null && location.trim().length() > 0) {
            modifyIp += "-" + location;
            deleteIp += "-" + location;
        }
    }
}
