diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/Midjourney/MjHttpExecute.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/Midjourney/MjHttpExecute.java new file mode 100644 index 000000000..2fc61bda7 --- /dev/null +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/Midjourney/MjHttpExecute.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.framework.ai.Midjourney; + +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.web.client.RestTemplate; + +public class MjHttpExecute implements MjExecute { + + private static final String URL = "https://discord.com/"; + + private RestTemplate restTemplate = new RestTemplate(); + + + @Override + public boolean execute(MjCommandEnum mjCommand, String prompt) { + // 发送的 uri + String uri = "api/v9/interactions"; + // restTemplate 发送post请求 + String result = restTemplate.postForObject(URL + uri, prompt, String.class); + // 加载当前目录下文件 + + return false; + } +}