This commit is contained in:
string 2025-05-14 12:13:29 +05:30
parent 8f27b9b92a
commit 459ed5fdbf
3 changed files with 20 additions and 4 deletions

View File

@ -1,8 +1,6 @@
package com.realnet.OpenAi.Controller;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Map;

View File

@ -13,6 +13,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@ -36,6 +37,9 @@ public class ScriptSrvice {
@Value("${projectPath}")
private String projectPath;
@Autowired
private SureopsService sureopsService;
public void Createonefile(Integer prj_id, List<String> lineList, String workflow_model, Long Deployment_profile)
throws IOException {
@ -126,6 +130,7 @@ public class ScriptSrvice {
// ArrayList<Object> list = calldeploymentprofile(Deployment_profile);
ArrayList<Object> list = new ArrayList<>();
String pROTOCOL = PortConstant.PROTOCOL;
Long serverPort = sureopsService.getUpdatedPort(1L);
ArrayList<Object> getdatafromgiturl = getdatafromgiturl(gitea_url);
@ -234,8 +239,9 @@ public class ScriptSrvice {
String replace11 = replace10.replace("<PROTOCOL>", pROTOCOL);
String replace12 = replace11.replace("<PRJ_NAME>", list.get(6).toString().replace("\"", ""));
String replace13 = replace12.replace("<SERVER_PORT>", serverPort.toString());
String finalreplace_value = replace12.replace("<MSG>",
String finalreplace_value = replace13.replace("<MSG>",
"\"" + list.get(7).toString().replace("\"", "") + "\"");
// for testing

View File

@ -43,7 +43,7 @@ public class SureopsService {
String index = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + " <title>Welcome</title>\n" + "</head>\n"
+ "<body>\n" + " <h1>Welcome to the Web App</h1>\n" + " <ul>\n"
+ " <li><a href=\"Home.html\">Home Page</a></li>\n" + " </ul>\n" + "</body>\n" + "</html>";
+ " <li><a href=\"home.html\">Home Page</a></li>\n" + " </ul>\n" + "</body>\n" + "</html>";
String filename = "index.html";
fileHelper.createFile(folderPath, filename, index);
@ -58,6 +58,18 @@ public class SureopsService {
}
}
public Long getUpdatedPort(Long webid) {
String url = PortConstant.SUREOPS_DOMAIN + "/sureops/resource/port";
ResponseEntity<Object> get = GET(url);
Object body = get.getBody();
Long port = Long.valueOf(body.toString());
return port;
}
public ResponseEntity<Object> GET(String get) {
RestTemplate restTemplate = new RestTemplate();