package com.engine.organization.entity.postion.dto;

import com.engine.organization.entity.postion.po.PostPO;

import java.util.Date;

/**
 * @description:
 * @author:dxfeng
 * @createTime: 2022/05/13
 * @version: 1.0
 */
public class PostDTO {
    public static PostPO convertPO(PostPO postPO, long employeeId) {
        if (postPO == null) {
            return null;
        }
        return PostPO.builder()
                .id(postPO.getId() == null ? 0 : postPO.getId())
                .postName(postPO.getPostName() == null ? null : postPO.getPostName())
                .description(postPO.getDescription() == null ? null : postPO.getDescription())
                .deleteType(0)
                .createTime(new Date())
                .updateTime(new Date())
                .creator(employeeId)
                .build();
    }

}
