Przeglądaj źródła

ai管理-违规词优化
ai角色接口优化

lk 4 dni temu
rodzic
commit
bc866fa9af

+ 97 - 0
fs-company/src/main/java/com/fs/fastGpt/FastGptChatReplaceWordsController.java

@@ -0,0 +1,97 @@
+package com.fs.fastGpt;
+
+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.fastGpt.domain.FastGptChatReplaceWords;
+import com.fs.fastGpt.service.IFastGptChatReplaceWordsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 违规词语Controller
+ *
+ * @author fs
+ * @date 2025-01-18
+ */
+@RestController
+@RequestMapping("/fastGpt/fastGptChatReplaceWords")
+public class FastGptChatReplaceWordsController extends BaseController
+{
+    @Autowired
+    private IFastGptChatReplaceWordsService fastGptChatReplaceWordsService;
+
+    /**
+     * 查询违规词语列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceWords:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FastGptChatReplaceWords fastGptChatReplaceWords)
+    {
+        startPage();
+        List<FastGptChatReplaceWords> list = fastGptChatReplaceWordsService.selectFastGptChatReplaceWordsList(fastGptChatReplaceWords);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出违规词语列表
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceWords:export')")
+    @Log(title = "违规词语", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FastGptChatReplaceWords fastGptChatReplaceWords)
+    {
+        List<FastGptChatReplaceWords> list = fastGptChatReplaceWordsService.selectFastGptChatReplaceWordsList(fastGptChatReplaceWords);
+        ExcelUtil<FastGptChatReplaceWords> util = new ExcelUtil<FastGptChatReplaceWords>(FastGptChatReplaceWords.class);
+        return util.exportExcel(list, "违规词语数据");
+    }
+
+//    /**
+//     * 获取违规词语详细信息
+//     */
+//    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceWords:query')")
+//    @GetMapping(value = "/{id}")
+//    public AjaxResult getInfo(@PathVariable("id") Long id)
+//    {
+//        return AjaxResult.success(fastGptChatReplaceWordsService.selectFastGptChatReplaceWordsById(id));
+//    }
+
+//    /**
+//     * 新增违规词语
+//     */
+//    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceWords:add')")
+//    @Log(title = "违规词语", businessType = BusinessType.INSERT)
+//    @PostMapping
+//    public AjaxResult add(@RequestBody FastGptChatReplaceWords fastGptChatReplaceWords)
+//    {
+//        return toAjax(fastGptChatReplaceWordsService.insertFastGptChatReplaceWords(fastGptChatReplaceWords));
+//    }
+//
+//    /**
+//     * 修改违规词语
+//     */
+//    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceWords:edit')")
+//    @Log(title = "违规词语", businessType = BusinessType.UPDATE)
+//    @PutMapping
+//    public AjaxResult edit(@RequestBody FastGptChatReplaceWords fastGptChatReplaceWords)
+//    {
+//        return toAjax(fastGptChatReplaceWordsService.updateFastGptChatReplaceWords(fastGptChatReplaceWords));
+//    }
+//
+    /**
+     * 删除违规词语
+     */
+    @PreAuthorize("@ss.hasPermi('fastGpt:fastGptChatReplaceWords:remove')")
+    @Log(title = "违规词语", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fastGptChatReplaceWordsService.deleteFastGptChatReplaceWordsByIds(ids));
+    }
+}

+ 4 - 4
fs-service/src/main/java/com/fs/fastGpt/mapper/FastGptRoleMapper.java

@@ -36,10 +36,10 @@ public interface FastGptRoleMapper
     public List<FastGptRole> selectFastGptRoleList(FastGptRole fastGptRole);
 
     @Select("<script> " +
-            "select fr.*,qc.corp_name as corpName  from fastgpt_role fr left join qw_company qc on fr.bind_corp_id=qc.corp_id " +
+            "select fr.*,qc.corp_name as corpName  from fastgpt_role fr left join qw_company qc on fr.bind_corp_id COLLATE utf8mb4_general_ci = qc.corp_id " +
             "         <where>  \n" +
             "            <if test=\"roleName != null  and roleName != ''\"> and role_name like concat('%', #{roleName}, '%')</if>\n" +
-            "            <if test=\"companyId != null \"> and company_id = #{companyId}</if>\n" +
+            "            <if test=\"companyId != null \"> and fr.company_id = #{companyId}</if>\n" +
             "            <if test=\"roleType != null \"> and role_type = #{roleType}</if>\n" +
             "            <if test=\"modeConfigJson != null  and modeConfigJson != ''\"> and mode_config_json = #{modeConfigJson}</if>\n" +
             "            <if test=\"mode != null \"> and mode = #{mode}</if>\n" +
@@ -100,10 +100,10 @@ public interface FastGptRoleMapper
     List<FastgptEventLogTotalVo> selectFastGptRoleAppKeyList();
 
     @Select("<script> " +
-            "select fr.*,qc.corp_name as corpName  from fastgpt_role fr left join qw_company qc on fr.bind_corp_id=qc.corp_id " +
+            "select fr.*,qc.corp_name as corpName  from fastgpt_role fr left join qw_company qc on fr.bind_corp_id COLLATE utf8mb4_general_ci = qc.corp_id " +
             "         <where>  \n" +
             "            <if test=\"roleName != null  and roleName != ''\"> and role_name like concat('%', #{roleName}, '%')</if>\n" +
-            "            <if test=\"companyId != null \"> and company_id = #{companyId}</if>\n" +
+            "            <if test=\"companyId != null \"> and fr.company_id = #{companyId}</if>\n" +
             "            <if test=\"roleType != null \"> and role_type = #{roleType}</if>\n" +
             "            <if test=\"modeConfigJson != null  and modeConfigJson != ''\"> and mode_config_json = #{modeConfigJson}</if>\n" +
             "            <if test=\"mode != null \"> and mode = #{mode}</if>\n" +