| | |
| | | package com.fgkj.controller; |
| | | |
| | | import java.util.List; |
| | | 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 com.google.gson.reflect.TypeToken; |
| | | 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 |
| | | @Api(tags = "databaseBackup接口") |
| | | public class Database_backupController{ |
| | | |
| | | @Autowired |
| | | @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<Database_backup> list) { |
| | | ServiceModel model=new ServiceModel(); |
| | | /*if(json!=null&&json.length()>0){ |
| | |
| | | |
| | | //根据数据库名和表名修改备份数据库的使能(多笔记录) |
| | | @PutMapping("all") |
| | | @ApiOperation(notes = "",value="数据库名和表名修改备份数据库的使能(多笔记录)") |
| | | public ServiceModel updateProAll() { |
| | | ServiceModel model=service.updateProAll(); |
| | | |
| | |
| | | |
| | | //查询所有数据库备份信息 |
| | | @GetMapping("all") |
| | | @ApiOperation(notes = "",value="查询所有数据库备份信息") |
| | | public ServiceModel searchAll() { |
| | | ServiceModel model=service.searchAll(); |
| | | |
| | |
| | | |
| | | //查询数据库备份表中所有的数据库 |
| | | @GetMapping("allDatabase") |
| | | @ApiOperation(notes = "",value="查询数据库备份表中所有的数据库") |
| | | public ServiceModel searchAllDatabase() { |
| | | ServiceModel model=service.searchAllDatabase(); |
| | | |
| | |
| | | } |
| | | |
| | | //根据数据库名查询所有的表 |
| | | @GetMapping("allTable") |
| | | public ServiceModel searchAllTable(@RequestBody Database_backup baseup) { |
| | | // Database_backup baseup=getGson().fromJson(json, Database_backup.class); |
| | | ServiceModel model=service.searchAllTable(baseup); |
| | | @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") |
| | | public ServiceModel searchNum() { |
| | | ServiceModel model=service.searchNum(); |
| | | @ApiOperation(notes = "",value="查询个数") |
| | | public ServiceModelOnce searchNum() { |
| | | ServiceModelOnce model=service.searchNum(); |
| | | |
| | | return model; |
| | | } |