From 0b077806196ceb8a68af93f00880ccc70aee50c2 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 07 七月 2022 18:08:14 +0800
Subject: [PATCH] add 整合 springdoc 移除 knife4j

---
 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java |  269 ++++++++++++++++++++++++++---------------------------
 1 files changed, 134 insertions(+), 135 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 2fa57f5..3a35916 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,15 +1,15 @@
 package com.ruoyi.common.core.domain.entity;
 
 import com.baomidou.mybatisplus.annotation.*;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ruoyi.common.annotation.Sensitive;
+import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
+import com.ruoyi.common.enums.SensitiveStrategy;
+import com.ruoyi.common.xss.Xss;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
 
 import javax.validation.constraints.Email;
 import javax.validation.constraints.NotBlank;
@@ -26,159 +26,158 @@
 @Data
 @NoArgsConstructor
 @EqualsAndHashCode(callSuper = true)
-@Accessors(chain = true)
 @TableName("sys_user")
-@ApiModel("鐢ㄦ埛淇℃伅涓氬姟瀵硅薄")
+@Schema(name = "鐢ㄦ埛淇℃伅涓氬姟瀵硅薄")
 public class SysUser extends BaseEntity {
 
-	/**
-	 * 鐢ㄦ埛ID
-	 */
-	@ApiModelProperty(value = "鐢ㄦ埛ID")
-	@TableId(value = "user_id")
-	private Long userId;
+    /**
+     * 鐢ㄦ埛ID
+     */
+    @Schema(name = "鐢ㄦ埛ID")
+    @TableId(value = "user_id")
+    private Long userId;
 
-	/**
-	 * 閮ㄩ棬ID
-	 */
-	@ApiModelProperty(value = "閮ㄩ棬ID")
-	private Long deptId;
+    /**
+     * 閮ㄩ棬ID
+     */
+    @Schema(name = "閮ㄩ棬ID")
+    private Long deptId;
 
-	/**
-	 * 鐢ㄦ埛璐﹀彿
-	 */
-	@ApiModelProperty(value = "鐢ㄦ埛璐﹀彿")
-	@NotBlank(message = "鐢ㄦ埛璐﹀彿涓嶈兘涓虹┖")
-	@Size(min = 0, max = 30, message = "鐢ㄦ埛璐﹀彿闀垮害涓嶈兘瓒呰繃30涓瓧绗�")
-	private String userName;
+    /**
+     * 鐢ㄦ埛璐﹀彿
+     */
+    @Schema(name = "鐢ㄦ埛璐﹀彿")
+    @Xss(message = "鐢ㄦ埛璐﹀彿涓嶈兘鍖呭惈鑴氭湰瀛楃")
+    @NotBlank(message = "鐢ㄦ埛璐﹀彿涓嶈兘涓虹┖")
+    @Size(min = 0, max = 30, message = "鐢ㄦ埛璐﹀彿闀垮害涓嶈兘瓒呰繃30涓瓧绗�")
+    private String userName;
 
-	/**
-	 * 鐢ㄦ埛鏄电О
-	 */
-	@ApiModelProperty(value = "鐢ㄦ埛鏄电О")
-	@Size(min = 0, max = 30, message = "鐢ㄦ埛鏄电О闀垮害涓嶈兘瓒呰繃30涓瓧绗�")
-	private String nickName;
+    /**
+     * 鐢ㄦ埛鏄电О
+     */
+    @Schema(name = "鐢ㄦ埛鏄电О")
+    @Xss(message = "鐢ㄦ埛鏄电О涓嶈兘鍖呭惈鑴氭湰瀛楃")
+    @Size(min = 0, max = 30, message = "鐢ㄦ埛鏄电О闀垮害涓嶈兘瓒呰繃30涓瓧绗�")
+    private String nickName;
 
-	/**
-	 * 鐢ㄦ埛閭
-	 */
-	@ApiModelProperty(value = "鐢ㄦ埛閭")
-	@Email(message = "閭鏍煎紡涓嶆纭�")
-	@Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗�")
-	private String email;
+    /**
+     * 鐢ㄦ埛绫诲瀷锛坰ys_user绯荤粺鐢ㄦ埛锛�
+     */
+    @Schema(name = "鐢ㄦ埛绫诲瀷")
+    private String userType;
 
-	/**
-	 * 鎵嬫満鍙风爜
-	 */
-	@ApiModelProperty(value = "鎵嬫満鍙风爜")
-	private String phonenumber;
+    /**
+     * 鐢ㄦ埛閭
+     */
+    @Sensitive(strategy = SensitiveStrategy.EMAIL)
+    @Schema(name = "鐢ㄦ埛閭")
+    @Email(message = "閭鏍煎紡涓嶆纭�")
+    @Size(min = 0, max = 50, message = "閭闀垮害涓嶈兘瓒呰繃50涓瓧绗�")
+    private String email;
 
-	/**
-	 * 鐢ㄦ埛鎬у埆
-	 */
-	@ApiModelProperty(value = "鐢ㄦ埛鎬у埆")
-	private String sex;
+    /**
+     * 鎵嬫満鍙风爜
+     */
+    @Sensitive(strategy = SensitiveStrategy.PHONE)
+    @Schema(name = "鎵嬫満鍙风爜")
+    private String phonenumber;
 
-	/**
-	 * 鐢ㄦ埛澶村儚
-	 */
-	@ApiModelProperty(value = "鐢ㄦ埛澶村儚")
-	private String avatar;
+    /**
+     * 鐢ㄦ埛鎬у埆
+     */
+    @Schema(name = "鐢ㄦ埛鎬у埆")
+    private String sex;
 
-	/**
-	 * 瀵嗙爜
-	 */
-	@ApiModelProperty(value = "瀵嗙爜")
-	@TableField(
-			insertStrategy = FieldStrategy.NOT_EMPTY,
-			updateStrategy = FieldStrategy.NOT_EMPTY,
-			whereStrategy = FieldStrategy.NOT_EMPTY
-	)
-	private String password;
+    /**
+     * 鐢ㄦ埛澶村儚
+     */
+    @Schema(name = "鐢ㄦ埛澶村儚")
+    private String avatar;
 
-	@JsonIgnore
-	@JsonProperty
-	public String getPassword() {
-		return password;
-	}
+    /**
+     * 瀵嗙爜
+     */
+    @Schema(name = "瀵嗙爜")
+    @TableField(
+        insertStrategy = FieldStrategy.NOT_EMPTY,
+        updateStrategy = FieldStrategy.NOT_EMPTY,
+        whereStrategy = FieldStrategy.NOT_EMPTY
+    )
+    private String password;
 
-	/**
-	 * 甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛�
-	 */
-	@ApiModelProperty(value = "甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛�")
-	private String status;
+    /**
+     * 甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛�
+     */
+    @Schema(name = "甯愬彿鐘舵�侊紙0姝e父 1鍋滅敤锛�")
+    private String status;
 
-	/**
-	 * 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�
-	 */
-	@ApiModelProperty(value = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�")
-	@TableLogic
-	private String delFlag;
+    /**
+     * 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�
+     */
+    @Schema(name = "鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�")
+    @TableLogic
+    private String delFlag;
 
-	/**
-	 * 鏈�鍚庣櫥褰旾P
-	 */
-	@ApiModelProperty(value = "鏈�鍚庣櫥褰旾P")
-	private String loginIp;
+    /**
+     * 鏈�鍚庣櫥褰旾P
+     */
+    @Schema(name = "鏈�鍚庣櫥褰旾P")
+    private String loginIp;
 
-	/**
-	 * 鏈�鍚庣櫥褰曟椂闂�
-	 */
-	@ApiModelProperty(value = "鏈�鍚庣櫥褰曟椂闂�")
-	private Date loginDate;
+    /**
+     * 鏈�鍚庣櫥褰曟椂闂�
+     */
+    @Schema(name = "鏈�鍚庣櫥褰曟椂闂�")
+    private Date loginDate;
 
-	/**
-	 * 澶囨敞
-	 */
-	@ApiModelProperty(value = "澶囨敞")
-	private String remark;
+    /**
+     * 澶囨敞
+     */
+    @Schema(name = "澶囨敞")
+    private String remark;
 
-	/**
-	 * 閮ㄩ棬瀵硅薄
-	 */
-	@ApiModelProperty(value = "閮ㄩ棬瀵硅薄")
-	@TableField(exist = false)
-	private SysDept dept;
+    /**
+     * 閮ㄩ棬瀵硅薄
+     */
+    @Schema(name = "閮ㄩ棬瀵硅薄")
+    @TableField(exist = false)
+    private SysDept dept;
 
-	/**
-	 * 瑙掕壊瀵硅薄
-	 */
-	@ApiModelProperty(value = "瑙掕壊瀵硅薄")
-	@TableField(exist = false)
-	private List<SysRole> roles;
+    /**
+     * 瑙掕壊瀵硅薄
+     */
+    @Schema(name = "瑙掕壊瀵硅薄")
+    @TableField(exist = false)
+    private List<SysRole> roles;
 
-	/**
-	 * 瑙掕壊缁�
-	 */
-	@ApiModelProperty(value = "瑙掕壊缁�")
-	@TableField(exist = false)
-	private Long[] roleIds;
+    /**
+     * 瑙掕壊缁�
+     */
+    @Schema(name = "瑙掕壊缁�")
+    @TableField(exist = false)
+    private Long[] roleIds;
 
-	/**
-	 * 宀椾綅缁�
-	 */
-	@ApiModelProperty(value = "宀椾綅缁�")
-	@TableField(exist = false)
-	private Long[] postIds;
+    /**
+     * 宀椾綅缁�
+     */
+    @Schema(name = "宀椾綅缁�")
+    @TableField(exist = false)
+    private Long[] postIds;
 
-	/**
-	 * 瑙掕壊ID
-	 */
-	@ApiModelProperty(value = "瑙掕壊ID")
-	@TableField(exist = false)
-	private Long roleId;
+    /**
+     * 鏁版嵁鏉冮檺 褰撳墠瑙掕壊ID
+     */
+    @Schema(name = "瑙掕壊ID")
+    @TableField(exist = false)
+    private Long roleId;
 
-	public SysUser(Long userId) {
-		this.userId = userId;
-	}
+    public SysUser(Long userId) {
+        this.userId = userId;
+    }
 
-	@ApiModelProperty(value = "鏄惁绠$悊鍛�")
-	public boolean isAdmin() {
-		return isAdmin(this.userId);
-	}
-
-	public static boolean isAdmin(Long userId) {
-		return userId != null && 1L == userId;
-	}
+    @Schema(name = "鏄惁绠$悊鍛�")
+    public boolean isAdmin() {
+        return UserConstants.ADMIN_ID.equals(this.userId);
+    }
 
 }

--
Gitblit v1.9.3