mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 15:51:52 +08:00
【优化】重命名 midjourney properties
This commit is contained in:
parent
9ae25aa0b8
commit
7358084198
@ -10,9 +10,18 @@ import lombok.Data;
|
|||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class MidjourneyProperties {
|
public class MidjourneyConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* keys
|
||||||
|
*/
|
||||||
private String key;
|
private String key;
|
||||||
|
/**
|
||||||
|
* 请求地址
|
||||||
|
*/
|
||||||
private String url;
|
private String url;
|
||||||
|
/**
|
||||||
|
* 通知回调地址
|
||||||
|
*/
|
||||||
private String notifyUrl;
|
private String notifyUrl;
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.framework.ai.core.model.midjourney.api;
|
package cn.iocoder.yudao.framework.ai.core.model.midjourney.api;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.ai.core.model.midjourney.MidjourneyProperties;
|
import cn.iocoder.yudao.framework.ai.core.model.midjourney.MidjourneyConfig;
|
||||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@ -29,13 +29,13 @@ public class MidjourneyApi {
|
|||||||
private static final String URI_ACTON = "/submit/action";
|
private static final String URI_ACTON = "/submit/action";
|
||||||
private static final String URI_LIST_BY_CONDITION = "/task/list-by-condition";
|
private static final String URI_LIST_BY_CONDITION = "/task/list-by-condition";
|
||||||
private final WebClient webClient;
|
private final WebClient webClient;
|
||||||
private final MidjourneyProperties midjourneyProperties;
|
private final MidjourneyConfig midjourneyConfig;
|
||||||
|
|
||||||
public MidjourneyApi(MidjourneyProperties midjourneyProperties) {
|
public MidjourneyApi(MidjourneyConfig midjourneyConfig) {
|
||||||
this.midjourneyProperties = midjourneyProperties;
|
this.midjourneyConfig = midjourneyConfig;
|
||||||
this.webClient = WebClient.builder()
|
this.webClient = WebClient.builder()
|
||||||
.baseUrl(midjourneyProperties.getUrl())
|
.baseUrl(midjourneyConfig.getUrl())
|
||||||
.defaultHeaders(ApiUtils.getJsonContentHeaders(midjourneyProperties.getKey()))
|
.defaultHeaders(ApiUtils.getJsonContentHeaders(midjourneyConfig.getKey()))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user