|
@@ -4,10 +4,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.jeeplus.common.persistence.Page;
|
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
|
import com.jeeplus.modules.knowledgeSharing.dify.DifyApiClient;
|
|
|
-import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeBase;
|
|
|
-import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeBaseDoc;
|
|
|
-import com.jeeplus.modules.knowledgeSharing.entity.KnowledgeBaseDocContent;
|
|
|
+import com.jeeplus.modules.knowledgeSharing.entity.*;
|
|
|
import com.jeeplus.modules.knowledgeSharing.service.KnowledgeBaseService;
|
|
|
+import com.jeeplus.modules.knowledgeSharing.service.KnowledgeSharingTypeService;
|
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
@@ -41,6 +40,9 @@ public class KnowledgeBaseController {
|
|
|
@Autowired
|
|
|
private KnowledgeBaseService service;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private KnowledgeSharingTypeService typeService;
|
|
|
+
|
|
|
/**
|
|
|
* 知识库列表
|
|
|
*/
|
|
@@ -52,6 +54,66 @@ public class KnowledgeBaseController {
|
|
|
return "modules/knowledgeSharing/knowledgeBaseList";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Ai移动端展示列表
|
|
|
+ * @param knowledgeSharingInfo
|
|
|
+ * @param request
|
|
|
+ * @param model
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = {"mobileList"})
|
|
|
+ public String mobileList(KnowledgeSharingInfo knowledgeSharingInfo, HttpServletRequest request, Model model) {
|
|
|
+ List<KnowledgeSharingTypeInfo> typeInfoList = typeService.findList(new KnowledgeSharingTypeInfo());
|
|
|
+ model.addAttribute("typeInfoList", typeInfoList);
|
|
|
+ return "modules/knowledgeSharing/knowledgeBaseMobile";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开对应的ai页面
|
|
|
+ * @param knowledgeSharingInfo
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @param model
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @RequestMapping(value = {"openChatPage"})
|
|
|
+ public String openChatPage(KnowledgeSharingInfo knowledgeSharingInfo, HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
|
|
|
+
|
|
|
+ String difySrc = "http://3081089em4.wicp.vip:28499/chatbot/";
|
|
|
+
|
|
|
+ model.addAttribute("columnId", knowledgeSharingInfo.getColumnId());
|
|
|
+ model.addAttribute("difySrc", difySrc + "LlXD0YzBLGPKBlqb");
|
|
|
+ //根据不同的栏目id 跳转不同的dify聊天窗口
|
|
|
+ if (StringUtils.isNotBlank(knowledgeSharingInfo.getColumnId())) {
|
|
|
+ switch (knowledgeSharingInfo.getColumnId()){
|
|
|
+ case "1": //学习园地
|
|
|
+ model.addAttribute("difySrc", difySrc + "6A7qteLy6CtDSHVf");
|
|
|
+ break;
|
|
|
+ case "9": //国家标准及规范
|
|
|
+ model.addAttribute("difySrc", difySrc + "2NV1GQvNY9IxM1lA");
|
|
|
+ break;
|
|
|
+ case "7": //行业标准及规范
|
|
|
+ model.addAttribute("difySrc", difySrc + "vKk88XwbCBfgaiQH");
|
|
|
+ break;
|
|
|
+ case "8": //公司内部发文和通知
|
|
|
+ model.addAttribute("difySrc", difySrc + "V7fLUXpZ4w73ftgG");
|
|
|
+ break;
|
|
|
+ case "2": //请教专家
|
|
|
+ model.addAttribute("difySrc", difySrc + "jpxMOy6u9zXQ5Uuz");
|
|
|
+ break;
|
|
|
+ case "6": //案例讨论
|
|
|
+ model.addAttribute("difySrc", difySrc + "LzY2NuohCsayFwmG");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ model.addAttribute("difySrc", difySrc + "LlXD0YzBLGPKBlqb");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "modules/knowledgeSharing/knowledgeBaseMobileDify";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查看知识库数据
|