mirror of
https://github.com/OpenSPG/openspg.git
synced 2025-09-25 08:20:11 +00:00
bugfix
This commit is contained in:
parent
532f03aead
commit
21ac3e4efc
@ -14,28 +14,14 @@
|
||||
package com.antgroup.openspg.server.api.facade.dto.common.response;
|
||||
|
||||
import com.antgroup.openspg.server.common.model.base.BaseResponse;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
public class SearchEngineIndexResponse extends BaseResponse {
|
||||
|
||||
private String connInfo;
|
||||
|
||||
private String indexName;
|
||||
|
||||
public String getConnInfo() {
|
||||
return connInfo;
|
||||
}
|
||||
|
||||
public SearchEngineIndexResponse setConnInfo(String connInfo) {
|
||||
this.connInfo = connInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIndexName() {
|
||||
return indexName;
|
||||
}
|
||||
|
||||
public SearchEngineIndexResponse setIndexName(String indexName) {
|
||||
this.indexName = indexName;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2023 Ant Group CO., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied.
|
||||
*/
|
||||
|
||||
package com.antgroup.openspg.server.biz.common.impl;
|
||||
|
||||
import com.antgroup.openspg.cloudext.interfaces.searchengine.SearchEngineClient;
|
||||
import com.antgroup.openspg.cloudext.interfaces.searchengine.SearchEngineClientDriverManager;
|
||||
import com.antgroup.openspg.server.api.facade.dto.common.request.SearchEngineIndexRequest;
|
||||
import com.antgroup.openspg.server.api.facade.dto.common.response.SearchEngineIndexResponse;
|
||||
import com.antgroup.openspg.server.biz.common.SearchEngineManager;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class SearchEngineManagerImpl implements SearchEngineManager {
|
||||
|
||||
@Value("cloudext.searchengine.url")
|
||||
private String searchEngineUrl;
|
||||
|
||||
@Override
|
||||
public SearchEngineIndexResponse queryIndex(SearchEngineIndexRequest request) {
|
||||
SearchEngineClient searchEngineClient =
|
||||
SearchEngineClientDriverManager.getClient(searchEngineUrl);
|
||||
|
||||
String convertedIndexName =
|
||||
searchEngineClient.getIdxNameConvertor().convertIdxName(request.getSpgType());
|
||||
return new SearchEngineIndexResponse().setIndexName(convertedIndexName);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user