Commit 3c874756 authored by alex yao's avatar alex yao

fix:修复长文档接口异常

parent b9343878
......@@ -14,9 +14,21 @@ public interface AiDialoguesService {
/**
* 创建对话
*
* @param type 对话类型
* @param userId 用户ID
*/
String create(AiDialoguesTypeEnum type, Long userId) throws Exception;
/**
* 创建对话
*
* @param fileUrl 文件地址
* @param type 对话类型
* @param userId 用户ID
*/
String create(AiDialoguesTypeEnum type, String fileUrl, Long userId) throws Exception;
/**
* 获取对话详情
......
......@@ -47,6 +47,10 @@ public class AiDialoguesServiceImpl implements AiDialoguesService {
return bizAiDialoguesService.create(type.getType(), userId);
}
@Override
public String create(AiDialoguesTypeEnum type, String fileUrl, Long userId) throws Exception {
return bizAiDialoguesService.create(type.getType(), fileUrl, userId);
}
@Override
public AiDialoguesRecordDto dialoguesDetail(String dialoguesId, Long userId) throws Exception {
......
......@@ -7,6 +7,7 @@ import cn.com.poc.ai_dialogues.dto.BatchDelAiDialoguesDto;
import cn.com.poc.ai_dialogues.rest.AiDialoguesRest;
import cn.com.poc.common.utils.Assert;
import cn.com.poc.common.utils.BlContext;
import cn.com.poc.common.utils.StringUtils;
import cn.com.poc.expose.dto.DialoguesContextDto;
import cn.com.poc.support.security.oauth.entity.UserBaseEntity;
import cn.com.yict.framemax.core.exception.BusinessException;
......@@ -30,6 +31,9 @@ public class AiDialoguesRestImpl implements AiDialoguesRest {
if (ObjectUtil.isEmpty(userBaseEntity)) {
throw new BusinessException("用户未登录");
}
if (StringUtils.isNotBlank(fileUrl)) {
return aiDialoguesService.create(AiDialoguesTypeEnum.getByType(type), fileUrl, userBaseEntity.getUserId());
}
return aiDialoguesService.create(AiDialoguesTypeEnum.getByType(type), userBaseEntity.getUserId());
}
......
......@@ -14,7 +14,9 @@ public interface BizAiDialoguesService extends BaseService {
* @param userId
* @return
*/
String create(String type,Long userId);
String create(String type, Long userId);
String create(String type, String fileUrl, Long userId);
BizAiDialoguesEntity get(java.lang.Long id) throws Exception;
......
......@@ -36,6 +36,19 @@ public class BizAiDialoguesServiceImpl extends BaseServiceImpl
return dialoguesId;
}
@Override
public String create(String type, String fileUrl, Long userId) {
String dialoguesId = type + "_" + UUIDTool.getUUID();
BizAiDialoguesModel model = new BizAiDialoguesModel();
model.setDialoguesId(dialoguesId);
model.setDialoguesType(type);
model.setFileUrl(fileUrl);
model.setMemberId(userId);
this.repository.save(model);
return dialoguesId;
}
public BizAiDialoguesEntity get(java.lang.Long id) throws Exception {
Assert.notNull(id);
BizAiDialoguesModel model = this.repository.get(id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment