|
@@ -16,6 +16,10 @@ import com.game.common.annotation.Log;
|
|
|
import com.game.common.core.controller.BaseController;
|
|
|
import com.game.common.core.domain.AjaxResult;
|
|
|
import com.game.common.enums.BusinessType;
|
|
|
+import com.game.common.annotation.DataSource;
|
|
|
+import com.game.common.enums.DataSourceType;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import ${packageName}.domain.${ClassName};
|
|
|
import ${packageName}.service.I${ClassName}Service;
|
|
|
import com.game.common.utils.poi.ExcelUtil;
|
|
@@ -32,6 +36,8 @@ import com.game.common.core.page.TableDataInfo;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/${moduleName}/${businessName}")
|
|
|
+@DataSource(DataSourceType.SLAVE)
|
|
|
+@Api(value = "${ClassName}Controller", description = "${functionName}接口", tags = {"${functionName}"})
|
|
|
public class ${ClassName}Controller extends BaseController
|
|
|
{
|
|
|
@Autowired
|
|
@@ -42,6 +48,7 @@ public class ${ClassName}Controller extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
|
|
|
@GetMapping("/list")
|
|
|
+ @ApiOperation(value = "查询${functionName}列表", notes = "获取${functionName}列表")
|
|
|
#if($table.crud || $table.sub)
|
|
|
public TableDataInfo list(${ClassName} ${className})
|
|
|
{
|
|
@@ -63,6 +70,7 @@ public class ${ClassName}Controller extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
|
|
|
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
+ @ApiOperation(value = "导出${functionName}列表", notes = "导出${functionName}列表")
|
|
|
public void export(HttpServletResponse response, ${ClassName} ${className})
|
|
|
{
|
|
|
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
|
@@ -75,6 +83,7 @@ public class ${ClassName}Controller extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')")
|
|
|
@GetMapping(value = "/{${pkColumn.javaField}}")
|
|
|
+ @ApiOperation(value = "获取${functionName}详细信息", notes = "获取${functionName}详细信息")
|
|
|
public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
|
|
|
{
|
|
|
return success(${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}));
|
|
@@ -85,6 +94,7 @@ public class ${ClassName}Controller extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')")
|
|
|
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
|
|
+ @ApiOperation(value = "新增${functionName}", notes = "新增${functionName}")
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody ${ClassName} ${className})
|
|
|
{
|
|
@@ -96,6 +106,7 @@ public class ${ClassName}Controller extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')")
|
|
|
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
|
|
+ @ApiOperation(value = "修改${functionName}", notes = "修改${functionName}")
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody ${ClassName} ${className})
|
|
|
{
|
|
@@ -107,6 +118,7 @@ public class ${ClassName}Controller extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')")
|
|
|
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
|
|
+ @ApiOperation(value = "删除${functionName}", notes = "删除${functionName}")
|
|
|
@DeleteMapping("/{${pkColumn.javaField}s}")
|
|
|
public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
|
|
{
|