diff --git a/generator-web/src/main/resources/templates/code-generator/beetlsql/beetlentity.ftl b/generator-web/src/main/resources/templates/code-generator/beetlsql/beetlentity.ftl index de7e760..0bb2fbc 100644 --- a/generator-web/src/main/resources/templates/code-generator/beetlsql/beetlentity.ftl +++ b/generator-web/src/main/resources/templates/code-generator/beetlsql/beetlentity.ftl @@ -10,7 +10,7 @@ import java.util.List; * @date ${.now?string('yyyy-MM-dd')} */ @Data<#if isSwagger?exists && isSwagger==true> -@ApiModel("${classInfo.classComment}") +@Schema"${classInfo.classComment}") public class ${classInfo.className} implements Serializable { private static final long serialVersionUID = 1L; @@ -20,7 +20,7 @@ public class ${classInfo.className} implements Serializable { <#if isComment?exists && isComment==true>/** * ${fieldItem.fieldComment} */<#if isSwagger?exists && isSwagger==true> - @ApiModelProperty("${fieldItem.fieldComment}") + @Schema(description = "${fieldItem.fieldComment}") private ${fieldItem.fieldClass} ${fieldItem.fieldName}; diff --git a/generator-web/src/main/resources/templates/code-generator/common-mapper/tkentity.ftl b/generator-web/src/main/resources/templates/code-generator/common-mapper/tkentity.ftl index 742dcb2..d35cf81 100644 --- a/generator-web/src/main/resources/templates/code-generator/common-mapper/tkentity.ftl +++ b/generator-web/src/main/resources/templates/code-generator/common-mapper/tkentity.ftl @@ -7,8 +7,7 @@ import java.util.List; import java.io.Serializable; import javax.persistence.*; <#if isSwagger?exists && isSwagger==true> -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * @description ${classInfo.classComment} @@ -17,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty; */ <#if isLombok?exists && isLombok==true>@Data <#if isComment?exists && isComment==true>@Table(name="${classInfo.originTableName}")<#if isSwagger?exists && isSwagger==true> -@ApiModel("${classInfo.classComment}") +@Schema"${classInfo.classComment}") public class ${classInfo.className} implements Serializable { private static final long serialVersionUID = 1L; @@ -29,7 +28,7 @@ public class ${classInfo.className} implements Serializable { <#if isComment?exists && isComment==true>/** * ${fieldItem.fieldComment} */<#if isSwagger?exists && isSwagger==true> - @ApiModelProperty("${fieldItem.fieldComment}") + @Schema(description = "${fieldItem.fieldComment}") <#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}") private ${fieldItem.fieldClass} ${fieldItem.fieldName}; diff --git a/generator-web/src/main/resources/templates/code-generator/jpa-starp/starp-entity.ftl b/generator-web/src/main/resources/templates/code-generator/jpa-starp/starp-entity.ftl index 4818345..d2d4865 100644 --- a/generator-web/src/main/resources/templates/code-generator/jpa-starp/starp-entity.ftl +++ b/generator-web/src/main/resources/templates/code-generator/jpa-starp/starp-entity.ftl @@ -11,8 +11,7 @@ import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.GeneratedValue; <#if isSwagger?exists && isSwagger==true> -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * @description ${classInfo.classComment} @@ -24,13 +23,13 @@ import io.swagger.annotations.ApiModelProperty; @AllArgsConstructor <#if isLombok?exists && isLombok==true>@Data <#if isComment?exists && isComment==true>@Table(name="${classInfo.originTableName}")<#if isSwagger?exists && isSwagger==true> -@ApiModel("${classInfo.classComment}") +@Schema"${classInfo.classComment}") public class ${classInfo.className} implements Serializable { private static final long serialVersionUID = 1L; @Id - @ApiModelProperty("id") + @Schema(description = "id") @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @@ -39,7 +38,7 @@ public class ${classInfo.className} implements Serializable { <#if isComment?exists && isComment==true>/** * ${fieldItem.fieldComment} */<#if isSwagger?exists && isSwagger==true> - @ApiModelProperty("${fieldItem.fieldComment}") + @Schema(description = "${fieldItem.fieldComment}") <#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}") private ${fieldItem.fieldClass} ${fieldItem.fieldName}; diff --git a/generator-web/src/main/resources/templates/code-generator/jpa/entity.ftl b/generator-web/src/main/resources/templates/code-generator/jpa/entity.ftl index a045f5d..fb75e37 100644 --- a/generator-web/src/main/resources/templates/code-generator/jpa/entity.ftl +++ b/generator-web/src/main/resources/templates/code-generator/jpa/entity.ftl @@ -11,8 +11,7 @@ import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.GeneratedValue; <#if isSwagger?exists && isSwagger==true> -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * @description ${classInfo.classComment} @@ -22,7 +21,7 @@ import io.swagger.annotations.ApiModelProperty; @Entity <#if isLombok?exists && isLombok==true>@Data <#if isComment?exists && isComment==true>@Table(name="${classInfo.originTableName}")<#if isSwagger?exists && isSwagger==true> -@ApiModel("${classInfo.classComment}") +@Schema"${classInfo.classComment}") public class ${classInfo.className} implements Serializable { private static final long serialVersionUID = 1L; @@ -34,7 +33,7 @@ public class ${classInfo.className} implements Serializable { <#if isComment?exists && isComment==true>/** * ${fieldItem.fieldComment} */<#if isSwagger?exists && isSwagger==true> - @ApiModelProperty("${fieldItem.fieldComment}") + @Schema(description = "${fieldItem.fieldComment}") <#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}") private ${fieldItem.fieldClass} ${fieldItem.fieldName}; diff --git a/generator-web/src/main/resources/templates/code-generator/mybatis-plus/pluscontroller.ftl b/generator-web/src/main/resources/templates/code-generator/mybatis-plus/pluscontroller.ftl index f18e442..903b82b 100644 --- a/generator-web/src/main/resources/templates/code-generator/mybatis-plus/pluscontroller.ftl +++ b/generator-web/src/main/resources/templates/code-generator/mybatis-plus/pluscontroller.ftl @@ -12,7 +12,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.web.servlet.ModelAndView; - +<#if isSwagger?exists && isSwagger==true>import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import java.util.Date; import java.util.List; import java.util.Map; @@ -25,6 +26,7 @@ import java.util.Map; @Slf4j @RestController @RequestMapping("/${classInfo.className?uncap_first}") +<#if isSwagger?exists && isSwagger==true>@Tag(name = "${classInfo.className}",description = "${classInfo.classComment}控制器") public class ${classInfo.className}Controller { @Autowired diff --git a/generator-web/src/main/resources/templates/code-generator/mybatis-plus/plusentity.ftl b/generator-web/src/main/resources/templates/code-generator/mybatis-plus/plusentity.ftl index 52134ed..f129a29 100644 --- a/generator-web/src/main/resources/templates/code-generator/mybatis-plus/plusentity.ftl +++ b/generator-web/src/main/resources/templates/code-generator/mybatis-plus/plusentity.ftl @@ -8,8 +8,7 @@ import java.io.Serializable; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; <#if isSwagger?exists && isSwagger==true> -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * @description ${classInfo.classComment} @@ -17,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty; * @date ${.now?string('yyyy-MM-dd')} */ <#if isLombok?exists && isLombok==true>@Data<#if isSwagger?exists && isSwagger==true> -@ApiModel("${classInfo.classComment}") +@Schema"${classInfo.classComment}") public class ${classInfo.className} implements Serializable { private static final long serialVersionUID = 1L; @@ -28,7 +27,7 @@ public class ${classInfo.className} implements Serializable { <#if isComment?exists && isComment==true>/** * ${fieldItem.fieldComment} */<#if isSwagger?exists && isSwagger==true> - @ApiModelProperty("${fieldItem.fieldComment}") + @Schema(description = "${fieldItem.fieldComment}") private ${fieldItem.fieldClass} ${fieldItem.fieldName}; <#if isLombok?exists && isLombok==false> diff --git a/generator-web/src/main/resources/templates/code-generator/tk-mybatis/tk-entity.ftl b/generator-web/src/main/resources/templates/code-generator/tk-mybatis/tk-entity.ftl index 41c6930..262c0d4 100644 --- a/generator-web/src/main/resources/templates/code-generator/tk-mybatis/tk-entity.ftl +++ b/generator-web/src/main/resources/templates/code-generator/tk-mybatis/tk-entity.ftl @@ -7,8 +7,7 @@ import java.util.List; import java.io.Serializable; import io.mybatis.provider.Entity; <#if isSwagger?exists && isSwagger==true> -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * @description ${classInfo.classComment} @@ -17,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty; */ <#if isLombok?exists && isLombok==true>@Data <#if isComment?exists && isComment==true>@Entity.Table("${classInfo.originTableName}")<#if isSwagger?exists && isSwagger==true> -@ApiModel("${classInfo.classComment}") +@Schema"${classInfo.classComment}") public class ${classInfo.className} implements Serializable { private static final long serialVersionUID = 1L; @@ -28,7 +27,7 @@ public class ${classInfo.className} implements Serializable { <#if isComment?exists && isComment==true>/** * ${fieldItem.fieldComment} */<#if isSwagger?exists && isSwagger==true> - @ApiModelProperty("${fieldItem.fieldComment}") + @Schema(description = "${fieldItem.fieldComment}") <#if isComment?exists && isComment==true>@Entity.Column("${fieldItem.columnName}") private ${fieldItem.fieldClass} ${fieldItem.fieldName};