增加mj 执行器(先提交一下)

This commit is contained in:
cherishsince 2024-04-02 00:44:04 +08:00
parent e91e7355dc
commit bd8e6c2b40

View File

@ -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;
}
}