|
|
@ -37,6 +37,7 @@ import com.xxl.job.core.log.XxlJobLogger; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
|
|
|
|
import org.apache.poi.ss.formula.functions.T; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.logger.BladeLogger; |
|
|
|
import org.springblade.core.log.logger.BladeLogger; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
@ -196,6 +197,29 @@ public class InteractiveServiceImpl implements IInteractiveService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
|
|
|
|
public List hotQuestions() { |
|
|
|
|
|
|
|
String url = fdpHost + bigModelInvokeUrl.getHotQuestion(); |
|
|
|
|
|
|
|
return this.postCall(url,null,List.class); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 远程调用http接口 |
|
|
|
|
|
|
|
* @param url 接口url |
|
|
|
|
|
|
|
* @param body 传参 |
|
|
|
|
|
|
|
* @param resultT 结果解析对象 |
|
|
|
|
|
|
|
* @return 结果 |
|
|
|
|
|
|
|
* @param <T> 结果解析对象类型 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public <T> T postCall(String url,Map body,Class<T> resultT) { |
|
|
|
|
|
|
|
HttpResponse response = HttpRequest.post(url).body(JSON.toJSONString(body)).execute(); |
|
|
|
|
|
|
|
Assert.isTrue(response.getStatus() == HttpServletResponse.SC_OK, () -> { |
|
|
|
|
|
|
|
log.error("远程调用大模型接口" + url + "失败!"); |
|
|
|
|
|
|
|
throw new ServiceException("远程调用大模型接口" + url + "失败!"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return JSONObject.parseObject(response.body(),resultT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateVideo(Map<String, Object> request) { |
|
|
|
public void updateVideo(Map<String, Object> request) { |
|
|
|
HttpResponse response = HttpRequest.post(fdpHost + bigModelInvokeUrl.getUpdateVideo()) |
|
|
|
HttpResponse response = HttpRequest.post(fdpHost + bigModelInvokeUrl.getUpdateVideo()) |
|
|
|
.body(JSON.toJSONString(request)).execute(); |
|
|
|
.body(JSON.toJSONString(request)).execute(); |
|
|
|