mirror of https://gitee.com/y_project/RuoYi.git
代码生成器增强-新增Swagger注解
parent
6c89c9896a
commit
2d9526cdfc
|
@ -23,6 +23,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
#end
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* ${functionName}Controller
|
||||
|
@ -30,6 +32,7 @@ import com.ruoyi.common.core.domain.Ztree;
|
|||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
@Api("${functionName}")
|
||||
@Controller
|
||||
@RequestMapping("/${moduleName}/${businessName}")
|
||||
public class ${ClassName}Controller extends BaseController
|
||||
|
@ -50,6 +53,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
/**
|
||||
* 查询${functionName}列表
|
||||
*/
|
||||
@ApiOperation("查询${functionName}列表")
|
||||
@RequiresPermissions("${permissionPrefix}:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
|
@ -63,6 +67,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
/**
|
||||
* 查询${functionName}树列表
|
||||
*/
|
||||
@ApiOperation("查询${functionName}树列表")
|
||||
@RequiresPermissions("${permissionPrefix}:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
|
@ -76,6 +81,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
/**
|
||||
* 导出${functionName}列表
|
||||
*/
|
||||
@ApiOperation("导出${functionName}列表")
|
||||
@RequiresPermissions("${permissionPrefix}:export")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
|
@ -114,6 +120,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
/**
|
||||
* 新增保存${functionName}
|
||||
*/
|
||||
@ApiOperation("新增保存${functionName}")
|
||||
@RequiresPermissions("${permissionPrefix}:add")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
|
@ -138,6 +145,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
/**
|
||||
* 修改保存${functionName}
|
||||
*/
|
||||
@ApiOperation("修改保存${functionName}")
|
||||
@RequiresPermissions("${permissionPrefix}:edit")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
|
@ -151,6 +159,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
/**
|
||||
* 删除${functionName}
|
||||
*/
|
||||
@ApiOperation("删除${functionName}")
|
||||
@RequiresPermissions("${permissionPrefix}:remove")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
|
@ -161,8 +170,9 @@ public class ${ClassName}Controller extends BaseController
|
|||
}
|
||||
#elseif($table.tree)
|
||||
/**
|
||||
* 删除
|
||||
* 删除${functionName}树
|
||||
*/
|
||||
@ApiOperation("删除${functionName}树")
|
||||
@RequiresPermissions("${permissionPrefix}:remove")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||
@GetMapping("/remove/{${pkColumn.javaField}}")
|
||||
|
@ -191,6 +201,7 @@ public class ${ClassName}Controller extends BaseController
|
|||
/**
|
||||
* 加载${functionName}树列表
|
||||
*/
|
||||
@ApiOperation("加载${functionName}树列表")
|
||||
@GetMapping("/treeData")
|
||||
@ResponseBody
|
||||
public List<Ztree> treeData()
|
||||
|
|
|
@ -11,6 +11,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
#elseif($table.tree)
|
||||
import com.ruoyi.common.core.domain.TreeEntity;
|
||||
#end
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* ${functionName}对象 ${tableName}
|
||||
|
@ -23,6 +25,7 @@ import com.ruoyi.common.core.domain.TreeEntity;
|
|||
#elseif($table.tree)
|
||||
#set($Entity="TreeEntity")
|
||||
#end
|
||||
@ApiModel(value = "${ClassName}Entity", description = "${functionName} 实体")
|
||||
public class ${ClassName} extends ${Entity}
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -37,6 +40,8 @@ public class ${ClassName} extends ${Entity}
|
|||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
|
||||
@ApiModelProperty("$comment")
|
||||
#if($parentheseIndex != -1)
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
#elseif($column.javaType == 'Date')
|
||||
|
|
Loading…
Reference in New Issue