Commit 6c72fa18 authored by alex yao's avatar alex yao

feat(LongTextDialogues):新增批量删除对话接口

parent d46339dc
...@@ -38,11 +38,9 @@ import cn.com.poc.thirdparty.resource.demand.ai.entity.largemodel.LargeModelDema ...@@ -38,11 +38,9 @@ import cn.com.poc.thirdparty.resource.demand.ai.entity.largemodel.LargeModelDema
import cn.com.poc.thirdparty.resource.demand.ai.entity.largemodel.LargeModelResponse; import cn.com.poc.thirdparty.resource.demand.ai.entity.largemodel.LargeModelResponse;
import cn.com.poc.thirdparty.service.LLMService; import cn.com.poc.thirdparty.service.LLMService;
import cn.com.yict.framemax.core.exception.BusinessException; import cn.com.yict.framemax.core.exception.BusinessException;
import cn.com.yict.framemax.core.i18n.I18nMessageException;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.crypto.digest.MD5; import cn.hutool.crypto.digest.MD5;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
......
package cn.com.poc.long_document.dto;
import java.util.List;
/**
* @author alex.yao
* @date 2025/6/19
*/
public class BatchDelDialoguesDto {
private List<String> dialoguesIds;
public List<String> getDialoguesIds() {
return dialoguesIds;
}
public void setDialoguesIds(List<String> dialoguesIds) {
this.dialoguesIds = dialoguesIds;
}
}
...@@ -29,8 +29,7 @@ public interface LongTextDialoguesRest extends BaseRest { ...@@ -29,8 +29,7 @@ public interface LongTextDialoguesRest extends BaseRest {
String create(@RequestBody CreateDialoguesDto dto) throws Exception; String create(@RequestBody CreateDialoguesDto dto) throws Exception;
/** /**
*核心观点提取、总结摘要 * 核心观点提取、总结摘要
*
*/ */
LongTextSummaryDto summary(@RequestParam String dialoguesId) throws Exception; LongTextSummaryDto summary(@RequestParam String dialoguesId) throws Exception;
...@@ -51,6 +50,14 @@ public interface LongTextDialoguesRest extends BaseRest { ...@@ -51,6 +50,14 @@ public interface LongTextDialoguesRest extends BaseRest {
*/ */
void delete(@RequestParam String dialoguesId) throws Exception; void delete(@RequestParam String dialoguesId) throws Exception;
/**
* 批量删除对话
*
* @param dto
* @throws Exception
*/
void batchDelete(@RequestBody BatchDelDialoguesDto dto) throws Exception;
/** /**
* 对话详情 * 对话详情
* *
......
...@@ -9,6 +9,7 @@ import cn.com.poc.long_document.rest.LongTextDialoguesRest; ...@@ -9,6 +9,7 @@ import cn.com.poc.long_document.rest.LongTextDialoguesRest;
import cn.com.poc.support.security.oauth.entity.UserBaseEntity; import cn.com.poc.support.security.oauth.entity.UserBaseEntity;
import cn.com.yict.framemax.core.exception.BusinessException; import cn.com.yict.framemax.core.exception.BusinessException;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
...@@ -71,6 +72,23 @@ public class LongTextDialoguesRestImpl implements LongTextDialoguesRest { ...@@ -71,6 +72,23 @@ public class LongTextDialoguesRestImpl implements LongTextDialoguesRest {
longTextDialoguesService.delete(dialoguesId, userBaseEntity.getUserId()); 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 @Override
public LongTextDialoguesDto dialoguesDetail(String dialoguesId) throws Exception { public LongTextDialoguesDto dialoguesDetail(String dialoguesId) throws Exception {
Assert.notBlank(dialoguesId, "对话ID不能为空"); Assert.notBlank(dialoguesId, "对话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