fix():代码生成器接口文档生成
parent
cc8c8c9f80
commit
f1ebbc28e4
|
@ -152,6 +152,12 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||
<version>2.2.28</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.common.core.web.page;
|
||||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -21,26 +22,31 @@ public class PageReq {
|
|||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
@Schema(title = "pageNum", name = "当前页", description = "当前记录起始索引", defaultValue = "1")
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
@Schema(title = "pageSize", name = "分页条数", description = "每页显示记录数", defaultValue = "10")
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
@Schema(title = "orderByColumn", name = "排序列", description = "列表查询排序列")
|
||||
private String orderByColumn;
|
||||
|
||||
/**
|
||||
* 排序的方向desc或者asc
|
||||
*/
|
||||
@Schema(title = "isAsc", name = "排序方向", description = "排序的方向desc或者asc", defaultValue = "asc")
|
||||
private String isAsc = "asc";
|
||||
|
||||
/**
|
||||
* 分页参数合理化
|
||||
*/
|
||||
@Schema(title = "reasonable", name = "合理分页参数", description = "分页参数合理化")
|
||||
private Boolean reasonable = true;
|
||||
|
||||
public String getOrderBy () {
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.muyu.common.core.web.domain.TreeEntity;
|
|||
#end
|
||||
|
||||
/**
|
||||
* ${functionName}对象 ${tableName}
|
||||
* ${functionName}数据库映射对象 ${tableName}
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
|
@ -40,16 +40,17 @@ import com.muyu.common.core.web.domain.TreeEntity;
|
|||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("${tableName}")
|
||||
@TableName("${tableName}对数据库映射对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "${functionName}")
|
||||
public class ${ClassName} extends ${Entity} {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if(!$table.isSuperColumn($column.javaField))
|
||||
/** $column.columnComment */
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
#if($column.list)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
|
@ -73,12 +74,10 @@ public class ${ClassName} extends ${Entity} {
|
|||
#if($column.isRequired == '1')
|
||||
#set($comment=', required = true')
|
||||
#end
|
||||
@Schema(name = "${column.columnComment}")
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
#end
|
||||
#end
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* ${functionName}对象 ${tableName}
|
||||
* ${functionName}修改请求对象
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
|
@ -26,13 +26,15 @@ import lombok.experimental.SuperBuilder;
|
|||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "${functionName}")
|
||||
@Schema(description = "${functionName}修改请求对象")
|
||||
public class ${ClassName}EditReq {
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if(!$table.isSuperColumn($column.javaField))
|
||||
#if($column.isEdit == '1')
|
||||
/** $column.columnComment */
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
#if($column.list)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
|
@ -48,7 +50,7 @@ public class ${ClassName}EditReq {
|
|||
#if($column.isRequired == '1')
|
||||
#set($isRequired=', required = true')
|
||||
#end
|
||||
@Schema(name = "${column.columnComment}" $isRequired)
|
||||
@Schema(name = "${column.javaField}", title = "${column.columnComment}", description = "${column.columnComment}" $isRequired)
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
#end
|
||||
|
|
|
@ -15,7 +15,7 @@ import lombok.experimental.SuperBuilder;
|
|||
import ${packageName}.domain.model.${ClassName}QueryModel;
|
||||
|
||||
/**
|
||||
* ${functionName}对象 ${tableName}
|
||||
* ${functionName}查询请求对象
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
|
@ -29,14 +29,16 @@ import ${packageName}.domain.model.${ClassName}QueryModel;
|
|||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "${functionName}")
|
||||
@Schema(description = "${functionName}查询请求对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ${ClassName}QueryReq extends PageReq {
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if(!$table.isSuperColumn($column.javaField))
|
||||
#if($column.isQuery == '1')
|
||||
/** $column.columnComment */
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
#if($column.list)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
|
@ -51,7 +53,7 @@ public class ${ClassName}QueryReq extends PageReq {
|
|||
#if($column.javaField == $pkColumn.javaField)
|
||||
@TableId(value = "${pkColumn.javaField}",type = IdType.AUTO)
|
||||
#end
|
||||
@Schema(name = "${column.columnComment}")
|
||||
@Schema(name = "${column.javaField}", title = "${column.columnComment}", description = "${column.columnComment}")
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
#end
|
||||
|
|
|
@ -5,7 +5,6 @@ import ${import};
|
|||
#end
|
||||
import com.muyu.common.core.web.model.QueryModel;
|
||||
import com.muyu.system.domain.req.StudentInfoQueryReq;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -13,7 +12,7 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* ${functionName}对象 ${tableName}
|
||||
* ${functionName}查询请求模型对象
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
|
@ -27,14 +26,15 @@ import lombok.experimental.SuperBuilder;
|
|||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "${functionName}")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ${ClassName}QueryModel extends QueryModel<${ClassName}QueryModel> {
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if(!$table.isSuperColumn($column.javaField))
|
||||
#if($column.isQuery == '1')
|
||||
/** $column.columnComment */
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
#if($column.list)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
|
@ -43,7 +43,6 @@ public class ${ClassName}QueryModel extends QueryModel<${ClassName}QueryModel> {
|
|||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#end
|
||||
@Schema(name = "${column.columnComment}")
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
#end
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* ${functionName}对象 ${tableName}
|
||||
* ${functionName}保存请求对象
|
||||
*
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
|
@ -26,14 +26,16 @@ import lombok.experimental.SuperBuilder;
|
|||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "${functionName}")
|
||||
@Schema(description = "${functionName}保存请求对象")
|
||||
public class ${ClassName}SaveReq{
|
||||
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if(!$table.isSuperColumn($column.javaField))
|
||||
#if($column.isInsert == '1')
|
||||
/** $column.columnComment */
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
#if($column.list)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
|
@ -50,7 +52,7 @@ public class ${ClassName}SaveReq{
|
|||
#if($column.isRequired == '1')
|
||||
#set($isRequired=', required = true')
|
||||
#end
|
||||
@Schema(name = "${column.columnComment}" $isRequired)
|
||||
@Schema(name = "${column.javaField}", title = "${column.columnComment}", description = "${column.columnComment}" $isRequired)
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
#end
|
||||
|
|
Loading…
Reference in New Issue