xyz.erupt.upms.model.base.HyperDataProxy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of erupt-upms Show documentation
Show all versions of erupt-upms Show documentation
User Permissions Management
The newest version!
package xyz.erupt.upms.model.base;
import org.springframework.stereotype.Service;
import xyz.erupt.annotation.fun.DataProxy;
import xyz.erupt.upms.model.EruptUserVo;
import xyz.erupt.upms.service.EruptUserService;
import javax.annotation.Resource;
import java.util.Date;
/**
* @author YuePeng
* date 2020-08-04
*/
@Service
public class HyperDataProxy implements DataProxy {
@Resource
private EruptUserService eruptUserService;
@Override
public void beforeAdd(HyperModel hyperModel) {
hyperModel.setCreateTime(new Date());
hyperModel.setCreateUser(new EruptUserVo(eruptUserService.getCurrentUid()));
hyperModel.setUpdateTime(new Date());
hyperModel.setUpdateUser(new EruptUserVo(eruptUserService.getCurrentUid()));
}
@Override
public void beforeUpdate(HyperModel hyperModel) {
hyperModel.setUpdateTime(new Date());
hyperModel.setUpdateUser(new EruptUserVo(eruptUserService.getCurrentUid()));
}
}