package com.ruoyi.dk.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 客户
 * @TableName dk_customer
 */
@TableName(value ="dk_customer")
@Data
@Schema(description = "客户模型")
public class Customer implements Serializable {
    /**
     * ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 手机
     */
    @Schema(description = "手机")
    private String phoneNumber;

    /**
     * 用户名称
     */
    @Schema(description = "用户名称")
    private String nickName;

    @Schema(description = "用户编号")
    private String userCode;

    /**
     * 用户密码
     */
    @Schema(description = "用户密码")
    private String password;

    /**
     * 是否实名
     */
    @Schema(description = "是否实名")
    private Integer realNameAuth;

    /**
     * 是否贷款
     */
    @Schema(description = "是否贷款")
    private Integer loansFlag;

    @Schema(description = "允许提现")
    private Boolean allowWithdrawFlag;

    /**
     * 是否提现
     */
    @Schema(description = "是否提现")
    private Integer withdrawFlag;

    /**
     * 余额
     */
    @Schema(description = "余额")
    private BigDecimal account;

    @Schema(description = "贷款金额")
    private BigDecimal borrowAccount;

    @Schema(description = "还款金额")
    private BigDecimal repaymentAccount;

    /**
     * 状态 0-正常 1-封禁
     */
    @Schema(description = "状态 0-正常 1-封禁")
    private Integer status;

    @Schema(description = "最后登陆时间")
    private LocalDateTime lastLoginTime;

    @Schema(description = "最后登陆IP")
    private String lastLoginIp;

    @Schema(description = "当前登录时间")
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    private LocalDateTime updateTime;

    private String tenantId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @JsonIgnore
    public String getPassword() {
        return password;
    }
}
