|
@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils;
|
|
|
+import cn.iocoder.yudao.module.infra.controller.app.aipromptmanagement.WorkflowDifyaiReqVO;
|
|
|
import cn.iocoder.yudao.module.infra.controller.app.aipromptmanagement.vo.WorkflowDifyFilesReqVO;
|
|
|
import cn.iocoder.yudao.module.infra.controller.app.aipromptmanagement.vo.WorkflowDifyReqVO;
|
|
|
import cn.iocoder.yudao.module.infra.controller.app.aipromptmanagement.vo.WorkflowRunFileReqVO;
|
|
@@ -157,6 +159,29 @@ public class AiController {
|
|
|
return success(resList);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/mdToHtml")
|
|
|
+ @Operation(summary = "通过ai生成html")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:ai-prompt-management:query')")
|
|
|
+ public CommonResult<String> mdToHtml(@RequestBody WorkflowDifyaiReqVO createReqVO) {
|
|
|
+ Map<String, Object> inputs = new HashMap<>();
|
|
|
+ String apiKey = DictFrameworkUtils.parseDictDataValue("ai_key", "HTML生成");
|
|
|
+ inputs.put("type", createReqVO.getType());
|
|
|
+
|
|
|
+ inputs.put("content", createReqVO.getContent());
|
|
|
+ return success(workflowRunService.getDifyResul(inputs, createReqVO.getType(), apiKey));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/ai")
|
|
|
+ @Operation(summary = "通过ai问答")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:ai-prompt-management:query')")
|
|
|
+ public CommonResult<String> ai(@RequestBody WorkflowDifyaiReqVO createReqVO) {
|
|
|
+ Map<String, Object> inputs = new HashMap<>();
|
|
|
+ String apiKey = DictFrameworkUtils.parseDictDataValue("ai_key", "文本处理");
|
|
|
+ inputs.put("type", createReqVO.getType());
|
|
|
+
|
|
|
+ inputs.put("content", createReqVO.getContent());
|
|
|
+ return success(workflowRunService.getDifyResul(inputs, createReqVO.getType(), apiKey));
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 上传新文件
|