package com.gxwebsoft.shop.entity;

import cn.hutool.core.util.DesensitizedUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.security.core.parameters.P;

/**
 * 商户账号
 *
 * @author 科技小王子
 * @since 2024-04-19 12:02:24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "MerchantAccount对象", description = "商户账号")
@TableName("shop_merchant_account")
public class MerchantAccount implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "商户手机号")
    private String phone;

    @ApiModelProperty(value = "账号密码")
    @TableField(exist = false)
    private String password;

    @ApiModelProperty(value = "真实姓名")
    private String realName;

    @ApiModelProperty(value = "商户ID")
    private Integer merchantId;

    @ApiModelProperty(value = "角色ID")
    private Integer roleId;

    @ApiModelProperty(value = "角色名称")
    private String roleName;

    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @ApiModelProperty(value = "备注")
    private String comments;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "排序号")
    private Integer sortNumber;

    @ApiModelProperty(value = "租户id")
    private Integer tenantId;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "商户名称")
    @TableField(exist = false)
    private String merchantName;

    @ApiModelProperty(value = "商户头像")
    @TableField(exist = false)
    private String merchantAvatar;

    @ApiModelProperty(value = "是否需要审核")
    @TableField(exist = false)
    private Boolean goodsReview;

    @ApiModelProperty("手机号(脱敏)")
    @TableField(exist = false)
    private String mobile;

    public String getMobile(){
      return DesensitizedUtil.mobilePhone(this.phone);
    }

}
