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

import lombok.Data;

import java.util.Date;

@Data
public class BaseUpdateEntitys extends LongEntitys implements BaseInterfaceEntity {

    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;
        if (location != null && location.trim().length() > 0) {
            modifyIp += "-" + location;
        }
    }
}
