package jnpf.model.authority.vo.post;

import jnpf.model.authority.po.FtbPermissionRoleAuthorizePost;
import lombok.Data;

import java.util.Date;

@Data
public class FtbAuthorizedPostVO {
    /**
     * 授权岗位主键id
     */
    private String id;
    /**
     * 岗位id
     */
    private String postId;

    /**
     * 组织
     */
    private String orgName;
    /**
     * 岗位
     */
    private String postName;
    /**
     * 操作时间
     */
    private Date operateTime;
    /**
     * 操作人姓名
     */
    private String operatorUserName;
    /**
     * 操作人用户id
     */
    private String operatorUserId;


    public static FtbAuthorizedPostVO convert(FtbPermissionRoleAuthorizePost post) {
        if (post == null) {
            return null;
        }
        FtbAuthorizedPostVO ftbAuthorizedPostVO = new FtbAuthorizedPostVO();
        ftbAuthorizedPostVO.setId(post.getId());
        ftbAuthorizedPostVO.setOperatorUserId(post.getCreatorUserId());
        ftbAuthorizedPostVO.setOperateTime(post.getCreatorTime());
        ftbAuthorizedPostVO.setPostId(post.getPostId());
        return ftbAuthorizedPostVO;
    }
}
