mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 22:57:17 +08:00 
			
		
		
		
	refactor(generator): 为枚举类型的字段添加自定义 Excel 转换器
This commit is contained in:
		| @@ -8,6 +8,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
|  | ||||
| import top.continew.admin.common.model.resp.BaseDetailResp; | ||||
| import top.continew.starter.file.excel.converter.ExcelBaseEnumConverter; | ||||
| <#if imports??> | ||||
|     <#list imports as className> | ||||
| import ${className}; | ||||
| @@ -41,7 +42,11 @@ public class ${className} extends BaseDetailResp { | ||||
|      * ${fieldConfig.comment} | ||||
|      */ | ||||
|     @Schema(description = "${fieldConfig.comment}") | ||||
|     <#if fieldConfig.fieldType?ends_with("Enum")> | ||||
|     @ExcelProperty(value = "${fieldConfig.comment}", converter = ExcelBaseEnumConverter.class) | ||||
|     <#else> | ||||
|     @ExcelProperty(value = "${fieldConfig.comment}") | ||||
|     </#if> | ||||
|     private ${fieldConfig.fieldType} ${fieldConfig.fieldName}; | ||||
|   </#list> | ||||
| </#if> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Pluto
					Pluto