mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-02-02 16:45:24 +08:00
v3.9.1 后台代码
This commit is contained in:
@ -0,0 +1,39 @@
|
||||
package org.jeecg.common.airag.api;
|
||||
|
||||
import org.jeecg.common.airag.api.fallback.AiragBaseApiFallback;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* airag baseAPI
|
||||
*
|
||||
* @author sjlei
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "airagBaseRemoteApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = AiragBaseApiFallback.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.airag.llm.service.impl.AiragBaseApiImpl")
|
||||
public interface IAiragBaseApi {
|
||||
|
||||
/**
|
||||
* 知识库写入文本文档
|
||||
*
|
||||
* @param knowledgeId 知识库ID
|
||||
* @param title 文档标题
|
||||
* @param content 文档内容
|
||||
* @return 新增的文档ID
|
||||
* @author sjlei
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
@PostMapping("/airag/api/knowledgeWriteTextDocument")
|
||||
String knowledgeWriteTextDocument(
|
||||
@RequestParam("knowledgeId") String knowledgeId,
|
||||
@RequestParam("title") String title,
|
||||
@RequestParam("content") String content
|
||||
);
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package org.jeecg.common.airag.api.factory;
|
||||
|
||||
import org.jeecg.common.airag.api.IAiragBaseApi;
|
||||
import org.jeecg.common.airag.api.fallback.AiragBaseApiFallback;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AiragBaseApiFallbackFactory implements FallbackFactory<IAiragBaseApi> {
|
||||
|
||||
@Override
|
||||
public IAiragBaseApi create(Throwable cause) {
|
||||
AiragBaseApiFallback fallback = new AiragBaseApiFallback();
|
||||
fallback.setCause(cause);
|
||||
return fallback;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package org.jeecg.common.airag.api.fallback;
|
||||
|
||||
import lombok.Setter;
|
||||
import org.jeecg.common.airag.api.IAiragBaseApi;
|
||||
|
||||
public class AiragBaseApiFallback implements IAiragBaseApi {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public String knowledgeWriteTextDocument(String knowledgeId, String title, String content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -18,6 +18,7 @@ import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -872,6 +873,18 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
@PostMapping(value = "/sys/api/runAiragFlow")
|
||||
Object runAiragFlow(@RequestBody AiragFlowDTO airagFlowDTO);
|
||||
|
||||
/**
|
||||
* 流式运行AIRag流程
|
||||
* for [QQYUN-13634]在baseapi里面封装方法,方便其他模块调用
|
||||
*
|
||||
* @param airagFlowDTO
|
||||
* @return 流程执行结果,可能是String或者Map
|
||||
* @author chenrui
|
||||
* @date 2025/9/2 11:43
|
||||
*/
|
||||
@PostMapping(value = "/sys/api/runAiragFlowStream")
|
||||
SseEmitter runAiragFlowStream(@RequestBody AiragFlowDTO airagFlowDTO);
|
||||
|
||||
/**
|
||||
* 根据部门code或部门id获取部门名称(当前和上级部门)
|
||||
*
|
||||
|
||||
@ -12,6 +12,7 @@ import org.jeecg.common.constant.enums.DySmsEnum;
|
||||
import org.jeecg.common.constant.enums.EmailTemplateEnum;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -506,6 +507,11 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SseEmitter runAiragFlowStream(AiragFlowDTO airagFlowDTO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uniPushMsgToUser(PushMessageDTO pushMessageDTO) {
|
||||
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
package org.jeecg.common.airag.api;
|
||||
|
||||
/**
|
||||
* airag baseAPI
|
||||
*
|
||||
* @author sjlei
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
public interface IAiragBaseApi {
|
||||
|
||||
/**
|
||||
* 知识库写入文本文档
|
||||
*
|
||||
* @param knowledgeId 知识库ID
|
||||
* @param title 文档标题
|
||||
* @param content 文档内容
|
||||
* @return 新增的文档ID
|
||||
* @author sjlei
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
String knowledgeWriteTextDocument(String knowledgeId, String title, String content);
|
||||
|
||||
}
|
||||
@ -11,6 +11,7 @@ import org.jeecg.common.constant.enums.DySmsEnum;
|
||||
import org.jeecg.common.constant.enums.EmailTemplateEnum;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -618,6 +619,17 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
*/
|
||||
Object runAiragFlow(AiragFlowDTO airagFlowDTO);
|
||||
|
||||
/**
|
||||
* 流式运行AIRag流程
|
||||
* for [QQYUN-13634]在baseapi里面封装方法,方便其他模块调用
|
||||
*
|
||||
* @param airagFlowDTO
|
||||
* @return 流程执行结果,可能是String或者Map
|
||||
* @author chenrui
|
||||
* @date 2025/9/2 11:43
|
||||
*/
|
||||
SseEmitter runAiragFlowStream(AiragFlowDTO airagFlowDTO);
|
||||
|
||||
/**
|
||||
* 根据部门code或部门id获取部门名称(当前和上级部门)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user