package cn.reghao.autodop.dmaster.rbac.model.vo;

import cn.reghao.autodop.dmaster.rbac.model.po.Role;
import cn.reghao.jdkutil.converter.DateTimeConverter;
import lombok.Data;

/**
 * @author reghao
 * @date 2021-07-14 14:14:07
 */
@Data
public class RoleVO {
    private Integer roleId;
    private String title;
    private String name;
    private String description;
    private String createTime;
    private String updateTime;

    public RoleVO(Role role) {
        this.roleId = role.getId();
        this.title = role.getTitle().split("ROLE_")[1];
        this.name = role.getName();
        this.description = role.getDescription();
        this.createTime = DateTimeConverter.format(role.getCreateTime());
        this.updateTime = DateTimeConverter.format(role.getUpdateTime());
    }
}
