package com.bocloud.cmp.model.jumpserver;

import com.alibaba.fastjson.annotation.JSONField;
import com.bocloud.cmp.entity.enums.jumpserver.State;

public class Account {
    private Long id;
    private Boolean containPassword;
    @JSONField(name = "createtime")
    private Long createTime;
    private Long creator;
    // 如果haspassword=1：不传密码password则不改变帐号的密码，传了密码password则改变帐号密码
    // 如果haspassword=0或null：文档瞎jb写，有的地方写给了password会清空密码，有的地方写不给password会清空密码
    @JSONField(name = "haspassword")
    private Integer hasPassword;
    private String name;
    @JSONField(name = "priv")
    private Boolean privilege;
    private Integer type;
    private String oldName;
    private String password;
    private State status;
    private String role;// oracle数据库必填字段,"SYSDBA"

    public Long getId() {
        return id;
    }

    public void setId(Long Id) {
        this.id = Id;
    }

    public Account(String name) {
        this.name = name;
    }

    public Account() {
    }

    public Account(Boolean containPassword, String name, String password,
                   Boolean privilege, Integer type, String oldName, State state) {
        this.containPassword = containPassword;
        this.name = name;
        this.password = password;
        this.privilege = privilege;
        this.type = type;
        this.oldName = oldName;
        this.status = state;
    }

    public Boolean getContainPassword() {
        return containPassword;
    }

    public void setContainPassword(Boolean containPassword) {
        this.containPassword = containPassword;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getCreator() {
        return creator;
    }

    public void setCreator(Long creator) {
        this.creator = creator;
    }

    public Integer getHasPassword() {
        return hasPassword;
    }

    public void setHasPassword(Integer hasPassword) {
        this.hasPassword = hasPassword;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getPrivilege() {
        return privilege;
    }

    public void setPrivilege(Boolean privilege) {
        this.privilege = privilege;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getOldName() {
        return oldName;
    }

    public void setOldName(String oldName) {
        this.oldName = oldName;
    }

    public Integer getStatus() {
        if (status == null) {
            return null;
        }
        return this.status.getValue();
    }

    public State getState() {
        return this.status;
    }

    public void setStatus(State status) {
        this.status = status;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }
}
