|
@@ -764,6 +764,25 @@ public class LobsterAdminController extends BaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ─── 消息去重监控 ───
|
|
// ─── 消息去重监控 ───
|
|
|
|
|
+ @GetMapping("/workflow/lobster/dedup-config/list")
|
|
|
|
|
+ public AjaxResult dedupConfigList(@RequestParam(required = false) Long companyId) {
|
|
|
|
|
+ if (companyConfigService == null) return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ return AjaxResult.success(companyConfigService.listDedup(companyId == null ? 0L : companyId));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/workflow/lobster/dedup-config/save")
|
|
|
|
|
+ public AjaxResult dedupConfigSave(@RequestBody Map<String, Object> body) {
|
|
|
|
|
+ if (companyConfigService == null) return AjaxResult.error("配置服务未启用");
|
|
|
|
|
+ return AjaxResult.success(companyConfigService.saveDedup(body));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @DeleteMapping("/workflow/lobster/dedup-config/{id}")
|
|
|
|
|
+ public AjaxResult dedupConfigDelete(@PathVariable Long id,
|
|
|
|
|
+ @RequestParam(required = false) Long companyId) {
|
|
|
|
|
+ if (companyConfigService != null) companyConfigService.deleteDedup(id, companyId == null ? 0L : companyId);
|
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@GetMapping("/workflow/lobster/dedup/stats")
|
|
@GetMapping("/workflow/lobster/dedup/stats")
|
|
|
public AjaxResult dedupStats(@RequestParam(required = false) Long companyId) {
|
|
public AjaxResult dedupStats(@RequestParam(required = false) Long companyId) {
|
|
|
Map<String, Object> stats = new HashMap<>();
|
|
Map<String, Object> stats = new HashMap<>();
|
|
@@ -896,6 +915,104 @@ public class LobsterAdminController extends BaseController {
|
|
|
return "admin"; // 动态节点审批由管理员操作
|
|
return "admin"; // 动态节点审批由管理员操作
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // ======== /workflow/lobster-admin/* 跨租户管理聚合端点 ========
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/companies")
|
|
|
|
|
+ public AjaxResult adminCompanies() {
|
|
|
|
|
+ if (jdbcTemplate == null) return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ try {
|
|
|
|
|
+ List<Map<String, Object>> list = jdbcTemplate.queryForList(
|
|
|
|
|
+ "SELECT id, company_name, domain, status FROM company_info WHERE del_flag=0 ORDER BY id");
|
|
|
|
|
+ return AjaxResult.success(list);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/company-stats/{companyId}")
|
|
|
|
|
+ public AjaxResult adminCompanyStats(@PathVariable Long companyId) {
|
|
|
|
|
+ Map<String, Object> stats = new HashMap<>();
|
|
|
|
|
+ stats.put("companyId", companyId);
|
|
|
|
|
+ stats.put("templateCount", 0);
|
|
|
|
|
+ stats.put("instanceCount", 0);
|
|
|
|
|
+ stats.put("totalTokens", "0");
|
|
|
|
|
+ return AjaxResult.success(stats);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/platform-stats")
|
|
|
|
|
+ public AjaxResult adminPlatformStats() {
|
|
|
|
|
+ Map<String, Object> stats = new HashMap<>();
|
|
|
|
|
+ stats.put("totalCompanies", 0);
|
|
|
|
|
+ stats.put("totalTemplates", 0);
|
|
|
|
|
+ stats.put("runningInstances", 0);
|
|
|
|
|
+ stats.put("todayTokens", "0");
|
|
|
|
|
+ return AjaxResult.success(stats);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/instances")
|
|
|
|
|
+ public AjaxResult adminInstances(@RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
|
|
+ @RequestParam(required = false) Long companyId) {
|
|
|
|
|
+ return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/prompts")
|
|
|
|
|
+ public AjaxResult adminPrompts(@RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
|
|
+ @RequestParam(required = false) Long companyId) {
|
|
|
|
|
+ return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/dead-letters")
|
|
|
|
|
+ public AjaxResult adminDeadLetters(@RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
|
|
+ @RequestParam(required = false) Long companyId) {
|
|
|
|
|
+ return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/event-audits")
|
|
|
|
|
+ public AjaxResult adminEventAudits(@RequestParam(defaultValue = "pending") String status,
|
|
|
|
|
+ @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
|
|
+ @RequestParam(required = false) Long companyId) {
|
|
|
|
|
+ return AjaxResult.success(eventAuditService.listAudits(status, pageNum, pageSize, companyId));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/optimizations")
|
|
|
|
|
+ public AjaxResult adminOptimizations(@RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
|
|
+ @RequestParam(required = false) Long companyId) {
|
|
|
|
|
+ return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/sales-corpus")
|
|
|
|
|
+ public AjaxResult adminSalesCorpus(@RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
|
|
+ @RequestParam(required = false) String scenario,
|
|
|
|
|
+ @RequestParam(required = false) Long companyId) {
|
|
|
|
|
+ return AjaxResult.success(salesCorpusService.listCorpus(pageNum, pageSize, companyId, scenario, null));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/api-registry")
|
|
|
|
|
+ public AjaxResult adminApiRegistry(@RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
|
|
+ @RequestParam(required = false) Long companyId) {
|
|
|
|
|
+ return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping("/workflow/lobster-admin/chat-aggregate")
|
|
|
|
|
+ public AjaxResult adminChatAggregate(@RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
|
|
+ @RequestParam(required = false) String channelType,
|
|
|
|
|
+ @RequestParam(required = false) String keyword) {
|
|
|
|
|
+ if (chatSessionMapper == null) return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ try {
|
|
|
|
|
+ return AjaxResult.success(chatSessionMapper.selectForAggregate(channelType, keyword));
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ return AjaxResult.success(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@PostMapping("/workflow/lobster/scenario/run-all")
|
|
@PostMapping("/workflow/lobster/scenario/run-all")
|
|
|
public AjaxResult scenarioRunAll() {
|
|
public AjaxResult scenarioRunAll() {
|
|
|
if (testScenarioService == null) return AjaxResult.error("场景服务未启用");
|
|
if (testScenarioService == null) return AjaxResult.error("场景服务未启用");
|