123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- package com.zanxiang.mybatis.entity;
- import com.baomidou.mybatisplus.annotation.IdType;
- import com.baomidou.mybatisplus.annotation.TableId;
- import com.baomidou.mybatisplus.annotation.TableName;
- import lombok.*;
- import org.apache.logging.log4j.util.Strings;
- import java.time.LocalDateTime;
- /**
- * @author : lingfeng
- * @time : 2022-09-26
- * @description : 用户实名认证信息
- */
- @Data
- @NoArgsConstructor
- @AllArgsConstructor
- @ToString
- @Builder
- @TableName("t_user_card")
- public class UserCard {
- /**
- * 主键
- */
- @TableId(value = "id", type = IdType.AUTO)
- private Long id;
- /**
- * 用户id
- */
- private Long userId;
- /**
- * 用户名
- */
- private String username;
- /**
- * 昵称
- */
- private String nickname;
- /**
- * 注册时间
- */
- private LocalDateTime regTime;
- /**
- * 身份证号
- */
- private String cardId;
- /**
- * 真实姓名
- */
- private String cardName;
- /**
- * 生日
- */
- private String birthday;
- /**
- * 性别, 0 : 未知, 1 : 男, 2 : 女
- */
- private Integer sex;
- /**
- * 实名证件类型 1、身份证
- */
- private Integer cardType;
- /**
- * 创建时间
- */
- private LocalDateTime createTime;
- /**
- * 更新时间
- */
- private LocalDateTime updateTime;
- /**
- * 获取展示身份证号
- *
- * @return : 返回显示身份证号
- */
- public String getShowCardId() {
- if (Strings.isBlank(this.cardId)) {
- return null;
- }
- return this.cardId.substring(0, 3) + " *** " + this.cardId.substring(this.cardId.length() - 3);
- }
- /**
- * 获取展示身份证号
- *
- * @return : 返回显示身份证号
- */
- public String getShowCardName() {
- if (Strings.isBlank(this.cardName)) {
- return null;
- }
- //两个字得名字
- if (this.cardName.length() <= 2) {
- return this.cardName.substring(0, 1) + " * ";
- }
- //两个字以上得名字, 显示头尾
- return this.cardName.substring(0, 1) + " * " + this.cardName.substring(this.cardName.length() - 1);
- }
- }
|