From 6250f74b2a02770a37f2f0144c762f7952a12bd6 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期二, 18 二月 2025 08:58:51 +0800
Subject: [PATCH] 修改
---
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java | 36 +++++++++++++++++-------------------
1 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java
index 9c43647..2004668 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java
@@ -25,6 +25,8 @@
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
+import java.util.Date;
+
/**
* model_line
@@ -39,7 +41,9 @@
private static final String URL_REPLACE_STR = "URL_PREFIX_URL";
private static final String TOKEN_REPLACE_STR = "MY_TOKEN_MY";
+ private static final String TIMESTAMP_REPLACE_STR = "MY_TIMESTAMP_MY";
private static final String TOKEN_REPLACE_REGEX = "token=[0-9a-zA-Z]+&";
+ private static final String TIMESTAMP_REPLACE_REGEX = "&t=[0-9]+";
@Autowired
private ModelLineService modelLineService;
@@ -47,24 +51,6 @@
@Autowired
private ModelRbdNodeService modelRbdNodeService;
- @Autowired
- private PythonLib pythonLib;
-
- @GetMapping("callPythonCalc")
- @ApiOperation("淇℃伅")
- public Result callPythonCalc() {
- Result result = pythonLib.callPython();
-
- return result;
- }
-
- @GetMapping("getPythonCalcResult")
- @ApiOperation("淇℃伅")
- public Result<String> getPythonCalcResult() {
- String result = pythonLib.getPythonCalcResult();
-
- return Result.ok(result);
- }
@GetMapping("page")
@ApiOperation("鍒嗛〉")
@@ -94,6 +80,7 @@
if (data.getContent() != null) {
data.setContent(data.getContent().replace(URL_REPLACE_STR, urlPref));
data.setContent(data.getContent().replace(TOKEN_REPLACE_STR, "token="+token+"&"));
+ data.setContent(data.getContent().replace(TIMESTAMP_REPLACE_STR, "&t="+(new Date()).getTime()));
}
return Result.ok(data);
}
@@ -106,6 +93,7 @@
ValidatorUtils.validateEntity(modelRbd, AddGroup.class, DefaultGroup.class);
modelRbd.setContent(modelRbd.getContent().replace(modelRbd.getUrlPref(), URL_REPLACE_STR));
modelRbd.setContent(modelRbd.getContent().replaceAll(TOKEN_REPLACE_REGEX, TOKEN_REPLACE_STR));
+ modelRbd.setContent(modelRbd.getContent().replaceAll(TIMESTAMP_REPLACE_REGEX, TIMESTAMP_REPLACE_STR));
modelRbdNodeService.saveNodeArr(modelRbd);
modelLineService.insert(modelRbd);
return Result.ok();
@@ -119,6 +107,7 @@
ValidatorUtils.validateEntity(modelRbd, UpdateGroup.class, DefaultGroup.class);
modelRbd.setContent(modelRbd.getContent().replace(modelRbd.getUrlPref(), URL_REPLACE_STR));
modelRbd.setContent(modelRbd.getContent().replaceAll(TOKEN_REPLACE_REGEX, TOKEN_REPLACE_STR));
+ modelRbd.setContent(modelRbd.getContent().replaceAll(TIMESTAMP_REPLACE_REGEX, TIMESTAMP_REPLACE_STR));
modelRbdNodeService.saveNodeArr(modelRbd);
modelLineService.update(modelRbd);
@@ -140,9 +129,18 @@
@ApiOperation("瑙f瀽")
@LogOperation("瑙f瀽")
public Result analyze(@RequestBody ModelRbd modelRbd) {
- modelLineService.update(modelRbd);
+ update(modelRbd);
boolean result = modelLineService.analyze(modelRbd);
return result ? Result.ok() : Result.error("瑙f瀽澶辫触");
}
+
+ @PostMapping("layout")
+ @ApiOperation("鑷姩鎺掔増")
+ @LogOperation("鑷姩鎺掔増")
+ public Result<ModelRbd> layout(@RequestBody ModelRbd modelRbd) {
+ boolean result = modelLineService.layout(modelRbd);
+ return result ? Result.ok(modelRbd) : Result.error("鑷姩鎺掔増澶辫触");
+ }
+
}
--
Gitblit v1.9.1