From d9e54388e7fde2462e8b7e0165c5e7da3f202593 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 07 七月 2022 19:07:59 +0800
Subject: [PATCH] add 整合 springdoc-openapi-javadoc 基于代码注释生成文档

---
 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java |  226 ++++++++++++++++++-------------------------------------
 1 files changed, 75 insertions(+), 151 deletions(-)

diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
index 3f152b3..e20f96a 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
@@ -1,176 +1,100 @@
 package com.ruoyi.common.core.domain.entity;
 
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.annotation.ExcelDictFormat;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.convert.ExcelDictConvert;
+import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.Size;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import com.ruoyi.common.annotation.Excel;
-import com.ruoyi.common.annotation.Excel.ColumnType;
-import com.ruoyi.common.constant.UserConstants;
-import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 瀛楀吀鏁版嵁琛� sys_dict_data
- * 
- * @author ruoyi
+ *
+ * @author Lion Li
  */
-public class SysDictData extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
 
-    /** 瀛楀吀缂栫爜 */
-    @Excel(name = "瀛楀吀缂栫爜", cellType = ColumnType.NUMERIC)
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("sys_dict_data")
+@ExcelIgnoreUnannotated
+public class SysDictData extends BaseEntity {
+
+    /**
+     * 瀛楀吀缂栫爜
+     */
+    @ExcelProperty(value = "瀛楀吀缂栫爜")
+    @TableId(value = "dict_code")
     private Long dictCode;
 
-    /** 瀛楀吀鎺掑簭 */
-    @Excel(name = "瀛楀吀鎺掑簭", cellType = ColumnType.NUMERIC)
-    private Long dictSort;
+    /**
+     * 瀛楀吀鎺掑簭
+     */
+    @ExcelProperty(value = "瀛楀吀鎺掑簭")
+    private Integer dictSort;
 
-    /** 瀛楀吀鏍囩 */
-    @Excel(name = "瀛楀吀鏍囩")
-    private String dictLabel;
-
-    /** 瀛楀吀閿�� */
-    @Excel(name = "瀛楀吀閿��")
-    private String dictValue;
-
-    /** 瀛楀吀绫诲瀷 */
-    @Excel(name = "瀛楀吀绫诲瀷")
-    private String dictType;
-
-    /** 鏍峰紡灞炴�э紙鍏朵粬鏍峰紡鎵╁睍锛� */
-    private String cssClass;
-
-    /** 琛ㄦ牸瀛楀吀鏍峰紡 */
-    private String listClass;
-
-    /** 鏄惁榛樿锛圷鏄� N鍚︼級 */
-    @Excel(name = "鏄惁榛樿", readConverterExp = "Y=鏄�,N=鍚�")
-    private String isDefault;
-
-    /** 鐘舵�侊紙0姝e父 1鍋滅敤锛� */
-    @Excel(name = "鐘舵��", readConverterExp = "0=姝e父,1=鍋滅敤")
-    private String status;
-
-    public Long getDictCode()
-    {
-        return dictCode;
-    }
-
-    public void setDictCode(Long dictCode)
-    {
-        this.dictCode = dictCode;
-    }
-
-    public Long getDictSort()
-    {
-        return dictSort;
-    }
-
-    public void setDictSort(Long dictSort)
-    {
-        this.dictSort = dictSort;
-    }
-
+    /**
+     * 瀛楀吀鏍囩
+     */
+    @ExcelProperty(value = "瀛楀吀鏍囩")
     @NotBlank(message = "瀛楀吀鏍囩涓嶈兘涓虹┖")
     @Size(min = 0, max = 100, message = "瀛楀吀鏍囩闀垮害涓嶈兘瓒呰繃100涓瓧绗�")
-    public String getDictLabel()
-    {
-        return dictLabel;
-    }
+    private String dictLabel;
 
-    public void setDictLabel(String dictLabel)
-    {
-        this.dictLabel = dictLabel;
-    }
-
+    /**
+     * 瀛楀吀閿��
+     */
+    @ExcelProperty(value = "瀛楀吀閿��")
     @NotBlank(message = "瀛楀吀閿�间笉鑳戒负绌�")
     @Size(min = 0, max = 100, message = "瀛楀吀閿�奸暱搴︿笉鑳借秴杩�100涓瓧绗�")
-    public String getDictValue()
-    {
-        return dictValue;
-    }
+    private String dictValue;
 
-    public void setDictValue(String dictValue)
-    {
-        this.dictValue = dictValue;
-    }
-
+    /**
+     * 瀛楀吀绫诲瀷
+     */
+    @ExcelProperty(value = "瀛楀吀绫诲瀷")
     @NotBlank(message = "瀛楀吀绫诲瀷涓嶈兘涓虹┖")
     @Size(min = 0, max = 100, message = "瀛楀吀绫诲瀷闀垮害涓嶈兘瓒呰繃100涓瓧绗�")
-    public String getDictType()
-    {
-        return dictType;
-    }
+    private String dictType;
 
-    public void setDictType(String dictType)
-    {
-        this.dictType = dictType;
-    }
-
+    /**
+     * 鏍峰紡灞炴�э紙鍏朵粬鏍峰紡鎵╁睍锛�
+     */
     @Size(min = 0, max = 100, message = "鏍峰紡灞炴�ч暱搴︿笉鑳借秴杩�100涓瓧绗�")
-    public String getCssClass()
-    {
-        return cssClass;
+    private String cssClass;
+
+    /**
+     * 琛ㄦ牸瀛楀吀鏍峰紡
+     */
+    private String listClass;
+
+    /**
+     * 鏄惁榛樿锛圷鏄� N鍚︼級
+     */
+    @ExcelProperty(value = "鏄惁榛樿", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(dictType = "sys_yes_no")
+    private String isDefault;
+
+    /**
+     * 鐘舵�侊紙0姝e父 1鍋滅敤锛�
+     */
+    @ExcelProperty(value = "鐘舵��", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(dictType = "sys_normal_disable")
+    private String status;
+
+    /**
+     * 澶囨敞
+     */
+    private String remark;
+
+    public boolean getDefault() {
+        return UserConstants.YES.equals(this.isDefault);
     }
 
-    public void setCssClass(String cssClass)
-    {
-        this.cssClass = cssClass;
-    }
-
-    public String getListClass()
-    {
-        return listClass;
-    }
-
-    public void setListClass(String listClass)
-    {
-        this.listClass = listClass;
-    }
-
-    public boolean getDefault()
-    {
-        return UserConstants.YES.equals(this.isDefault) ? true : false;
-    }
-
-    public String getIsDefault()
-    {
-        return isDefault;
-    }
-
-    public void setIsDefault(String isDefault)
-    {
-        this.isDefault = isDefault;
-    }
-
-    public String getStatus()
-    {
-        return status;
-    }
-
-    public void setStatus(String status)
-    {
-        this.status = status;
-    }
-    
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("dictCode", getDictCode())
-            .append("dictSort", getDictSort())
-            .append("dictLabel", getDictLabel())
-            .append("dictValue", getDictValue())
-            .append("dictType", getDictType())
-            .append("cssClass", getCssClass())
-            .append("listClass", getListClass())
-            .append("isDefault", getIsDefault())
-            .append("status", getStatus())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .toString();
-    }
 }

--
Gitblit v1.9.3