Parcourir la source

租户总后台-AI外呼话术管理接口404问题修复

Long il y a 6 jours
Parent
commit
e34c39b09d

+ 110 - 0
fs-admin-saas/src/main/java/com/fs/company/controller/CompanyVoiceDialogController.java

@@ -0,0 +1,110 @@
+package com.fs.company.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyVoiceDialog;
+import com.fs.company.service.ICompanyVoiceDialogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * AI外呼话术Controller(fs-admin-saas 桥接)
+ * <p>
+ * 由于 com.fs.company.controller.company 子包在 fs-saasadmin 中被排除加载,
+ * 原 CompanyVoiceDialogController(位于 fs-company 模块的 company 子包下)无法被扫描到。
+ * 本控制器在 com.fs.company.controller 根包下提供相同的 API 端点,确保
+ * saasadminui 前端通过 port 8004 的请求正常路由。
+ *
+ * @author fs
+ * @date 2024-12-04
+ */
+@RestController
+@RequestMapping("/company/companyVoiceDialog")
+public class CompanyVoiceDialogController extends BaseController {
+
+    @Autowired
+    private ICompanyVoiceDialogService companyVoiceDialogService;
+
+    /**
+     * 查询AI外呼话术列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:companyVoiceDialog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyVoiceDialog companyVoiceDialog) {
+        startPage();
+        List<CompanyVoiceDialog> list = companyVoiceDialogService.selectCompanyVoiceDialogList(companyVoiceDialog);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出AI外呼话术列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:companyVoiceDialog:export')")
+    @Log(title = "AI外呼话术", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanyVoiceDialog companyVoiceDialog) {
+        List<CompanyVoiceDialog> list = companyVoiceDialogService.selectCompanyVoiceDialogList(companyVoiceDialog);
+        ExcelUtil<CompanyVoiceDialog> util = new ExcelUtil<CompanyVoiceDialog>(CompanyVoiceDialog.class);
+        return util.exportExcel(list, "dialog");
+    }
+
+    /**
+     * 获取AI外呼话术详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:companyVoiceDialog:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(companyVoiceDialogService.selectCompanyVoiceDialogById(id));
+    }
+
+    /**
+     * 新增AI外呼话术
+     */
+    @PreAuthorize("@ss.hasPermi('system:companyVoiceDialog:add')")
+    @Log(title = "AI外呼话术", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanyVoiceDialog companyVoiceDialog) {
+        return toAjax(companyVoiceDialogService.insertCompanyVoiceDialog(companyVoiceDialog));
+    }
+
+    /**
+     * 修改AI外呼话术
+     */
+    @PreAuthorize("@ss.hasPermi('system:companyVoiceDialog:edit')")
+    @Log(title = "AI外呼话术", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CompanyVoiceDialog companyVoiceDialog) {
+        return toAjax(companyVoiceDialogService.updateCompanyVoiceDialog(companyVoiceDialog));
+    }
+
+    /**
+     * 删除AI外呼话术
+     */
+    @PreAuthorize("@ss.hasPermi('system:companyVoiceDialog:remove')")
+    @Log(title = "AI外呼话术", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(companyVoiceDialogService.deleteCompanyVoiceDialogByIds(ids));
+    }
+
+    /**
+     * 获取话术配置链接
+     */
+    @PreAuthorize("@ss.hasPermi('system:companyVoiceDialog:list')")
+    @Log(title = "话术配置链接", businessType = BusinessType.OTHER)
+    @GetMapping("/getConfigUrl")
+    public AjaxResult getConfigUrl(Long id) {
+        try {
+            return AjaxResult.success("", companyVoiceDialogService.getConfigUrl(id));
+        } catch (Exception e) {
+            return AjaxResult.error("获取话术配置链接失败:" + e.getMessage());
+        }
+    }
+}