Commit 1737714a22345012ed012e7ce0efc41dd2033223
1 parent
5d98ccdf
修复敏感词的 Swagger 注解错误,导致 Knife4j 无法使用
Showing
4 changed files
with
10 additions
and
5 deletions
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordExcelVO.java
| 1 | package cn.iocoder.yudao.module.system.controller.admin.sensitiveword.vo; | 1 | package cn.iocoder.yudao.module.system.controller.admin.sensitiveword.vo; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||
| 4 | +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||
| 5 | +import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||
| 3 | import com.alibaba.excel.annotation.ExcelProperty; | 6 | import com.alibaba.excel.annotation.ExcelProperty; |
| 4 | import lombok.Data; | 7 | import lombok.Data; |
| 5 | 8 | ||
| @@ -23,7 +26,8 @@ public class SensitiveWordExcelVO { | @@ -23,7 +26,8 @@ public class SensitiveWordExcelVO { | ||
| 23 | @ExcelProperty("标签") | 26 | @ExcelProperty("标签") |
| 24 | private List<String> tags; | 27 | private List<String> tags; |
| 25 | 28 | ||
| 26 | - @ExcelProperty("状态,true-启用,false-禁用") | 29 | + @ExcelProperty(value = "状态", converter = DictConvert.class) |
| 30 | + @DictFormat(DictTypeConstants.COMMON_STATUS) | ||
| 27 | private Integer status; | 31 | private Integer status; |
| 28 | 32 | ||
| 29 | @ExcelProperty("描述") | 33 | @ExcelProperty("描述") |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordExportReqVO.java
| @@ -19,7 +19,7 @@ public class SensitiveWordExportReqVO { | @@ -19,7 +19,7 @@ public class SensitiveWordExportReqVO { | ||
| 19 | @ApiModelProperty(value = "标签", example = "短信,评论") | 19 | @ApiModelProperty(value = "标签", example = "短信,评论") |
| 20 | private String tag; | 20 | private String tag; |
| 21 | 21 | ||
| 22 | - @ApiModelProperty(value = "状态", example = "true-启用,false-禁用") | 22 | + @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") |
| 23 | private Integer status; | 23 | private Integer status; |
| 24 | 24 | ||
| 25 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 25 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordPageReqVO.java
| @@ -24,7 +24,7 @@ public class SensitiveWordPageReqVO extends PageParam { | @@ -24,7 +24,7 @@ public class SensitiveWordPageReqVO extends PageParam { | ||
| 24 | @ApiModelProperty(value = "标签", example = "短信,评论") | 24 | @ApiModelProperty(value = "标签", example = "短信,评论") |
| 25 | private String tag; | 25 | private String tag; |
| 26 | 26 | ||
| 27 | - @ApiModelProperty(value = "状态", example = "true-启用,true-禁用") | 27 | + @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") |
| 28 | private Integer status; | 28 | private Integer status; |
| 29 | 29 | ||
| 30 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 30 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantExcelVO.java
| 1 | package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant; | 1 | package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | ||
| 3 | import lombok.*; | 4 | import lombok.*; |
| 4 | import java.util.*; | 5 | import java.util.*; |
| 5 | 6 | ||
| @@ -28,8 +29,8 @@ public class TenantExcelVO { | @@ -28,8 +29,8 @@ public class TenantExcelVO { | ||
| 28 | @ExcelProperty("联系手机") | 29 | @ExcelProperty("联系手机") |
| 29 | private String contactMobile; | 30 | private String contactMobile; |
| 30 | 31 | ||
| 31 | - @ExcelProperty(value = "租户状态(0正常 1停用)", converter = DictConvert.class) | ||
| 32 | - @DictFormat("sys_common_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 | 32 | + @ExcelProperty(value = "状态", converter = DictConvert.class) |
| 33 | + @DictFormat(DictTypeConstants.COMMON_STATUS) | ||
| 33 | private Integer status; | 34 | private Integer status; |
| 34 | 35 | ||
| 35 | @ExcelProperty("创建时间") | 36 | @ExcelProperty("创建时间") |