All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.erupt.jpa.model.MetaDataProxy Maven / Gradle / Ivy

There is a newer version: 1.12.17
Show newest version
package xyz.erupt.jpa.model;

import xyz.erupt.annotation.fun.DataProxy;
import xyz.erupt.core.context.MetaContext;

import java.time.LocalDateTime;

/**
 * @author YuePeng
 * date 2021/12/20 22:04
 */
public class MetaDataProxy implements DataProxy {

    @Override
    public void beforeAdd(MetaModel metaModel) {
        metaModel.setCreateTime(LocalDateTime.now());
        metaModel.setCreateBy(MetaContext.getUser().getName());
        metaModel.setUpdateTime(metaModel.getCreateTime());
        metaModel.setUpdateBy(metaModel.getCreateBy());
    }

    @Override
    public void beforeUpdate(MetaModel metaModel) {
        metaModel.setUpdateTime(LocalDateTime.now());
        metaModel.setUpdateBy(MetaContext.getUser().getName());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy