Commit 94f4a2e9 authored by alex yao's avatar alex yao

fix:修复长文档接口异常

parent 36f468ff
......@@ -16,6 +16,7 @@ public class BizAgentApplicationDialoguesRecordConvert {
entity.setContent(model.getContent());
entity.setReasoningContent(model.getReasoningContent());
entity.setImageUrl(model.getImageUrl());
entity.setFileUrl(model.getFileUrl());
entity.setDialogsId(model.getDialogsId());
entity.setTimestamp(model.getTimestamp());
entity.setIsDeleted(model.getIsDeleted());
......@@ -37,6 +38,7 @@ public class BizAgentApplicationDialoguesRecordConvert {
model.setContent(entity.getContent());
model.setReasoningContent(entity.getReasoningContent());
model.setImageUrl(entity.getImageUrl());
model.setFileUrl(entity.getFileUrl());
model.setTimestamp(entity.getTimestamp());
model.setIsDeleted(entity.getIsDeleted());
model.setCreator(entity.getCreator());
......@@ -57,6 +59,7 @@ public class BizAgentApplicationDialoguesRecordConvert {
dto.setContent(entity.getContent());
dto.setReasoningContent(entity.getReasoningContent());
dto.setImageUrl(entity.getImageUrl());
dto.setFileUrl(entity.getFileUrl());
dto.setTimestamp(entity.getTimestamp());
dto.setIsDeleted(entity.getIsDeleted());
dto.setCreator(entity.getCreator());
......@@ -77,6 +80,7 @@ public class BizAgentApplicationDialoguesRecordConvert {
entity.setContent(dto.getContent());
entity.setReasoningContent(dto.getReasoningContent());
entity.setImageUrl(dto.getImageUrl());
entity.setFileUrl(dto.getFileUrl());
entity.setTimestamp(dto.getTimestamp());
entity.setIsDeleted(dto.getIsDeleted());
entity.setCreator(dto.getCreator());
......
......@@ -117,6 +117,21 @@ public class BizAgentApplicationDialoguesRecordDto {
this.imageUrl = imageUrl;
}
/**
* file_url
* 文件地址
*/
private java.lang.String fileUrl;
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
/**
* timestamp
* 时间戳
......
......@@ -103,6 +103,19 @@ public class BizAgentApplicationDialoguesRecordEntity {
this.imageUrl = imageUrl;
}
/**
* 文件地址
*/
private java.lang.String fileUrl;
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
/**
* dialogsId
* 对话ID
......
......@@ -161,6 +161,21 @@ public class BizAgentApplicationDialoguesRecordModel extends BaseModelClass impl
this.imageUrl = imageUrl;
}
/**
* file_url
* 文件地址
*/
private java.lang.String fileUrl;
@Column(name = "file_url", length = 120)
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
/**
* timestamp
* 时间戳
......
package cn.com.poc.long_document.aggregate;
import cn.com.poc.long_document.dto.DialoguesContextDto;
import cn.com.poc.long_document.dto.LongTextDialoguesDto;
import cn.com.poc.long_document.dto.LongTextExampleDto;
import cn.com.poc.long_document.dto.LongTextSummaryDto;
......@@ -13,20 +11,11 @@ import java.util.List;
*/
public interface LongTextDialoguesService {
String create(String fileUrl, Long userId) throws Exception;
void call(String dialoguesId, String fileUrl, String input, Integer[] knowledgeIds, Long userId) throws Exception;
LongTextSummaryDto summary(String dialoguesId, Long userId) throws Exception;
void delete(String dialoguesId, Long userId) throws Exception;
LongTextDialoguesDto dialoguesDetail(String dialoguesId, Long userId) throws Exception;
List<LongTextDialoguesDto> dialoguesList(Long userId) throws Exception;
List<DialoguesContextDto> dialoguesContext(String dialoguesId, Long userId) throws Exception;
List<LongTextExampleDto> example() throws Exception;
}
package cn.com.poc.long_document.rest;
import cn.com.poc.long_document.dto.*;
import cn.com.poc.long_document.dto.LongTextDialoguesCallDto;
import cn.com.poc.long_document.dto.LongTextExampleDto;
import cn.com.poc.long_document.dto.LongTextSummaryDto;
import cn.com.yict.framemax.core.rest.BaseRest;
import cn.com.yict.framemax.web.permission.Access;
import cn.com.yict.framemax.web.permission.Permission;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
......@@ -20,14 +21,6 @@ import java.util.List;
public interface LongTextDialoguesRest extends BaseRest {
/**
* 创建对话
*
* @return
* @throws Exception
*/
String create(@RequestBody CreateDialoguesDto dto) throws Exception;
/**
* 核心观点提取、总结摘要
*/
......@@ -42,48 +35,6 @@ public interface LongTextDialoguesRest extends BaseRest {
void call(@RequestBody LongTextDialoguesCallDto dto) throws Exception;
/**
* 删除对话
*
* @param dialoguesId
* @throws Exception
*/
void delete(@RequestParam String dialoguesId) throws Exception;
/**
* 批量删除对话
*
* @param dto
* @throws Exception
*/
void batchDelete(@RequestBody BatchDelDialoguesDto dto) throws Exception;
/**
* 对话详情
*
* @param dialoguesId
* @return
*/
LongTextDialoguesDto dialoguesDetail(@RequestParam String dialoguesId) throws Exception;
/**
* 对话列表
*
* @return
* @throws Exception
*/
List<LongTextDialoguesDto> dialoguesList() throws Exception;
/**
* 对话上下文
*
* @param dialoguesId
* @return
* @throws Exception
*/
List<DialoguesContextDto> dialoguesContext(@RequestParam String dialoguesId) throws Exception;
/**
* 示例
*
......
......@@ -4,12 +4,13 @@ package cn.com.poc.long_document.rest.impl;
import cn.com.poc.common.utils.Assert;
import cn.com.poc.common.utils.BlContext;
import cn.com.poc.long_document.aggregate.LongTextDialoguesService;
import cn.com.poc.long_document.dto.*;
import cn.com.poc.long_document.dto.LongTextDialoguesCallDto;
import cn.com.poc.long_document.dto.LongTextExampleDto;
import cn.com.poc.long_document.dto.LongTextSummaryDto;
import cn.com.poc.long_document.rest.LongTextDialoguesRest;
import cn.com.poc.support.security.oauth.entity.UserBaseEntity;
import cn.com.yict.framemax.core.exception.BusinessException;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.List;
......@@ -25,16 +26,6 @@ public class LongTextDialoguesRestImpl implements LongTextDialoguesRest {
@Resource
private LongTextDialoguesService longTextDialoguesService;
@Override
public String create(CreateDialoguesDto dto) throws Exception {
Assert.notNull(dto.getFileUrl(), "文件URL不能为空");
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
if (userBaseEntity == null) {
throw new BusinessException("用户未登录");
}
return longTextDialoguesService.create(dto.getFileUrl(), userBaseEntity.getUserId());
}
@Override
public void call(LongTextDialoguesCallDto dto) throws Exception {
Assert.notBlank(dto.getDialoguesId(), "对话ID不能为空");
......@@ -61,63 +52,6 @@ public class LongTextDialoguesRestImpl implements LongTextDialoguesRest {
return longTextDialoguesService.summary(dialoguesId, userBaseEntity.getUserId());
}
@Override
public void delete(String dialoguesId) throws Exception {
Assert.notBlank(dialoguesId, "对话ID不能为空");
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
if (userBaseEntity == null) {
throw new BusinessException("用户未登录");
}
longTextDialoguesService.delete(dialoguesId, userBaseEntity.getUserId());
}
@Override
public void batchDelete(BatchDelDialoguesDto dto) {
Assert.notNull(dto, "批量删除对话DTO不能为空");
Assert.notEmpty(dto.getDialoguesIds(), "对话ID列表不能为空");
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
if (userBaseEntity == null) {
throw new BusinessException("用户未登录");
}
dto.getDialoguesIds().parallelStream().forEach(dialoguesId -> {
try {
longTextDialoguesService.delete(dialoguesId, userBaseEntity.getUserId());
} catch (Exception e) {
throw new BusinessException("----批量删除对话失败----", e);
}
});
}
@Override
public LongTextDialoguesDto dialoguesDetail(String dialoguesId) throws Exception {
Assert.notBlank(dialoguesId, "对话ID不能为空");
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
if (userBaseEntity == null) {
throw new BusinessException("用户未登录");
}
return longTextDialoguesService.dialoguesDetail(dialoguesId, userBaseEntity.getUserId());
}
@Override
public List<LongTextDialoguesDto> dialoguesList() throws Exception {
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
if (userBaseEntity == null) {
throw new BusinessException("用户未登录");
}
return longTextDialoguesService.dialoguesList(userBaseEntity.getUserId());
}
@Override
public List<DialoguesContextDto> dialoguesContext(String dialoguesId) throws Exception {
Assert.notBlank(dialoguesId, "对话ID不能为空");
UserBaseEntity userBaseEntity = BlContext.getCurrentUserNotException();
if (userBaseEntity == null) {
throw new BusinessException("用户未登录");
}
return longTextDialoguesService.dialoguesContext(dialoguesId, userBaseEntity.getUserId());
}
@Override
public List<LongTextExampleDto> example() throws Exception {
return longTextDialoguesService.example();
......
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