package org.xyzh.common.dto.sys;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.dto.BaseDTO;
import org.xyzh.common.utils.crypto.AesEncryptUtil;

import io.swagger.v3.oas.annotations.media.Schema;

/**
 * @description    系统用户DTO
 * @filename    TbSysUserDTO.java
 * @author    yslg
 * @copyright yslg
 * @since 2025-11-04
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "系统用户DTO")
public class TbSysUserDTO extends BaseDTO {

    @Schema(description = "用户ID")
    private String userId;

    @Schema(description = "用户编码")
    private String usercode;

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

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

    @Schema(description = "手机（加密）")
    private String phone;

    @Schema(description = "手机号哈希")
    private String phoneHash;

    @Schema(description = "微信ID")
    private String wechatId;

    @Schema(description = "用户状态")
    private String status;


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

}