/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.platform.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.common.utils.Base64Utils;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 用户银行卡信息表实体类
 *
 * @author BladeX
 * @since 2022-02-19
 */
@Data
@TableName("t_user_bank_cards")
@ApiModel(value = "UserBankCards对象", description = "用户银行卡信息表")
public class UserBankCards implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键Id
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键Id")
	private Long id;

	/**
	 * 银行Id
	 */
	@ApiModelProperty(value = "银行Id")
	private Long bankId;

	/**
	 * 用户Id
	 */
	@ApiModelProperty(value = "用户Id")
	private Long userId;
	/**
	 * 账户姓名
	 */
	@ApiModelProperty(value = "账户姓名")
	private String name;
	/**
	 * 银行开预留手机号
	 */
	@ApiModelProperty(value = "银行开预留手机号")
	private String mobile;
	/**
	 * 身份证
	 */
	@ApiModelProperty(value = "身份证")
	private String cardCode;
	/**
	 * 银行卡号
	 */
	@ApiModelProperty(value = "银行卡号")
	private String backNo;

	/**
	 * 区域编号
	 */
	@ApiModelProperty(value = "区域编号")
	private String areaCode;

	/**
	 * 区域名称
	 */
	@ApiModelProperty(value = "区域名称")
	private String areaName;
	/**
	 * 排序
	 */
	@ApiModelProperty(value = "排序")
	private Integer sort;

	/**
	 * 更新时间
	 */
	@ApiModelProperty(value = "更新时间")
	private Date updateTime;

	/**
	 * 绑定时间
	 */
	@ApiModelProperty(value = "绑定时间")
	private Date createTime;

	@ApiModelProperty(value = "请求号")
	private String requestNo;

	@ApiModelProperty(value = "是否绑定")
	private Integer isBind;

	@ApiModelProperty(value = "第三方用户id")
	private String customerId;

	public String getCustomerIdmd(){
		return Base64Utils.getStr16(this.getUserId().toString()).substring(8, 24);
	}
}
