Prechádzať zdrojové kódy

20250415 dify功能修改

lrj 5 mesiacov pred
rodič
commit
8e4730c859

+ 14 - 0
src/main/java/cn/cslg/pas/service/dify/ConfessionSessionService.java

@@ -37,8 +37,22 @@ public class ConfessionSessionService extends ServiceImpl<ConfessionSessionMappe
 
     public Integer addConfessionSession(AddConfessionSessionDTO addConfessionSessionDTO) {
         String guid = addConfessionSessionDTO.getFileGuid();
+        String name = "";
+        try {
+            String res = fileManagerService.getSystemFileFromFMS(Arrays.asList(guid));
+            List<SystemFile> systemFiles = JSONObject.parseArray(res, SystemFile.class);
+            if (systemFiles != null && !systemFiles.isEmpty()) {
+                SystemFile systemFile = systemFiles.get(0);
+                name = systemFile.getOriginalName();
+            }
+        } catch (Exception e) {
+        }
+        if (name != null && !name.isEmpty()) {
+            name = name.split("\\.")[0];
+        }
         ConfessionSession confessionSession = new ConfessionSession();
         confessionSession.setGuid(guid);
+        confessionSession.setConversationName(name);
         String id = loginUtils.getId().toString();
         confessionSession.setCreateId(id);
         confessionSession.insert();