package com.fgkj.controller; import com.fgkj.dto.ServiceModelOnce; import com.fgkj.util.*; import com.fgkj.dto.Database_backup; import com.fgkj.dto.ServiceModel; import com.fgkj.services.Database_backupService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; import javax.annotation.Resource; @RequestMapping("databaseBackup") @RestController @Api(tags = "databaseBackup接口") public class Database_backupController{ @Resource private Database_backupService service; //根据数据库名和表名修改备份数据库的使能(多笔记录) @PutMapping("pro") @ApiOperation(notes = "[{ \"database_name\": \"web_site\", \"table_name\": \"tb_batt_discharge\", \"backup_en\": 1 }]",value="数据库名和表名修改备份数据库的使能(多笔记录)") public ServiceModel updatePro(@RequestBody List list) { ServiceModel model=new ServiceModel(); /*if(json!=null&&json.length()>0){ List list=getGson().fromJson(json, new TypeToken>(){}.getType()); model=service.updatePro(list); }*/ model=service.updatePro(list); return model; } //根据数据库名和表名修改备份数据库的使能(多笔记录) @PutMapping("all") @ApiOperation(notes = "",value="数据库名和表名修改备份数据库的使能(多笔记录)") public ServiceModel updateProAll() { ServiceModel model=service.updateProAll(); return model; } //查询所有数据库备份信息 @GetMapping("all") @ApiOperation(notes = "",value="查询所有数据库备份信息") public ServiceModel searchAll() { ServiceModel model=service.searchAll(); return model; } //查询数据库备份表中所有的数据库 @GetMapping("allDatabase") @ApiOperation(notes = "",value="查询数据库备份表中所有的数据库") public ServiceModel searchAllDatabase() { ServiceModel model=service.searchAllDatabase(); return model; } //根据数据库名查询所有的表 @PostMapping("allTable") @ApiOperation(notes = "",value="数据库名查询所有的表") public ServiceModel searchAllTable(@RequestParam String database_name) { Database_backup baseup = new Database_backup(); baseup.setDatabase_name(database_name); ServiceModel model = service.searchAllTable(baseup); return model; } //查询个数 @GetMapping("num") @ApiOperation(notes = "",value="查询个数") public ServiceModelOnce searchNum() { ServiceModelOnce model=service.searchNum(); return model; } }