Pre Merge pull request !387 from zszdevelop/master

This commit is contained in:
zszdevelop 2022-01-18 03:31:10 +00:00 committed by Gitee
commit 5d7c1b6f57
5 changed files with 27 additions and 31 deletions

View File

@ -24,18 +24,6 @@
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>

View File

@ -125,6 +125,19 @@
<artifactId>javax.servlet-api</artifactId>
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
</project>

View File

@ -19,6 +19,8 @@ import com.ruoyi.common.enums.BusinessType;
import ${packageName}.domain.${ClassName};
import ${packageName}.service.I${ClassName}Service;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
#if($table.crud || $table.sub)
import com.ruoyi.common.core.page.TableDataInfo;
#elseif($table.tree)
@ -31,15 +33,14 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date ${datetime}
*/
@RestController
@Api(tags = {"${functionName}"})
@RequestMapping("/${moduleName}/${businessName}")
public class ${ClassName}Controller extends BaseController
{
@Autowired
private I${ClassName}Service ${className}Service;
/**
* 查询${functionName}列表
*/
@ApiOperation(value = "查询${functionName}列表")
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
@GetMapping("/list")
#if($table.crud || $table.sub)
@ -57,9 +58,7 @@ public class ${ClassName}Controller extends BaseController
}
#end
/**
* 导出${functionName}列表
*/
@ApiOperation(value = "导出${functionName}列表")
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ -70,9 +69,7 @@ public class ${ClassName}Controller extends BaseController
util.exportExcel(response, list, "${functionName}数据");
}
/**
* 获取${functionName}详细信息
*/
@ApiOperation(value = "获取${functionName}详细信息")
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')")
@GetMapping(value = "/{${pkColumn.javaField}}")
public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
@ -80,9 +77,7 @@ public class ${ClassName}Controller extends BaseController
return AjaxResult.success(${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}));
}
/**
* 新增${functionName}
*/
@ApiOperation(value = "新增${functionName}")
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')")
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
@PostMapping
@ -91,9 +86,7 @@ public class ${ClassName}Controller extends BaseController
return toAjax(${className}Service.insert${ClassName}(${className}));
}
/**
* 修改${functionName}
*/
@ApiOperation(value = "修改${functionName}")
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')")
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
@PutMapping
@ -102,9 +95,7 @@ public class ${ClassName}Controller extends BaseController
return toAjax(${className}Service.update${ClassName}(${className}));
}
/**
* 删除${functionName}
*/
@ApiOperation(value = "删除${functionName}")
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')")
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
@DeleteMapping("/{${pkColumn.javaField}s}")

View File

@ -6,6 +6,8 @@ import ${import};
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
#if($table.crud || $table.sub)
import com.ruoyi.common.core.domain.BaseEntity;
#elseif($table.tree)
@ -23,6 +25,7 @@ import com.ruoyi.common.core.domain.TreeEntity;
#elseif($table.tree)
#set($Entity="TreeEntity")
#end
@ApiModel("${functionName}")
public class ${ClassName} extends ${Entity}
{
private static final long serialVersionUID = 1L;
@ -46,6 +49,7 @@ public class ${ClassName} extends ${Entity}
@Excel(name = "${comment}")
#end
#end
@ApiModelProperty(value = "${column.columnComment}")
private $column.javaType $column.javaField;
#end

View File

@ -182,7 +182,7 @@
/>
<!-- 添加或修改${functionName}对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="500px" :close-on-click-modal="false" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
#foreach($column in $columns)
#set($field=$column.javaField)