From 815ae1db9d6d178e230ce9826315019666035920 Mon Sep 17 00:00:00 2001 From: hxr <1490493387@qq.com> Date: Fri, 19 Apr 2024 08:03:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BB=A3=E7=A0=81=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/converter.java.vm | 6 ++++++ .../src/main/resources/templates/dto.java.vm | 19 +------------------ .../main/resources/templates/entity.java.vm | 2 +- .../src/main/resources/templates/form.java.vm | 19 +------------------ .../main/resources/templates/mapper.xml.vm | 8 +++----- .../main/resources/templates/pageVo.java.vm | 19 +------------------ .../src/main/resources/templates/vo.java.vm | 19 +------------------ 7 files changed, 14 insertions(+), 78 deletions(-) diff --git a/youlai-common/common-web/src/main/resources/templates/converter.java.vm b/youlai-common/common-web/src/main/resources/templates/converter.java.vm index 81f73f7a7..25c01d05a 100644 --- a/youlai-common/common-web/src/main/resources/templates/converter.java.vm +++ b/youlai-common/common-web/src/main/resources/templates/converter.java.vm @@ -10,6 +10,12 @@ import ${package.Parent}.model.vo.${entity}PageVO; import ${package.Parent}.model.form.${entity}Form; import ${package.Parent}.model.bo.${entity}BO; +/** + * $!{table.comment}转换器 + * + * @author ${author} + * @since ${date} + */ @Mapper(componentModel = "spring") public interface ${entity}Converter{ diff --git a/youlai-common/common-web/src/main/resources/templates/dto.java.vm b/youlai-common/common-web/src/main/resources/templates/dto.java.vm index e4642accc..2cf3c0412 100644 --- a/youlai-common/common-web/src/main/resources/templates/dto.java.vm +++ b/youlai-common/common-web/src/main/resources/templates/dto.java.vm @@ -1,12 +1,7 @@ package ${package.Parent}.model.dto; -#if(${springdoc}) import io.swagger.v3.oas.annotations.media.Schema; -#elseif(${swagger}) -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -#end #if(${entityLombokModel}) import lombok.Getter; import lombok.Setter; @@ -29,11 +24,7 @@ import java.time.LocalDateTime; @Accessors(chain = true) #end #end -#if(${springdoc}) -@Schema(name = "${entity}", description = "$!{table.comment}") -#elseif(${swagger}) -@ApiModel(value = "${entity}对象", description = "$!{table.comment}") -#end +@Schema( description = "$!{table.comment}传输层对象") #if(${superEntityClass}) public class ${entity}DTO extends ${superEntityClass}#if(${activeRecord})<${entity}>#end { #elseif(${activeRecord}) @@ -54,15 +45,7 @@ public class ${entity}DTO { #set($keyPropertyName=${field.propertyName}) #end #if("$!field.comment" != "") - #if(${springdoc}) @Schema(description = "${field.comment}") - #elseif(${swagger}) - @ApiModelProperty("${field.comment}") - #else - /** - * ${field.comment} - */ - #end #end private ${field.propertyType} ${field.propertyName}; diff --git a/youlai-common/common-web/src/main/resources/templates/entity.java.vm b/youlai-common/common-web/src/main/resources/templates/entity.java.vm index 8e43efb94..4c2e2b571 100644 --- a/youlai-common/common-web/src/main/resources/templates/entity.java.vm +++ b/youlai-common/common-web/src/main/resources/templates/entity.java.vm @@ -12,7 +12,7 @@ import lombok.experimental.Accessors; #end /** - * $!{table.comment} + * $!{table.comment}实体 * * @author ${author} * @since ${date} diff --git a/youlai-common/common-web/src/main/resources/templates/form.java.vm b/youlai-common/common-web/src/main/resources/templates/form.java.vm index 2ce28c2e7..d1a9b2ec9 100644 --- a/youlai-common/common-web/src/main/resources/templates/form.java.vm +++ b/youlai-common/common-web/src/main/resources/templates/form.java.vm @@ -3,12 +3,7 @@ package ${package.Parent}.model.form; #foreach($pkg in ${table.importPackages}) import ${pkg}; #end -#if(${springdoc}) import io.swagger.v3.oas.annotations.media.Schema; -#elseif(${swagger}) -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -#end #if(${entityLombokModel}) import lombok.Getter; import lombok.Setter; @@ -30,11 +25,7 @@ import lombok.Setter; @Accessors(chain = true) #end #end -#if(${springdoc}) -@Schema(name = "${entity}", description = "$!{table.comment}") -#elseif(${swagger}) -@ApiModel(value = "${entity}对象", description = "$!{table.comment}") -#end +@Schema(description = "$!{table.comment}表单对象") #if(${superEntityClass}) public class ${entity}Form extends ${superEntityClass}#if(${activeRecord})<${entity}>#end { #elseif(${activeRecord}) @@ -55,15 +46,7 @@ public class ${entity}Form { #set($keyPropertyName=${field.propertyName}) #end #if("$!field.comment" != "") - #if(${springdoc}) @Schema(description = "${field.comment}") - #elseif(${swagger}) - @ApiModelProperty("${field.comment}") - #else - /** - * ${field.comment} - */ - #end #end private ${field.propertyType} ${field.propertyName}; diff --git a/youlai-common/common-web/src/main/resources/templates/mapper.xml.vm b/youlai-common/common-web/src/main/resources/templates/mapper.xml.vm index 41a01c19d..c1e3ebd2e 100644 --- a/youlai-common/common-web/src/main/resources/templates/mapper.xml.vm +++ b/youlai-common/common-web/src/main/resources/templates/mapper.xml.vm @@ -40,19 +40,16 @@ diff --git a/youlai-common/common-web/src/main/resources/templates/pageVo.java.vm b/youlai-common/common-web/src/main/resources/templates/pageVo.java.vm index 678a433ff..582fac4f0 100644 --- a/youlai-common/common-web/src/main/resources/templates/pageVo.java.vm +++ b/youlai-common/common-web/src/main/resources/templates/pageVo.java.vm @@ -3,12 +3,7 @@ package ${package.Parent}.model.vo; #foreach($pkg in ${table.importPackages}) import ${pkg}; #end -#if(${springdoc}) import io.swagger.v3.oas.annotations.media.Schema; -#elseif(${swagger}) -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -#end #if(${entityLombokModel}) import lombok.Getter; import lombok.Setter; @@ -30,11 +25,7 @@ import lombok.Setter; @Accessors(chain = true) #end #end -#if(${springdoc}) -@Schema(name = "${entity}", description = "$!{table.comment}") -#elseif(${swagger}) -@ApiModel(value = "${entity}分页视图对象", description = "$!{table.comment}") -#end +@Schema( description = "$!{table.comment}分页视图对象") #if(${superEntityClass}) public class ${entity}PageVO extends ${superEntityClass}#if(${activeRecord})<${entity}>#end { #elseif(${activeRecord}) @@ -55,15 +46,7 @@ public class ${entity}PageVO { #set($keyPropertyName=${field.propertyName}) #end #if("$!field.comment" != "") - #if(${springdoc}) @Schema(description = "${field.comment}") - #elseif(${swagger}) - @ApiModelProperty("${field.comment}") - #else - /** - * ${field.comment} - */ - #end #end private ${field.propertyType} ${field.propertyName}; diff --git a/youlai-common/common-web/src/main/resources/templates/vo.java.vm b/youlai-common/common-web/src/main/resources/templates/vo.java.vm index ee1d71560..1adb88777 100644 --- a/youlai-common/common-web/src/main/resources/templates/vo.java.vm +++ b/youlai-common/common-web/src/main/resources/templates/vo.java.vm @@ -2,12 +2,7 @@ package ${package.Parent}.model.vo; import java.io.Serializable; import java.time.LocalDateTime; -#if(${springdoc}) import io.swagger.v3.oas.annotations.media.Schema; -#elseif(${swagger}) -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -#end #if(${entityLombokModel}) import lombok.Getter; import lombok.Setter; @@ -29,11 +24,7 @@ import lombok.Setter; @Accessors(chain = true) #end #end -#if(${springdoc}) -@Schema(name = "${entity}", description = "$!{table.comment}") -#elseif(${swagger}) -@ApiModel(value = "${entity}视图对象", description = "$!{table.comment}") -#end +@Schema( description = "$!{table.comment}视图对象") #if(${superEntityClass}) public class ${entity}VO extends ${superEntityClass}#if(${activeRecord})<${entity}>#end { #elseif(${activeRecord}) @@ -54,15 +45,7 @@ public class ${entity}VO { #set($keyPropertyName=${field.propertyName}) #end #if("$!field.comment" != "") - #if(${springdoc}) @Schema(description = "${field.comment}") - #elseif(${swagger}) - @ApiModelProperty("${field.comment}") - #else - /** - * ${field.comment} - */ - #end #end private ${field.propertyType} ${field.propertyName};