package com.yida.data.common.core.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yida.data.common.core.entity.system.EduUserLogo;
import com.yida.data.common.core.entity.system.enums.DeptTypeEnum;
import com.yida.data.common.core.entity.system.enums.RoleEnum;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

/**
 * @author MrBird
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CurrentUser implements Serializable {

    private static long serialVersionUID = 761748087824726463L;

    @JsonIgnore
    private String password;
    private String username;
    private String nickname;
    @JsonIgnore
    private Set<GrantedAuthority> authorities;
    private boolean accountNonExpired;
    private boolean accountNonLocked;
    private boolean credentialsNonExpired;
    private boolean enabled;
    private Long userId;
    private String avatar;
    private String email;
    private String mobile;
    private String sex;
    private Long deptId;
    /**
     * 部门类型 {@link DeptTypeEnum}
     */
    private Integer deptType;
    private String deptName;
    private String roleId;
    private String roleName;
    /**
     * 角色标识
     */
    private String rolePerms;

    @JsonIgnore
    private LocalDateTime lastLoginTime;
    private String description;
    private String status;
    private String deptIds;

    private String openId;

    private Long identityId;

    /**
     * 代理商部门id(角色为代理商相关时存在)
     */
    private Long agentId;

    /**
     * 角色类型集合 {@link RoleEnum}
     */
    private List<Integer> roleTypeList;

    /**
     * 创建人id
     */
    private Long createId;

    /**
     * 创建人部门id
     */
    private Long createDeptId;

    /**
     * 主部门id(学校、教育局、代理商主部门id)
     */
    private Long mainDeptId;

    /**
     * 主角色标识
     */
    private String mainRolePerms;


    /**
     * 学校性质：0幼儿园，1小学，2中学，3九年一贯，4十二年一贯，5：高校
     */
    private Integer schoolNature;

    @JsonIgnore
    private EduUserLogo userLogo;
}
