From 22daef0b51625b888939bdee39f50ca07e2a5ffc Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 03 九月 2021 17:14:19 +0800 Subject: [PATCH] update 泛型统一使用 V --- ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java | 244 +++++++++++++++++++++++++++--------------------- 1 files changed, 136 insertions(+), 108 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index a371039..6e44a3b 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -1,13 +1,8 @@ package com.ruoyi.common.core.domain.entity; import com.baomidou.mybatisplus.annotation.*; -import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.annotation.Excel.ColumnType; -import com.ruoyi.common.annotation.Excel.Type; -import com.ruoyi.common.annotation.Excels; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; @@ -31,139 +26,172 @@ @NoArgsConstructor @Accessors(chain = true) @TableName("sys_user") -public class SysUser implements Serializable -{ - private static final long serialVersionUID = 1L; +public class SysUser implements Serializable { + private static final long serialVersionUID = 1L; - /** 鐢ㄦ埛ID */ - @Excel(name = "鐢ㄦ埛搴忓彿", cellType = ColumnType.NUMERIC, prompt = "鐢ㄦ埛缂栧彿") - @TableId(value = "user_id",type = IdType.AUTO) - private Long userId; + /** + * 鐢ㄦ埛ID + */ + @TableId(value = "user_id", type = IdType.AUTO) + private Long userId; - /** 閮ㄩ棬ID */ - @Excel(name = "閮ㄩ棬缂栧彿", type = Type.IMPORT) - private Long deptId; + /** + * 閮ㄩ棬ID + */ + private Long deptId; - /** 鐢ㄦ埛璐﹀彿 */ - @NotBlank(message = "鐢ㄦ埛璐﹀彿涓嶈兘涓虹┖") - @Size(min = 0, max = 30, message = "鐢ㄦ埛璐﹀彿闀垮害涓嶈兘瓒呰繃30涓瓧绗�") - @Excel(name = "鐧诲綍鍚嶇О") - private String userName; + /** + * 鐢ㄦ埛璐﹀彿 + */ + @NotBlank(message = "鐢ㄦ埛璐﹀彿涓嶈兘涓虹┖") + @Size(min = 0, max = 30, message = "鐢ㄦ埛璐﹀彿闀垮害涓嶈兘瓒呰繃30涓瓧绗�") + private String userName; - /** 鐢ㄦ埛鏄电О */ - @Size(min = 0, max = 30, message = "鐢ㄦ埛鏄电О闀垮害涓嶈兘瓒呰繃30涓瓧绗�") - @Excel(name = "鐢ㄦ埛鍚嶇О") - private String nickName; + /** + * 鐢ㄦ埛鏄电О + */ + @Size(min = 0, max = 30, message = "鐢ㄦ埛鏄电О闀垮害涓嶈兘瓒呰繃30涓瓧绗�") + private String nickName; - /** 鐢ㄦ埛閭 */ - @Email(message = "閭鏍煎紡涓嶆纭�") - @Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗�") - @Excel(name = "鐢ㄦ埛閭") - private String email; + /** + * 鐢ㄦ埛閭 + */ + @Email(message = "閭鏍煎紡涓嶆纭�") + @Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗�") + private String email; - /** 鎵嬫満鍙风爜 */ - @Excel(name = "鎵嬫満鍙风爜") - private String phonenumber; + /** + * 鎵嬫満鍙风爜 + */ + private String phonenumber; - /** 鐢ㄦ埛鎬у埆 */ - @Excel(name = "鐢ㄦ埛鎬у埆", readConverterExp = "0=鐢�,1=濂�,2=鏈煡") - private String sex; + /** + * 鐢ㄦ埛鎬у埆 + */ + private String sex; - /** 鐢ㄦ埛澶村儚 */ - private String avatar; + /** + * 鐢ㄦ埛澶村儚 + */ + private String avatar; - /** 瀵嗙爜 */ - private String password; + /** + * 瀵嗙爜 + */ + @TableField( + insertStrategy = FieldStrategy.NOT_EMPTY, + updateStrategy = FieldStrategy.NOT_EMPTY, + whereStrategy = FieldStrategy.NOT_EMPTY + ) + private String password; - @JsonIgnore - @JsonProperty - public String getPassword() { - return password; - } + @JsonIgnore + @JsonProperty + public String getPassword() { + return password; + } - /** 鐩愬姞瀵� */ - private String salt; + /** + * 鐩愬姞瀵� + */ + private String salt; - /** 甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛� */ - @Excel(name = "甯愬彿鐘舵��", readConverterExp = "0=姝e父,1=鍋滅敤") - private String status; + /** + * 甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛� + */ + private String status; - /** 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� */ - @TableLogic - private String delFlag; + /** + * 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� + */ + @TableLogic + private String delFlag; - /** 鏈�鍚庣櫥褰旾P */ - @Excel(name = "鏈�鍚庣櫥褰旾P", type = Type.EXPORT) - private String loginIp; + /** + * 鏈�鍚庣櫥褰旾P + */ + private String loginIp; - /** 鏈�鍚庣櫥褰曟椂闂� */ - @Excel(name = "鏈�鍚庣櫥褰曟椂闂�", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) - private Date loginDate; + /** + * 鏈�鍚庣櫥褰曟椂闂� + */ + private Date loginDate; - /** 鍒涘缓鑰� */ - @TableField(fill = FieldFill.INSERT) - private String createBy; + /** + * 鍒涘缓鑰� + */ + @TableField(fill = FieldFill.INSERT) + private String createBy; - /** 鍒涘缓鏃堕棿 */ - @TableField(fill = FieldFill.INSERT) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date createTime; + /** + * 鍒涘缓鏃堕棿 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; - /** 鏇存柊鑰� */ - @TableField(fill = FieldFill.INSERT_UPDATE) - private String updateBy; + /** + * 鏇存柊鑰� + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; - /** 鏇存柊鏃堕棿 */ - @TableField(fill = FieldFill.INSERT_UPDATE) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date updateTime; + /** + * 鏇存柊鏃堕棿 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; - /** 澶囨敞 */ - private String remark; + /** + * 澶囨敞 + */ + private String remark; - /** - * 璇锋眰鍙傛暟 - */ - @TableField(exist = false) - private Map<String, Object> params = new HashMap<>(); + /** + * 璇锋眰鍙傛暟 + */ + @TableField(exist = false) + private Map<String, Object> params = new HashMap<>(); - /** 閮ㄩ棬瀵硅薄 */ - @Excels({ - @Excel(name = "閮ㄩ棬鍚嶇О", targetAttr = "deptName", type = Type.EXPORT), - @Excel(name = "閮ㄩ棬璐熻矗浜�", targetAttr = "leader", type = Type.EXPORT) - }) - @TableField(exist = false) - private SysDept dept; + /** + * 閮ㄩ棬瀵硅薄 + */ + @TableField(exist = false) + private SysDept dept; - /** 瑙掕壊瀵硅薄 */ - @TableField(exist = false) - private List<SysRole> roles; + /** + * 瑙掕壊瀵硅薄 + */ + @TableField(exist = false) + private List<SysRole> roles; - /** 瑙掕壊缁� */ - @TableField(exist = false) - private Long[] roleIds; + /** + * 瑙掕壊缁� + */ + @TableField(exist = false) + private Long[] roleIds; - /** 宀椾綅缁� */ - @TableField(exist = false) - private Long[] postIds; + /** + * 宀椾綅缁� + */ + @TableField(exist = false) + private Long[] postIds; - /** 瑙掕壊ID */ + /** + * 瑙掕壊ID + */ @TableField(exist = false) private Long roleId; - public SysUser(Long userId) - { - this.userId = userId; - } + public SysUser(Long userId) { + this.userId = userId; + } - public boolean isAdmin() - { - return isAdmin(this.userId); - } + public boolean isAdmin() { + return isAdmin(this.userId); + } - public static boolean isAdmin(Long userId) - { - return userId != null && 1L == userId; - } + public static boolean isAdmin(Long userId) { + return userId != null && 1L == userId; + } } -- Gitblit v1.9.3