|
@@ -1,11 +1,15 @@
|
|
|
package com.phm.manage.controller;
|
|
|
|
|
|
-import com.phm.common.core.controller.BaseController;
|
|
|
-import com.phm.manage.domain.common.CommonResult;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import com.phm.common.config.PHMConfig;
|
|
|
+import com.phm.common.core.controller.BaseController;
|
|
|
+import com.phm.manage.domain.common.CommonResult;
|
|
|
+import com.phm.manage.service.IBackupRestoreService;
|
|
|
+
|
|
|
/**
|
|
|
* @Description BackupRestoreController
|
|
|
* @Author WGK
|
|
@@ -14,6 +18,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RestController
|
|
|
@RequestMapping("/manage")
|
|
|
public class BackupRestoreController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private IBackupRestoreService backupRestoreService;
|
|
|
+
|
|
|
/**
|
|
|
* 备份文件
|
|
|
*
|
|
@@ -21,7 +28,8 @@ public class BackupRestoreController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/file/backup")
|
|
|
public CommonResult<String> backupFile() {
|
|
|
- // TODO 服务都需要开发
|
|
|
+ backupRestoreService.fileCopyBackup(PHMConfig.getProfile(), PHMConfig.getProfileBackup());
|
|
|
+ backupRestoreService.fileCopyBackup(PHMConfig.getCsvFilePath(), PHMConfig.getCsvFileBackupPath());
|
|
|
return CommonResult.buildSuccess();
|
|
|
}
|
|
|
|
|
@@ -32,6 +40,8 @@ public class BackupRestoreController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/file/restore")
|
|
|
public CommonResult<String> restoreFile() {
|
|
|
+ backupRestoreService.fileCopyRestore(PHMConfig.getProfileBackup(), PHMConfig.getProfile());
|
|
|
+ backupRestoreService.fileCopyRestore(PHMConfig.getCsvFileBackupPath(), PHMConfig.getCsvFilePath());
|
|
|
return CommonResult.buildSuccess();
|
|
|
}
|
|
|
|
|
@@ -44,6 +54,7 @@ public class BackupRestoreController extends BaseController {
|
|
|
public CommonResult<String> backupDb() {
|
|
|
return CommonResult.buildSuccess();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 恢复数据库表数据
|
|
|
*
|