Commit 911f5f8bf38c1de373dcc9c192092c0f4c3923a6
1 parent
c357e7ae
【代码评审】AI:PPT 相关
Showing
4 changed files
with
4 additions
and
19 deletions
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/wenduoduo/api/WenDuoDuoPptApi.java
| ... | ... | @@ -25,7 +25,6 @@ import java.util.Objects; |
| 25 | 25 | import java.util.function.Function; |
| 26 | 26 | import java.util.function.Predicate; |
| 27 | 27 | |
| 28 | - | |
| 29 | 28 | /** |
| 30 | 29 | * 文多多 API |
| 31 | 30 | * |
| ... | ... | @@ -50,11 +49,6 @@ public class WenDuoDuoPptApi { |
| 50 | 49 | sink.error(new IllegalStateException("[WenDuoDuoPptApi] 调用失败!")); |
| 51 | 50 | }); |
| 52 | 51 | |
| 53 | - /** | |
| 54 | - * 构造方法 | |
| 55 | - * | |
| 56 | - * @param token API令牌,可为空,后续API调用时单独指定 | |
| 57 | - */ | |
| 58 | 52 | public WenDuoDuoPptApi(String token) { |
| 59 | 53 | Assert.hasText(token, "token 不能为空"); |
| 60 | 54 | this.webClient = WebClient.builder() |
| ... | ... | @@ -96,7 +90,7 @@ public class WenDuoDuoPptApi { |
| 96 | 90 | * @param type 类型 |
| 97 | 91 | * @param content 内容 |
| 98 | 92 | * @param files 文件列表 |
| 99 | - * @return 任务ID | |
| 93 | + * @return 任务 ID | |
| 100 | 94 | * @see <a href="https://docmee.cn/open-platform/api#%E5%88%9B%E5%BB%BA%E4%BB%BB%E5%8A%A1">创建任务</a> |
| 101 | 95 | */ |
| 102 | 96 | public ApiResponse createTask(Integer type, String content, List<MultipartFile> files) { |
| ... | ... | @@ -219,7 +213,7 @@ public class WenDuoDuoPptApi { |
| 219 | 213 | } |
| 220 | 214 | |
| 221 | 215 | /** |
| 222 | - * 创建Token请求参数 | |
| 216 | + * 创建 Token 请求参数 | |
| 223 | 217 | */ |
| 224 | 218 | @JsonInclude(value = JsonInclude.Include.NON_NULL) |
| 225 | 219 | public record CreateTokenRequest( | ... | ... |
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/api/XunFeiPptApi.java
| ... | ... | @@ -448,7 +448,6 @@ public class XunFeiPptApi { |
| 448 | 448 | */ |
| 449 | 449 | private MultiValueMap<String, Object> buildCreatePptFormData(CreatePptRequest request) { |
| 450 | 450 | MultiValueMap<String, Object> formData = new LinkedMultiValueMap<>(); |
| 451 | - | |
| 452 | 451 | if (request.file() != null) { |
| 453 | 452 | try { |
| 454 | 453 | formData.add("file", new ByteArrayResource(request.file().getBytes()) { |
| ... | ... | @@ -493,7 +492,6 @@ public class XunFeiPptApi { |
| 493 | 492 | isPresent = true; |
| 494 | 493 | } |
| 495 | 494 | } |
| 496 | - | |
| 497 | 495 | if (isPresent) { |
| 498 | 496 | map.put(key, value); |
| 499 | 497 | } | ... | ... |
yudao-module-ai/yudao-spring-boot-starter-ai/src/test/java/cn/iocoder/yudao/framework/ai/mcp/DouBaoMcpTests.java
| ... | ... | @@ -9,10 +9,8 @@ import org.springframework.ai.openai.api.OpenAiApi; |
| 9 | 9 | import org.springframework.ai.tool.annotation.Tool; |
| 10 | 10 | import org.springframework.ai.tool.method.MethodToolCallbackProvider; |
| 11 | 11 | |
| 12 | - | |
| 13 | 12 | public class DouBaoMcpTests { |
| 14 | 13 | |
| 15 | - | |
| 16 | 14 | private final OpenAiChatModel openAiChatModel = OpenAiChatModel.builder() |
| 17 | 15 | .openAiApi(OpenAiApi.builder() |
| 18 | 16 | .baseUrl(DouBaoChatModel.BASE_URL) |
| ... | ... | @@ -121,4 +119,4 @@ public class DouBaoMcpTests { |
| 121 | 119 | |
| 122 | 120 | } |
| 123 | 121 | |
| 124 | -} | |
| 125 | 122 | \ No newline at end of file |
| 123 | +} | |
| 126 | 124 | \ No newline at end of file | ... | ... |
yudao-module-ai/yudao-spring-boot-starter-ai/src/test/java/cn/iocoder/yudao/framework/ai/ppt/wdd/WenDuoDuoPptApiTests.java
| ... | ... | @@ -16,13 +16,8 @@ import java.util.Objects; |
| 16 | 16 | */ |
| 17 | 17 | public class WenDuoDuoPptApiTests { |
| 18 | 18 | |
| 19 | - private final WenDuoDuoPptApi wenDuoDuoPptApi; | |
| 20 | - | |
| 21 | 19 | private final String token = ""; // API Token |
| 22 | - | |
| 23 | - { | |
| 24 | - wenDuoDuoPptApi = new WenDuoDuoPptApi(token); | |
| 25 | - } | |
| 20 | + private final WenDuoDuoPptApi wenDuoDuoPptApi = new WenDuoDuoPptApi(token); | |
| 26 | 21 | |
| 27 | 22 | @Test |
| 28 | 23 | @Disabled | ... | ... |