mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 20:25:12 +00:00
(fix)(chat) 修复插件调用问题
修复插件调用问题,将原有的Json解析替换成fastjson的json解析,并按String解析返回体,否则会报:Error while extracting response for type [class java.lang.Object] and content type [application/xml;charset=UTF-8]
This commit is contained in:
@@ -88,10 +88,10 @@ public class WebServiceQuery extends PluginSemanticQuery {
|
|||||||
restTemplate = ContextUtils.getBean(RestTemplate.class);
|
restTemplate = ContextUtils.getBean(RestTemplate.class);
|
||||||
try {
|
try {
|
||||||
responseEntity =
|
responseEntity =
|
||||||
restTemplate.exchange(requestUrl, HttpMethod.POST, entity, Object.class);
|
restTemplate.exchange(requestUrl, HttpMethod.POST, entity, String.class);
|
||||||
objectResponse = responseEntity.getBody();
|
objectResponse = responseEntity.getBody();
|
||||||
log.info("objectResponse:{}", objectResponse);
|
log.info("objectResponse:{}", objectResponse);
|
||||||
Map<String, Object> response = JsonUtil.objectToMap(objectResponse);
|
Map<String, Object> response = Json.parseObject(objectResponse.toString());
|
||||||
webServiceResponse.setResult(response);
|
webServiceResponse.setResult(response);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("Exception:{}", e.getMessage());
|
log.info("Exception:{}", e.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user