Commit 25f5aedd authored by chenzai's avatar chenzai

commit

parent 90cf39d2
...@@ -52,39 +52,9 @@ public class RelationResource { ...@@ -52,39 +52,9 @@ public class RelationResource {
* *
* @return String * @return String
*/ */
// @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
// @GetMapping(value = "/export/{agencyCode}/{sequenceNbrs}")
// @ApiOperation(httpMethod = "GET", value = "导出", notes = "导出")
//// public ResponseModel<String> generateSQL(
//// @RequestParam(value = "databaseName",required = false) String databaseName,
// public void generateSQL(
// @PathVariable String agencyCode,
// @PathVariable String sequenceNbrs,
// HttpServletResponse response,
// HttpServletRequest request) throws Exception {
// Map<String, Object> variables = new HashMap<>();
// variables.put("agencyCode", agencyCode);
// String referer = request.getHeader("Referer");
// int start = referer.indexOf("ipSeq=")+6;
// int end = referer.indexOf("&agencyCode=");
// String ipSeq = referer.substring(start,end);
// Long longIpSql = Long.parseLong(ipSeq);
// studioResourceService.generateSQL("Agency","agencyCode", longIpSql, variables, response);
// studioResourceService.generateSQLByDatabaseName("Agency","agencyCode",databaseName, longIpSql, variables, response);
//// return ResponseHelper.buildResponse("yes");
// }
/**
* 导出SQL脚本
*
* @return String
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/export/{agencyCode}/{ipSeq}/{dbSeqs}") @GetMapping(value = "/export/{agencyCode}/{ipSeq}/{dbSeqs}")
@ApiOperation(httpMethod = "GET", value = "导出", notes = "导出") @ApiOperation(httpMethod = "GET", value = "导出", notes = "导出")
// public ResponseModel<String> generateSQL(
// @RequestParam(value = "databaseName",required = false) String databaseName,
public void generateSQL( public void generateSQL(
@PathVariable String agencyCode, @PathVariable String agencyCode,
@PathVariable Long ipSeq, @PathVariable Long ipSeq,
...@@ -93,28 +63,8 @@ public class RelationResource { ...@@ -93,28 +63,8 @@ public class RelationResource {
HttpServletRequest request) throws Exception { HttpServletRequest request) throws Exception {
Map<String, Object> variables = new HashMap<>(); Map<String, Object> variables = new HashMap<>();
variables.put("agencyCode", agencyCode); variables.put("agencyCode", agencyCode);
// String referer = request.getHeader("Referer");
// int start = referer.indexOf("ipSeq=")+6;
// int end = referer.indexOf("&agencyCode=");
// String ipSeq = referer.substring(start,end);
// studioResourceService.generateSQL("Agency","agencyCode", ipSeq, variables, response);
studioResourceService.generateSQLByDatabaseName("Agency","agencyCode",dbSeqs, ipSeq, variables, response); studioResourceService.generateSQLByDatabaseName("Agency","agencyCode",dbSeqs, ipSeq, variables, response);
// return ResponseHelper.buildResponse("yes");
} }
// @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
// @GetMapping(value = "/export/{agencyCode}/{ipSeq}/{dbName}")
// @ApiOperation(httpMethod = "GET", value = "导出", notes = "导出")
// public ResponseModel<String> generateSQL(
// @PathVariable String agencyCode,
// @PathVariable Long ipSeq,
// @PathVariable String dbName,
// HttpServletResponse response) throws Exception {
// relationService.outputAgency(agencyCode, ipSeq,dbName,response);
// return ResponseHelper.buildResponse("yes");
// }
} }
\ No newline at end of file
...@@ -205,7 +205,7 @@ public class StudioResourceService extends BaseService<StudioResourceModel, Stud ...@@ -205,7 +205,7 @@ public class StudioResourceService extends BaseService<StudioResourceModel, Stud
sqlDirectory.mkdir(); sqlDirectory.mkdir();
} }
// 备份文件路径名称 // 备份文件路径名称
// String fileName = (SourceEnum.IDX.getSource().equals(resourceCode.toLowerCase()) ? (resourceCode.toLowerCase() + "_") : "studio_") + DateFormatUtils.format(new Date(), "yyyyMMdd") + "." + SUFFIX; // String fileName = (SourceEnum.IDX.getSource().equals(resourceCode.toLowerCase()) ? (resourceCode.toLowerCase() + "_") : "studio_") + DateFormatUtils.format(new Date(), "yyyyMMdd") + "." + SUFFIX;
String fileName = databaseName + DateFormatUtils.format(new Date(), "yyyyMMdd") + "." + SUFFIX; String fileName = databaseName + DateFormatUtils.format(new Date(), "yyyyMMdd") + "." + SUFFIX;
String sqlFilePath = backPath + SLASH + fileName; String sqlFilePath = backPath + SLASH + fileName;
File file = new File(sqlFilePath); File file = new File(sqlFilePath);
......
...@@ -24,6 +24,7 @@ import java.util.*; ...@@ -24,6 +24,7 @@ import java.util.*;
@Service @Service
public class ToolLibraryService extends BaseService<ToolLibraryModel, ToolLibrary,ToolLibraryMapper> { public class ToolLibraryService extends BaseService<ToolLibraryModel, ToolLibrary,ToolLibraryMapper> {
private final String className = "com.mysql.cj.jdbc.Driver"; private final String className = "com.mysql.cj.jdbc.Driver";
private final String url = "jdbc:mysql://172.16.3.18:3306/amos_studio"; private final String url = "jdbc:mysql://172.16.3.18:3306/amos_studio";
...@@ -32,18 +33,6 @@ public class ToolLibraryService extends BaseService<ToolLibraryModel, ToolLibrar ...@@ -32,18 +33,6 @@ public class ToolLibraryService extends BaseService<ToolLibraryModel, ToolLibrar
private final String passWord = "Yeejoin@2020"; private final String passWord = "Yeejoin@2020";
// @Value("${toolLibrary.className}")
// private String className;
//
// @Value("${toolLibrary.url}")
// private String url;
//
// @Value("${toolLibrary.userName}")
// private String userName;
//
// @Value("${toolLibrary.passWord}")
// private String passWord;
/** /**
* 由一级到二级 * 由一级到二级
*/ */
......
...@@ -55,8 +55,3 @@ spring.boot.admin.client.password=a1234560 ...@@ -55,8 +55,3 @@ spring.boot.admin.client.password=a1234560
management.security.enabled=false management.security.enabled=false
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
#toolLibrary.className=com.mysql.cj.jdbc.Driver
#toolLibrary.url=jdbc:mysql://172.16.3.18:3306/amos_studio
#toolLibrary.userName=root
#toolLibrary.passWord=Yeejoin@2020
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment