【测试用例新增】AI:文多多 API 测试完善

This commit is contained in:
xiaoxin
2025-03-17 09:46:47 +08:00
parent a82abed2b5
commit c79273c5d6
2 changed files with 330 additions and 4 deletions

View File

@@ -86,8 +86,29 @@ public class WddApi {
* 创建任务
*
* @param type 类型
* 1.智能生成(主题、要求)
* 2.上传文件生成
* 3.上传思维导图生成
* 4.通过word精准转ppt
* 5.通过网页链接生成
* 6.粘贴文本内容生成
* 7.Markdown大纲生成
* @param content 内容
* type=1 用户输入主题或要求不超过1000字符
* type=2、4 不传
* type=3 幕布等分享链接
* type=5 网页链接地址http/https
* type=6 粘贴文本内容不超过20000字符
* type=7 大纲内容markdown
* @param files 文件列表
* 文件列表文件数不超过5个总大小不超过50M
* type=1 上传参考文件(非必传,支持多个)
* type=2 上传文件(支持多个)
* type=3 上传思维导图xmind/mm/md仅支持一个
* type=4 上传word文件仅支持一个
* type=5、6、7 不传
* <p>
* 支持格式doc/docx/pdf/ppt/pptx/txt/md/xls/xlsx/csv/html/epub/mobi/xmind/mm
* @return 任务ID
*/
public ApiResponse createTask(String token, Integer type, String content, List<MultipartFile> files) {
@@ -127,7 +148,7 @@ public class WddApi {
return this.webClient.get()
.uri(uri)
.retrieve()
.onStatus(STATUS_PREDICATE, EXCEPTION_FUNCTION.apply(null))
.onStatus(STATUS_PREDICATE, EXCEPTION_FUNCTION.apply(lang))
.bodyToMono(new ParameterizedTypeReference<ApiResponse>() {
})
.<Map<String, Object>>handle((response, sink) -> {
@@ -164,15 +185,14 @@ public class WddApi {
* @param question 用户修改建议
* @return 大纲内容流
*/
public Flux<Map<String, Object>> updateOutlineContent(String token, String id, String markdown, String question) {
UpdateOutlineRequest request = new UpdateOutlineRequest(id, markdown, question);
public Flux<Map<String, Object>> updateOutlineContent(String token, UpdateOutlineRequest request) {
return this.webClient.post()
.uri("/api/ppt/v2/updateContent")
.header("token", token)
.body(Mono.just(request), UpdateOutlineRequest.class)
.retrieve()
.onStatus(STATUS_PREDICATE, EXCEPTION_FUNCTION.apply(request))
.bodyToFlux(new ParameterizedTypeReference<Map<String, Object>>() {
.bodyToFlux(new ParameterizedTypeReference<>() {
});
}