mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 17:40:05 +08:00
增加mj 执行器(先提交一下)
This commit is contained in:
parent
e91e7355dc
commit
bd8e6c2b40
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user