mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
add 整合 springdoc-openapi-javadoc 基于代码注释生成文档
This commit is contained in:
@ -12,7 +12,6 @@ import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.generator.domain.GenTable;
|
||||
import com.ruoyi.generator.domain.GenTableColumn;
|
||||
import com.ruoyi.generator.service.IGenTableService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -41,7 +40,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 查询代码生成列表
|
||||
*/
|
||||
@Operation(summary = "查询代码生成列表")
|
||||
@SaCheckPermission("tool:gen:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GenTable> genList(GenTable genTable, PageQuery pageQuery) {
|
||||
@ -51,7 +49,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 修改代码生成业务
|
||||
*/
|
||||
@Operation(summary = "修改代码生成业务")
|
||||
@SaCheckPermission("tool:gen:query")
|
||||
@GetMapping(value = "/{tableId}")
|
||||
public R<Map<String, Object>> getInfo(@PathVariable Long tableId) {
|
||||
@ -68,7 +65,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 查询数据库列表
|
||||
*/
|
||||
@Operation(summary = "查询数据库列表")
|
||||
@SaCheckPermission("tool:gen:list")
|
||||
@GetMapping("/db/list")
|
||||
public TableDataInfo<GenTable> dataList(GenTable genTable, PageQuery pageQuery) {
|
||||
@ -78,7 +74,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 查询数据表字段列表
|
||||
*/
|
||||
@Operation(summary = "查询数据表字段列表")
|
||||
@SaCheckPermission("tool:gen:list")
|
||||
@GetMapping(value = "/column/{tableId}")
|
||||
public TableDataInfo<GenTableColumn> columnList(Long tableId) {
|
||||
@ -92,7 +87,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 导入表结构(保存)
|
||||
*/
|
||||
@Operation(summary = "导入表结构(保存)")
|
||||
@SaCheckPermission("tool:gen:import")
|
||||
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importTable")
|
||||
@ -107,7 +101,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 修改保存代码生成业务
|
||||
*/
|
||||
@Operation(summary = "修改保存代码生成业务")
|
||||
@SaCheckPermission("tool:gen:edit")
|
||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ -120,7 +113,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 删除代码生成
|
||||
*/
|
||||
@Operation(summary = "删除代码生成")
|
||||
@SaCheckPermission("tool:gen:remove")
|
||||
@Log(title = "代码生成", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{tableIds}")
|
||||
@ -132,7 +124,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 预览代码
|
||||
*/
|
||||
@Operation(summary = "预览代码")
|
||||
@SaCheckPermission("tool:gen:preview")
|
||||
@GetMapping("/preview/{tableId}")
|
||||
public R<Map<String, String>> preview(@PathVariable("tableId") Long tableId) throws IOException {
|
||||
@ -143,7 +134,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 生成代码(下载方式)
|
||||
*/
|
||||
@Operation(summary = "生成代码(下载方式)")
|
||||
@SaCheckPermission("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/download/{tableName}")
|
||||
@ -155,7 +145,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 生成代码(自定义路径)
|
||||
*/
|
||||
@Operation(summary = "生成代码(自定义路径)")
|
||||
@SaCheckPermission("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/genCode/{tableName}")
|
||||
@ -167,7 +156,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 同步数据库
|
||||
*/
|
||||
@Operation(summary = "同步数据库")
|
||||
@SaCheckPermission("tool:gen:edit")
|
||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/synchDb/{tableName}")
|
||||
@ -179,7 +167,6 @@ public class GenController extends BaseController {
|
||||
/**
|
||||
* 批量生成代码
|
||||
*/
|
||||
@Operation(summary = "批量生成代码")
|
||||
@SaCheckPermission("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/batchGenCode")
|
||||
|
@ -33,7 +33,6 @@ import com.ruoyi.common.core.domain.TreeEntity;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(name = "${functionName}业务对象")
|
||||
public class ${ClassName}Bo extends ${Entity} {
|
||||
|
||||
#foreach ($column in $columns)
|
||||
@ -49,14 +48,12 @@ public class ${ClassName}Bo extends ${Entity} {
|
||||
#set($Group="EditGroup.class")
|
||||
#end
|
||||
#if($column.isRequired == 1)
|
||||
@Schema(name = "$column.columnComment", required = true)
|
||||
#if($column.javaType == 'String')
|
||||
@NotBlank(message = "$column.columnComment不能为空", groups = { $Group })
|
||||
#else
|
||||
@NotNull(message = "$column.columnComment不能为空", groups = { $Group })
|
||||
#end
|
||||
#else
|
||||
@Schema(name = "$column.columnComment")
|
||||
#end
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
|
@ -27,7 +27,6 @@ import ${packageName}.service.I${ClassName}Service;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
#elseif($table.tree)
|
||||
#end
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
/**
|
||||
@ -48,7 +47,6 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 查询${functionName}列表
|
||||
*/
|
||||
@Operation(summary = "查询${functionName}列表")
|
||||
@SaCheckPermission("${permissionPrefix}:list")
|
||||
@GetMapping("/list")
|
||||
#if($table.crud || $table.sub)
|
||||
@ -65,7 +63,6 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 导出${functionName}列表
|
||||
*/
|
||||
@Operation(summary = "导出${functionName}列表")
|
||||
@SaCheckPermission("${permissionPrefix}:export")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ -77,7 +74,6 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 获取${functionName}详细信息
|
||||
*/
|
||||
@Operation(summary = "获取${functionName}详细信息")
|
||||
@SaCheckPermission("${permissionPrefix}:query")
|
||||
@GetMapping("/{${pkColumn.javaField}}")
|
||||
public R<${ClassName}Vo> getInfo(@Parameter(name = "主键")
|
||||
@ -89,7 +85,6 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 新增${functionName}
|
||||
*/
|
||||
@Operation(summary = "新增${functionName}")
|
||||
@SaCheckPermission("${permissionPrefix}:add")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@ -101,7 +96,6 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 修改${functionName}
|
||||
*/
|
||||
@Operation(summary = "修改${functionName}")
|
||||
@SaCheckPermission("${permissionPrefix}:edit")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@ -113,7 +107,6 @@ public class ${ClassName}Controller extends BaseController {
|
||||
/**
|
||||
* 删除${functionName}
|
||||
*/
|
||||
@Operation(summary = "删除${functionName}")
|
||||
@SaCheckPermission("${permissionPrefix}:remove")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{${pkColumn.javaField}s}")
|
||||
|
@ -21,7 +21,6 @@ import java.util.Date;
|
||||
* @date ${datetime}
|
||||
*/
|
||||
@Data
|
||||
@Schema(name = "${functionName}视图对象")
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ${ClassName}Vo {
|
||||
|
||||
@ -47,7 +46,6 @@ public class ${ClassName}Vo {
|
||||
#else
|
||||
@ExcelProperty(value = "${comment}")
|
||||
#end
|
||||
@Schema(name = "$column.columnComment")
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
#end
|
||||
|
Reference in New Issue
Block a user