|
|
@@ -18,7 +18,6 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
- * 租户端 E2E 测试 / 测试剧本 / 动态节点审批(saasui)
|
|
|
*/
|
|
|
@RestController
|
|
|
public class LobsterE2eController extends BaseController {
|
|
|
@@ -43,7 +42,7 @@ public class LobsterE2eController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:query')")
|
|
|
@PostMapping("/workflow/lobster/e2e/run")
|
|
|
public AjaxResult e2eRun(@RequestBody Map<String, Object> body) {
|
|
|
- if (e2eTestService == null) return AjaxResult.error("E2E 测试服务未启用");
|
|
|
+ if (e2eTestService == null) return AjaxResult.error("E2E 锟斤拷锟皆凤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
LobsterE2eTestService.E2eRequest req = buildE2eRequest(body, currentCompanyId());
|
|
|
return AjaxResult.success(e2eTestService.runE2e(req));
|
|
|
}
|
|
|
@@ -51,7 +50,7 @@ public class LobsterE2eController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:query')")
|
|
|
@GetMapping("/workflow/lobster/e2e/report/{runId}")
|
|
|
public AjaxResult e2eReport(@PathVariable String runId) {
|
|
|
- if (e2eTestService == null) return AjaxResult.error("E2E 测试服务未启用");
|
|
|
+ if (e2eTestService == null) return AjaxResult.error("E2E 锟斤拷锟皆凤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
return AjaxResult.success(e2eTestService.getReport(runId));
|
|
|
}
|
|
|
|
|
|
@@ -66,7 +65,7 @@ public class LobsterE2eController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:exec')")
|
|
|
@PostMapping("/workflow/lobster-exec/step-next/{instanceId}")
|
|
|
public AjaxResult stepNext(@PathVariable Long instanceId, @RequestBody Map<String, Object> body) {
|
|
|
- if (e2eTestService == null) return AjaxResult.error("E2E 测试服务未启用");
|
|
|
+ if (e2eTestService == null) return AjaxResult.error("E2E 锟斤拷锟皆凤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
String userInput = body != null ? (String) body.get("userInput") : null;
|
|
|
return AjaxResult.success(e2eTestService.stepNext(currentCompanyId(), instanceId, userInput));
|
|
|
}
|
|
|
@@ -74,7 +73,7 @@ public class LobsterE2eController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:exec')")
|
|
|
@PostMapping("/workflow/lobster/chat/multi-turn")
|
|
|
public AjaxResult multiTurn(@RequestBody Map<String, Object> body) {
|
|
|
- if (e2eTestService == null) return AjaxResult.error("E2E 测试服务未启用");
|
|
|
+ if (e2eTestService == null) return AjaxResult.error("E2E 锟斤拷锟皆凤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
List<String> inputs = parseStringList(body.get("userInputs"));
|
|
|
return AjaxResult.success(e2eTestService.multiTurn(
|
|
|
currentCompanyId(),
|
|
|
@@ -95,14 +94,14 @@ public class LobsterE2eController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:query')")
|
|
|
@GetMapping("/workflow/lobster/scenario/{id}")
|
|
|
public AjaxResult scenarioGet(@PathVariable Long id) {
|
|
|
- if (testScenarioService == null) return AjaxResult.error("剧本服务未启用");
|
|
|
+ if (testScenarioService == null) return AjaxResult.error("锟界本锟斤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
return AjaxResult.success(testScenarioService.getScenario(id));
|
|
|
}
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:edit')")
|
|
|
@PostMapping("/workflow/lobster/scenario/save")
|
|
|
public AjaxResult scenarioSave(@RequestBody Map<String, Object> body) {
|
|
|
- if (testScenarioService == null) return AjaxResult.error("剧本服务未启用");
|
|
|
+ if (testScenarioService == null) return AjaxResult.error("锟界本锟斤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
body.putIfAbsent("companyId", currentCompanyId());
|
|
|
Object idObj = body.get("id");
|
|
|
if (idObj == null) {
|
|
|
@@ -122,7 +121,7 @@ public class LobsterE2eController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:exec')")
|
|
|
@PostMapping("/workflow/lobster/scenario/{id}/run")
|
|
|
public AjaxResult scenarioRunNow(@PathVariable Long id) {
|
|
|
- if (testScenarioService == null) return AjaxResult.error("剧本服务未启用");
|
|
|
+ if (testScenarioService == null) return AjaxResult.error("锟界本锟斤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
String runId = testScenarioService.runScenarioNow(id);
|
|
|
Map<String, Object> r = new HashMap<>();
|
|
|
r.put("runId", runId);
|
|
|
@@ -132,7 +131,7 @@ public class LobsterE2eController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:exec')")
|
|
|
@PostMapping("/workflow/lobster/scenario/run-all")
|
|
|
public AjaxResult scenarioRunAll() {
|
|
|
- if (testScenarioService == null) return AjaxResult.error("剧本服务未启用");
|
|
|
+ if (testScenarioService == null) return AjaxResult.error("锟界本锟斤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
Map<String, Object> r = new HashMap<>();
|
|
|
r.put("triggered", testScenarioService.runAllEnabledScenarios());
|
|
|
return AjaxResult.success(r);
|
|
|
@@ -148,7 +147,7 @@ public class LobsterE2eController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:edit')")
|
|
|
@PostMapping("/workflow/lobster/dynamic-impl/{id}/approve")
|
|
|
public AjaxResult dynamicImplApprove(@PathVariable Long id) {
|
|
|
- if (dynamicNodeImplService == null) return AjaxResult.error("服务未启用");
|
|
|
+ if (dynamicNodeImplService == null) return AjaxResult.error("锟斤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
dynamicNodeImplService.approve(id, loginUser.getUsername());
|
|
|
return AjaxResult.success();
|
|
|
@@ -157,7 +156,7 @@ public class LobsterE2eController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('workflow:lobster:edit')")
|
|
|
@PostMapping("/workflow/lobster/dynamic-impl/{id}/reject")
|
|
|
public AjaxResult dynamicImplReject(@PathVariable Long id, @RequestParam String reason) {
|
|
|
- if (dynamicNodeImplService == null) return AjaxResult.error("服务未启用");
|
|
|
+ if (dynamicNodeImplService == null) return AjaxResult.error("锟斤拷锟斤拷未锟斤拷锟斤拷");
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
dynamicNodeImplService.reject(id, loginUser.getUsername(), reason);
|
|
|
return AjaxResult.success();
|