package com.fuyuanshen.customer.domain.vo;


import com.fuyuanshen.common.tenant.core.TenantEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * @author: 默苍璃
 * @date: 2025-06-1211:34
 */
@Getter
@Setter
public class ConsumerVo  extends TenantEntity {

    @Schema(name = "ID", hidden = true)
    private Long customerId;

    @Schema(hidden = true)
    private Long deptId;

    @Schema(hidden = true)
    private Long pid;

    @Schema(hidden = true)
    private Byte userLevel;

    @Schema(name = "账号")
    private String userName;

    @Schema(name = "用户昵称")
    private String nickName;

    @Schema(name = "邮箱")
    private String email;

    @Schema(name = "电话号码")
    private String phone;

    @Schema(name = "用户性别")
    private String gender;

    @Schema(name = "头像真实名称", hidden = true)
    private String avatarName;

    @Schema(name = "头像存储的路径", hidden = true)
    private String avatarPath;

    @Schema(name = "密码")
    private String password;

    @Schema(name = "是否启用")
    private Boolean enabled;

    /**
     * 帐号状态（0正常 1停用）
     */
    @Schema(name = "帐号状态（0正常 1停用）")
    private String status;

    @Schema(name = "是否为admin账号", hidden = true)
    private Boolean isAdmin = false;

    @Schema(name = "最后修改密码的时间", hidden = true)
    private Date pwdResetTime;

    private List<ConsumerVo> children;


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ConsumerVo consumer = (ConsumerVo) o;
        return Objects.equals(customerId, consumer.customerId) && Objects.equals(userName, consumer.userName);
    }


    @Override
    public int hashCode() {
        return Objects.hash(customerId, userName);
    }


}
