mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 07:41:53 +08:00
【优化】重命名 midjourney properties
This commit is contained in:
parent
9ae25aa0b8
commit
7358084198
@ -10,9 +10,18 @@ import lombok.Data;
|
||||
* @since 1.0
|
||||
*/
|
||||
@Data
|
||||
public class MidjourneyProperties {
|
||||
public class MidjourneyConfig {
|
||||
|
||||
/**
|
||||
* keys
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 通知回调地址
|
||||
*/
|
||||
private String notifyUrl;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
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 com.google.common.collect.ImmutableMap;
|
||||
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_LIST_BY_CONDITION = "/task/list-by-condition";
|
||||
private final WebClient webClient;
|
||||
private final MidjourneyProperties midjourneyProperties;
|
||||
private final MidjourneyConfig midjourneyConfig;
|
||||
|
||||
public MidjourneyApi(MidjourneyProperties midjourneyProperties) {
|
||||
this.midjourneyProperties = midjourneyProperties;
|
||||
public MidjourneyApi(MidjourneyConfig midjourneyConfig) {
|
||||
this.midjourneyConfig = midjourneyConfig;
|
||||
this.webClient = WebClient.builder()
|
||||
.baseUrl(midjourneyProperties.getUrl())
|
||||
.defaultHeaders(ApiUtils.getJsonContentHeaders(midjourneyProperties.getKey()))
|
||||
.baseUrl(midjourneyConfig.getUrl())
|
||||
.defaultHeaders(ApiUtils.getJsonContentHeaders(midjourneyConfig.getKey()))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user