|
@@ -59,11 +59,15 @@ public class ChunkController {
|
|
|
@ApiOperation("删除文本块")
|
|
@ApiOperation("删除文本块")
|
|
|
public Result<Object> deleteDataset(@PathVariable String dataset_id , @PathVariable String document_id , @PathVariable String segment_id ) {
|
|
public Result<Object> deleteDataset(@PathVariable String dataset_id , @PathVariable String document_id , @PathVariable String segment_id ) {
|
|
|
String url = difyProperties.getBaseUrl() + "datasets/"+ dataset_id +"/documents/"+document_id +"/segments/"+segment_id;
|
|
String url = difyProperties.getBaseUrl() + "datasets/"+ dataset_id +"/documents/"+document_id +"/segments/"+segment_id;
|
|
|
- return httpService.delete(
|
|
|
|
|
|
|
+ Result<Object> result = httpService.delete(
|
|
|
url,
|
|
url,
|
|
|
null,
|
|
null,
|
|
|
"Bearer "+difyProperties.getDatasetApiKey(),
|
|
"Bearer "+difyProperties.getDatasetApiKey(),
|
|
|
new TypeReference<>() {}) ;
|
|
new TypeReference<>() {}) ;
|
|
|
|
|
+ if (result.isSuccess()) {
|
|
|
|
|
+ return Result.result("删除成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/{dataset_id}/{document_id}")
|
|
@PostMapping("/{dataset_id}/{document_id}")
|