package com.yonge.cooleshow.biz.dal.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

import org.springframework.beans.BeanUtils;

import com.yonge.cooleshow.auth.api.entity.SysUser;
import com.yonge.cooleshow.biz.dal.entity.Employee;
import com.yonge.cooleshow.biz.dal.enums.GenderEnum;
import com.yonge.cooleshow.common.enums.UserStatusEnum;
import com.yonge.cooleshow.common.enums.YesOrNoEnum;

/**
 * @Author: liweifan
 * @Data: 2022-04-06 16:04:57
 */
@ApiModel(value = "EmployeeVo对象", description = "员工表查询视图对象")
public class EmployeeVo extends Employee {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("昵称")
    private String username;
    @ApiModelProperty(value = "性别 0女 1男")
    private GenderEnum gender;
    @ApiModelProperty(value = "手机号")
    private String phone;
    @ApiModelProperty(value = "头像")
    private String avatar;
    @ApiModelProperty(value = "角色id列表")
    private List<Long> roleIds;
    @ApiModelProperty(value = "用户对象")
    private SysUser sysUser;

    @ApiModelProperty(value = "是否注销 0否 1是")
    private YesOrNoEnum delFlag;

    @ApiModelProperty(value = "用户状态 NORMAL-正常   LOCKED-冻结  CLOSED-关闭")
    private UserStatusEnum userStatus;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public GenderEnum getGender() {
        return gender;
    }

    public void setGender(Object gender) {
        if (gender instanceof GenderEnum) {
            this.gender = (GenderEnum) gender;
        } else if (null != gender) {
            this.gender = GenderEnum.valueOf(Integer.parseInt(gender.toString()));
        }
    }


    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public List<Long> getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(List<Long> roleIds) {
        this.roleIds = roleIds;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public SysUser getSysUser() {
        return sysUser;
    }

    public void setSysUser(SysUser sysUser) {
        this.sysUser = sysUser;
    }

    public EmployeeVo buildVo(Employee employee) {
        if (null == employee) {
            return new EmployeeVo();
        }
        BeanUtils.copyProperties(employee, this);
        return this;
    }

	public YesOrNoEnum getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(YesOrNoEnum delFlag) {
		this.delFlag = delFlag;
	}

	public UserStatusEnum getUserStatus() {
		return userStatus;
	}

	public void setUserStatus(UserStatusEnum userStatus) {
		this.userStatus = userStatus;
	}
}